Skip to content

Conversation

@ken2812221
Copy link
Contributor

@ken2812221 ken2812221 commented May 11, 2018

Compile and run tests on Ubuntu 18.04 docker.

@fanquake fanquake added the Tests label May 11, 2018
@ken2812221 ken2812221 changed the title [WIP] Travis: Build tests on Ubuntu 18.04 with docker Travis: Build tests on Ubuntu 18.04 with docker May 11, 2018
@maflcko
Copy link
Member

maflcko commented May 11, 2018

I can't see any downside, so Concept ACK.

@promag
Copy link
Contributor

promag commented May 11, 2018

Can you elaborate the motivation behind this change?

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK.

Maybe it should also cache docker layers? Similar to http://circleci.com/docs/1.0/docker/#caching-docker-layers.

Edit: seems to take around 30 to 40 seconds in pulling images and installing extra packages.

.travis.yml Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove double space.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@maflcko
Copy link
Member

maflcko commented May 11, 2018

@promag I presume the motivation is that gitian will (soon) use bionic, so having a similar configuration run on travis isn't that bad. Also, it untangles us a bit from the travis environments and changes, as we use the vanilla bionic docker. So reproducing issues could potentially be easier or harder because it uses docker ...

I have no strong opinion based on that, but since the new qt "requires" bionic for windows cross builds, I am slightly in favor of this change.

@ken2812221
Copy link
Contributor Author

Can you elaborate the motivation behind this change?

We will bump our gitian build system to Ubuntu 18.04 since 0.17, so I think we might need to have the same build environment as the gitian build. Also, once we've merged the back-compat code, we could run the executable both on 14.04 and 18.04 to test if the back-compat code would work.

@jamesob
Copy link
Contributor

jamesob commented May 11, 2018

This will likely fix the build on #12873 by (inadvertently) using a more recent version of SSL that doesn't cause the deadlock warning system to flare up.

The job duration times don't seem adversely affected by this change.

Concept ACK

@maflcko
Copy link
Member

maflcko commented May 11, 2018

Please remove the [WIP] from the commit title when this is ready for review.

.travis.yml Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small thing, but could we add

- DOCKER_EXEC="docker exec ${DOCKER_ID}"

to cut down on some of the boilerplate below?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

@jamesob
Copy link
Contributor

jamesob commented May 11, 2018

utACK 9e7924c

@ken2812221
Copy link
Contributor Author

ken2812221 commented May 12, 2018

Maybe it should also cache docker layers? Similar to http://circleci.com/docs/1.0/docker/#caching-docker-layers.

I've tested this, docker save took more time than apt install, so we don't need to cache it.

@promag
Copy link
Contributor

promag commented May 12, 2018

@ken2812221 indeed in travis it's fast.

utACK 9e7924c.

@laanwj
Copy link
Member

laanwj commented May 14, 2018

utACK 9e7924c0cb0995f8df6cca5d04b576e5b56038a9

@laanwj laanwj requested a review from theuni May 14, 2018 13:55
.travis.yml Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I'd prefer if we only write the environment variables that are specified in the yaml (global env and job env). Currently this also exports a lot of travis specific junk, which shouldn't be necessary. No strong opinion, though, as I am not aware how to achieve this.

.travis.yml Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits:

  • Please replace the -v with the more verbose --mount type=bind,src=....,dst=...., which is suggested in the docker docs
  • You overwrite the CCACHE_DIR some lines above, but don't use that value here. Any reason for that?
  • Please replace the privliledged flag with just --cap-add SYS_ADMIN and add a comment why this is required or make it specific to the windows build.

.travis.yml Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fails, since it is executed on the host, not via DOCKER_EXEC.

@maflcko
Copy link
Member

maflcko commented May 17, 2018

Tested ACK 9e7924c0cb0995f8df6cca5d04b576e5b56038a9 (after fixing the failure)

Also left a couple of nits in the process, you can safely ignore them.

.travis.yml Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume BOOST_TEST_RANDOM and DISPLAY needs to be passed down as well?

@maflcko
Copy link
Member

maflcko commented May 17, 2018

re-ACK 09b26751e0

@theuni
Copy link
Member

theuni commented May 17, 2018

Playing around with this now.

.travis.yml Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to set wine-binfmt

.travis.yml Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still needed? IIRC it was an artifact of needing a non-default wine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is needed. wine32 is only available on i386 platform. Here is the link: https://packages.ubuntu.com/bionic/wine32

.travis.yml Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This dropped the "travis_wait 50", but I guess we're ok without it now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

travis_wait is incompitable with docker. This is a known issue.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we may not need this travis_wait anymore, due to several improvements to the unit tests' runtimes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sipa is correct. See #12970 (comment) for background. The current run time (on the windows jobs) in this pull:

i686-w64-mingw32: 245.895077045 s
x86_64-w64-mingw32: 95.965838938 s

@theuni
Copy link
Member

theuni commented May 17, 2018

Thanks for addressing my questions. utACK.

@laanwj I'd like to have a chance to look at the qt/gitian changes as well. Mind giving me until the end of this week to get to them? Ideally we'd get all of those in at once so everything remains in sync.

.travis.yml Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I incorrectly assumed that apt is an alias for apt-get and asked you to change it. This was wrong, so feel free to change it back to apt-get. Sorry.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind

@ken2812221
Copy link
Contributor Author

Update: also expose CONFIG_SHELL into docker

@jamesob
Copy link
Contributor

jamesob commented May 21, 2018

re-utACK 67cfb45

.travis.yml Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Could reuse CONFIG_SHELL as below and skip exporting USE_SHELL or is there a reason to have two separate env vars with the same value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@maflcko
Copy link
Member

maflcko commented May 21, 2018

re-ACK 67cfb4537a

Copy link
Contributor

@jnewbery jnewbery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK.

Build 4 here: https://travis-ci.org/bitcoin/bitcoin/jobs/380317076 took 36 minutes, which seems to be much longer than normal. I don't know whether that's caused by the changes in this PR or whether it's just natural variance.

@ken2812221
Copy link
Contributor Author

@jnewbery Because I just modify the enviroment variable on that one and travis read caches based on enviroment variable. So it needs to recompile everything.

.travis.yml Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this now?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we mirror the pwd for the travis vm and the docker container. Otherwise a cat config.log on the travis vm wouldn't work, I presume.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, it seems this one can be removed. Though, no harm in leaving it in, I guess.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, cat config.log below would not work then.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, makes sense. Thanks

@ken2812221
Copy link
Contributor Author

ken2812221 commented May 24, 2018

How about add DOCKER_EXEC () { docker exec $DOCKER_ID bash -c "cd $PWD && $*"; } as a bash funtion, so we don't need to cd all the time.

@maflcko
Copy link
Member

maflcko commented May 24, 2018

re-utACK a182c9d

.travis.yml Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bash: CONFIG_SHELL: command not found

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@maflcko
Copy link
Member

maflcko commented May 29, 2018

re-utACK 59e9688

Copy link
Contributor

@jamesob jamesob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-utACK 59e9688

Copy link
Contributor

@jamesob jamesob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-utACK 59e9688

@laanwj laanwj merged commit 59e9688 into bitcoin:master May 29, 2018
laanwj added a commit that referenced this pull request May 29, 2018
59e9688 Travis: Build tests on Ubuntu 18.04 with docker (Chun Kuan Lee)

Pull request description:

  Compile and run tests on Ubuntu 18.04 docker.

Tree-SHA512: 4ae5f0cf666abeff2f3e3f541d33e5c76970c5129e60d0299317d73621fafa6f0f1c6cfe7a7d1089200f29ecb1a0a61a22bc116474eb5226282939e0beb37cb8
@ken2812221 ken2812221 deleted the patch-1 branch May 29, 2018 18:07
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants