Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃彈 Use xenial VMs on Travis for faster bootup #20987

Merged
merged 9 commits into from Feb 28, 2019
Merged

馃彈 Use xenial VMs on Travis for faster bootup #20987

merged 9 commits into from Feb 28, 2019

Conversation

rsimha
Copy link
Contributor

@rsimha rsimha commented Feb 21, 2019

This PR switches the Travis VMs we use from Trusty to Xenial.

Advantages:

  • More recent Linux version (16.04 vs 14.04)
  • Fewer unnecessary services are installed by default
  • Faster VM bootup time (Xenial: ~20s, Trusty: ~40s)

References:

Changes in this PR:

  • Change dist in .travis.yml from trusty to xenial
  • Consolidate pip install of Python modules (in --user mode, to work without sudo)
  • Override Xenial's default Java 11 version (AMP needs Java 8) (OracleJDK 8 install issue on Xenial聽travis-ci/travis-ci#10290)
  • Consolidate addons section
  • Remove bundler cache (it was used for Ruby gems, and is unnecessary)
  • Replace pip caching (which doesn't work if language is not python), with directory-level caching of $HOME/.cache/pip
  • Remove the yarn upgrade step since Xenial uses the latest version of yarn (1.13.0 as of today)

Related to #20887

@rsimha
Copy link
Contributor Author

rsimha commented Feb 28, 2019

I ran some tests, and the Xenial VM boot up time (~20 seconds) is half that of Trusty (~40 seconds).

@rsimha
Copy link
Contributor Author

rsimha commented Feb 28, 2019

/to @estherkim @danielrozenberg This is now ready for review.

Copy link
Member

@danielrozenberg danielrozenberg left a comment

Choose a reason for hiding this comment

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

A quick glance at https://travis-ci.org/ampproject/amphtml/pull_requests makes it look like this results in slower builds (~10 minutes in total) - I haven't done a complete evaluation though... not sure how to measure this over a longer period

.travis.yml Outdated Show resolved Hide resolved
.travis.yml Show resolved Hide resolved
.travis.yml Outdated Show resolved Hide resolved
.travis.yml Show resolved Hide resolved
Copy link
Contributor Author

@rsimha rsimha left a comment

Choose a reason for hiding this comment

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

When I looked at the logs, the change in total running time appeared to arise from a high variance in the running time for git clone. It's being tracked by #21175.

Meanwhile, I was able to measure a consistent reduction in boot time (not part of total job running time) from ~40s to ~20s. In addition, it's preferable to use a newer version of Linux instead of one that's several years old.

Good point though. We should keep track of total job running time and try to address the steps that are particularly slow. I believe the Sauce Labs job is particularly notorious for being slow when tests start timing out.

.travis.yml Show resolved Hide resolved
.travis.yml Outdated Show resolved Hide resolved
.travis.yml Show resolved Hide resolved
.travis.yml Outdated Show resolved Hide resolved
Copy link
Collaborator

@estherkim estherkim left a comment

Choose a reason for hiding this comment

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

Pretty cool!! I added non-blocking comments.

One thing that could be blocking, though, is if the bundle size bot can't talk to the new VM (the check is pending right now). Not sure how to switch to Xenial and update BSB at the same time.

Also can you related this PR to this issue? #20887

.travis.yml Show resolved Hide resolved
.travis.yml Show resolved Hide resolved
.travis.yml Show resolved Hide resolved
@rsimha
Copy link
Contributor Author

rsimha commented Feb 28, 2019

Bundle-size bot is okay. I believe this problem stemmed from the fact that I un-pushed the last commit to this PR. I've re-run the job and will merge after it goes green.

@rsimha rsimha merged commit e5952fa into ampproject:master Feb 28, 2019
@rsimha rsimha deleted the 2019-02-21-Xenial branch February 28, 2019 21:56
noranazmy pushed a commit to noranazmy/amphtml that referenced this pull request Mar 22, 2019
bramanudom pushed a commit to bramanudom/amphtml that referenced this pull request Mar 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants