Skip to content

Travis CI: Stages, OS update, apt-get relief! #9844

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 12, 2019

Conversation

cmonr
Copy link
Contributor

@cmonr cmonr commented Feb 26, 2019

Description

A rather large refactor of Travis CI.

Changes:

  • Addition of build stages.
    • Adds some much needed job organization
    • Runs jobs in batches, allowing for better parallelism
    • Allows for better control over job setup (ie: no need to install python modules when only running a shell command)
  • Linux OS update.
    • All jobs are now running Ubuntu Xenial.
  • Creation of bash helper functions.
    • Helper functions are located in tools/test/travis-ci/functions.sh
    • Functions can even be sourced and run locally (with caveats)
    • Cleans up Travis CI config (a bit)
  • Misc changes
    • No more apt-get update! 🎉
    • Enabled more caching
    • Some packages are now being sourced from S3
    • Easily updatable GCC archive when the time is right
    • Cleaned up some of the larger jobs

PR will be squashed and cleaned up tomorrow, along with the addition of Release Notes.

Pull request type

[ ] Fix
[x] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

Release Notes

Travis CI's testing config has been updated with some readability and performance improvements in mind.

Build Stages

Build stages have been added, which helps group similar jobs according to function.

Build stages also enocourage greater build parallelism by limiting the number of concurrent build jobs that a single PR can have, allowing multiple PRs to be tested in parallel instead of wauting in a build queue.

Finally, batching jobs into build stages allows for better job configuration. Some jobs that shouldn't have taken long were doing unneccesary actions such as downloading packages or installing python modules, which has now been corrected.

Python 3.7 by default

Jobs that require Python to run now use Py37 by default.

Ubutnu Xenial

The Linux VM that runs tests has been updated to use Xenail, Travis CI's latest supported Linux OS.

Minimal apt-get usage

Usage of apt-get has been greatly minimized by moving packages over to S3 and using dpkg to install cached packages when needed.

A major pain point would occur when a job would fail because the VM failed to run apt-get update successfully.

Bash functions

Common functions such as downloading packages or updating a job's status have now been collected into a single bash function. No strage shell invocations need to be done in order to use them which was not the case before.

@cmonr
Copy link
Contributor Author

cmonr commented Feb 26, 2019

@AnotherButler Feel free to take a look at the docs jobs and lmk what you think.

A PR to https://github.com/ARMmbed/mbed-os-5-docs will come tomorrow as well.

@cmonr cmonr changed the title Travis CI: Stages, OS update, apt-get relief Travis CI: Stages, OS update, apt-get relief! Feb 26, 2019
@cmonr
Copy link
Contributor Author

cmonr commented Feb 26, 2019

A note: My local fork didn't like running 'coveralls' with Py37. Time debugging that failure was next to nothing. Can take another look at it tomorrow.

@cmonr cmonr requested a review from SenRamakri February 26, 2019 07:08
@cmonr cmonr force-pushed the travisCI-refactor branch 2 times, most recently from 9e1fdeb to 175827e Compare February 28, 2019 01:55
@0xc0170
Copy link
Contributor

0xc0170 commented Feb 28, 2019

@cmonr I am moving this to 5.12.1 - this is test config that could land later than 5.12.0 ? As we have high number of PR for 5.12 and t his is not even reviewed.

Or at least landing on master, and each patch release will use old travis config - not ideal.

@cmonr
Copy link
Contributor Author

cmonr commented Feb 28, 2019

is this test config that could land later than 5.12.0?

It can, but was hoping to have it in sooner, since this fixes a fair amount of headaches with apt-get, and better supports testing multiple PRs at once.

@cmonr cmonr removed the risk: A label Feb 28, 2019
@cmonr
Copy link
Contributor Author

cmonr commented Mar 1, 2019

@0xc0170 I just remembered that a large reason I was trying to get this in for 5.12 was that it was possible that the test names were going to be updated.

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 1, 2019

Usage of apt-get has been greatly minimized by moving packages over to S3 and using dpkg to install cached packages when needed.

What is the lifetime? Previously we had some issue with limited lifetime, solved now?

0xc0170
0xc0170 previously requested changes Mar 1, 2019
Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

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

LGTM otherwise

@@ -0,0 +1,139 @@
#!/bin/bash -euf
Copy link
Contributor

Choose a reason for hiding this comment

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

license header file here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added

@cmonr
Copy link
Contributor Author

cmonr commented Mar 7, 2019

What is the lifetime? Previously we had some issue with limited lifetime, solved now?

@0xc0170 What do you mean by lifetime?

@cmonr cmonr force-pushed the travisCI-refactor branch from b2b1fd5 to 231236c Compare March 7, 2019 18:10
@0xc0170
Copy link
Contributor

0xc0170 commented Mar 8, 2019

@0xc0170 What do you mean by lifetime?

We had previously a problem aws stored only for 3 months or so. if this is not a problem anymore

Cruz Monrreal II added 6 commits April 8, 2019 10:45
Added external bash file to source functions from
Primary cause of false Travis CI failures was running 'apt-get update'.
Refactored all instances where this was needed with manually fetching and installing dependencies in S3 instace.

This also includes GCC installation.
Added {} around each variable.
Ported python invocations for simple math opts to coreutil commands
Added comments to functions
@0xc0170
Copy link
Contributor

0xc0170 commented Apr 11, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Apr 11, 2019

Test run: FAILED

Summary: 1 of 11 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_exporter

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 11, 2019

Exporters failed with some symlink errors, will restart once travis is fixed

@OPpuolitaival
Copy link
Contributor

symlink error comes from untar. Sounds like corrupted package. Probably need to run whole pipeline again

@cmonr cmonr force-pushed the travisCI-refactor branch from f987632 to c79bb7e Compare April 11, 2019 15:46
'tr' command wasn't doing any replacement
@cmonr cmonr force-pushed the travisCI-refactor branch from c79bb7e to 2a2ec16 Compare April 11, 2019 15:50
@cmonr
Copy link
Contributor Author

cmonr commented Apr 12, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Apr 12, 2019

Test run: FAILED

Summary: 1 of 11 test jobs failed
Build number : 2
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_exporter

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 12, 2019

Exporters restarted

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 12, 2019

Internal CI symlink error again, aborting the current one and should be fixed in the next one

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 12, 2019

Green 🎉 @cmonr in?

@cmonr cmonr merged commit f1c4a02 into ARMmbed:master Apr 12, 2019
@cmonr cmonr removed the needs: CI label Apr 12, 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.

6 participants