Speed up Travis build times #290
Copy link
Copy link
Closed
Labels
🚨This issue needs some love.This issue needs some love.testingtriage meI really want to be triaged.I really want to be triaged.
Description
I'm working on a strategy to use tox more selectively with Travis to speed up builds.
tox is great for local dev where the tox environ gets set up once and is re-used but setting up 6 environments (not including logs and dist) is a large cost.
$ ls .tox/
cover/ dist/ docs/ lint/ log/ py26/ py27/ regression/
$ ls .tox/log/
tox-0.log
$ ls .tox/dist/
gcloud-0.02.2.zip
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
🚨This issue needs some love.This issue needs some love.testingtriage meI really want to be triaged.I really want to be triaged.
Activity
tseaver commentedon Oct 23, 2014
Hmm, the pylint bit is definitely the most time-consuming part, once we actually get scheduled on a CPU. Once we are running regression tests, they will likely run longer, too.
dhermes commentedon Oct 23, 2014
@tseaver The
toxinstalls take the most time (about a minute each, times six).From there,
run_pylintis the longest running script.I'm focusing (for now) on reducing the install time.
Also,
From http://jsatt.com/blog/using-tox-with-travis-ci-to-test-django-apps/
tseaver commentedon Oct 23, 2014
Note that the compiling C in the upstream dependencies injects the majority of the time: if they were distributed as wheels (compatible with our platform, of course) then we could nuke most of that. I guess we could build the wheels ourselves and push them to GH pages (or somewhere) as a "private index".
dhermes commentedon Oct 23, 2014
Interesting. This is compiling the crypto parts?
I stored some times in https://gist.github.com/dhermes/5088b5520bba841a3d0e and
setup.py installtakes up the bulk.tseaver commentedon Oct 23, 2014
Crypto and CFFI:
dhermes commentedon Oct 24, 2014
"Confirmed" Travis can do builds in parallel:
http://www.dominicrodger.com/tox-and-travis.html
http://docs.travis-ci.com/user/speeding-up-the-build/
Looking into compiling the C stuff.
dhermes commentedon Oct 24, 2014
I found a project which creates wheel files on Travis and then commit them to a separate branch. I adapated this project to our needs and used the generated wheels in a build.
I was able to cut BUILD times from 7:49 to 3:17 and then finally down to 2:09. (NOTE: This simplication dumps off
python2.6testing and running in parallel with reduced install times via custom wheels may be the way to go.)dhermes commentedon Oct 24, 2014
Using 100% pre-built wheels the whole install (our library and test deps) takes 10.92s. Running a secondary
pip install --upgradeon all the dependencies (to make sure the pre-built wheels are not out-of-date) takes an additional 5.90s. (Also it takes 2.26s to clone the repo holding our pre-built wheels.)See:
https://gist.github.com/dhermes/b618c1dcbe0d811865eb
https://travis-ci.org/dhermes/gcloud-python/builds/38970047
@tseaver WDYT of this strategy? To clarify, the strategy is:
pip install --no-index --find-links=LOCAL_WHEELSpip install --upgradeto make sure we are up-to-date (or get the new version). Since updating wheels is disjoint from thegcloud-pythonbuilds.We can incorporate this strategy into
toxand still use the parallel builds or ditchtoxand manage dependencies ourselves (seems scary).tseaver commentedon Oct 27, 2014
I don't honestly think using Travis to build the wheels is much of a win (as opposed to doing it manually when we notice that a new version is out, and decide to adopt it).
We could choose to build a private index from the set of wheels after building them. See https://gist.github.com/tseaver/dc75c100b70323803bc3 for an example (it predates wheels, and so would need to be updated to scan them).
To re-create the index pages after adding a distribution / wheel (e.g., 'foo-1.2.3.tar.gz') into 'gcloud/production':
dhermes commentedon Oct 27, 2014
I am under the impression that using Travis to build the wheels is needed due to potential platform dependencies.
Also, with the setup I describe in
GoogleCloudPlatform/gcloud-python-wheels#1
it will allow new wheels to be built without any manual intervention on our part (which is a positive).
silvolu commentedon Oct 27, 2014
+1 for no manual intervention.
dhermes commentedon Oct 28, 2014
@tseaver #308 should wrap this up. Sorry to have ignored the custom index you showed in the gist. It certainly looked useful, but I had already gotten this method working. FWIW I was pleasantly surprised at how close to the default
toxbuild process we were able to get with thewheelhousesolution.41 remaining items
test: add tests for instanceadmin sample (#290)
fix: add mypy checking + 'py.typed' file (#290)
fix: unnest failed in some cases (with table references failed when t…
chore(python): use black==22.3.0 (#290)
chore(deps): update all dependencies (#290)
chore(deps): update dependency google-cloud-documentai to v2.24.2 (#290)
tests: add system test to verify ArrayUnion upserts (#290)
fix: remove noisy logs (#290)
fix compressed and repeated properties (#290)
fix: remove noisy logs (#290)
feat: add support for signed resumable upload URLs (#290)
fix: alembic incompatibility with sqlalchemy < 1.3.11 (#290)
fix: from_string method of blob and bucket class (#290)
fix(db_api): ensure DDL statements are being executed (#290)
chore: release 3.3.0 (#263)