GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Speed up Travis build times · Issue #290 · googleapis/google-cloud-python

Speed up Travis build times #290

New issue
Copy link
New issue
Copy link
Closed
#308
Closed
Speed up Travis build times#290
#308
Copy link
Assignees
dhermes
Labels
🚨This issue needs some love.testingtriage meI really want to be triaged.

Description

@dhermes
dhermes
opened on Oct 23, 2014
Issue body actions

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

Activity

Next
  1. dhermes
    self-assigned this
    on Oct 23, 2014
  2. dhermes
    added
    testing
    on Oct 23, 2014
  3. tseaver commented on Oct 23, 2014

    @tseaver
    tseaver
    on Oct 23, 2014
    Contributor
    More actions

    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.

  4. dhermes commented on Oct 23, 2014

    @dhermes
    dhermes
    on Oct 23, 2014
    ContributorAuthor
    More actions

    @tseaver The tox installs take the most time (about a minute each, times six).

    From there, run_pylint is 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/

    Travis runs it's tasks based on the build matrix of environment variables
    and language versions, allowing us to run each testenv asynchronously
    and reporting the results for each version separately.
    Using TOXENV potentially looks promising.

  5. tseaver commented on Oct 23, 2014

    @tseaver
    tseaver
    on Oct 23, 2014
    Contributor
    More actions

    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".

  6. dhermes commented on Oct 23, 2014

    @dhermes
    dhermes
    on Oct 23, 2014
    ContributorAuthor
    More actions

    Interesting. This is compiling the crypto parts?

    I stored some times in https://gist.github.com/dhermes/5088b5520bba841a3d0e and setup.py install takes up the bulk.

  7. tseaver commented on Oct 23, 2014

    @tseaver
    tseaver
    on Oct 23, 2014
    Contributor
    More actions

    Crypto and CFFI:

    $ find .tox/py27/ -name "*.so"
    .tox/py27/lib/python2.7/site-packages/cryptography/_Cryptography_cffi_36a40ff0x2bad1bae.so
    .tox/py27/lib/python2.7/site-packages/cryptography/_Cryptography_cffi_8f86901cxc1767c5a.so
    .tox/py27/lib/python2.7/site-packages/cryptography/_Cryptography_cffi_fc665d23x4f158fee.so
    .tox/py27/lib/python2.7/site-packages/Crypto/Cipher/_DES.so
    .tox/py27/lib/python2.7/site-packages/Crypto/Cipher/_AES.so
    .tox/py27/lib/python2.7/site-packages/Crypto/Cipher/_ARC2.so
    .tox/py27/lib/python2.7/site-packages/Crypto/Cipher/_DES3.so
    .tox/py27/lib/python2.7/site-packages/Crypto/Cipher/_XOR.so
    .tox/py27/lib/python2.7/site-packages/Crypto/Cipher/_CAST.so
    .tox/py27/lib/python2.7/site-packages/Crypto/Cipher/_ARC4.so
    .tox/py27/lib/python2.7/site-packages/Crypto/Cipher/_Blowfish.so
    .tox/py27/lib/python2.7/site-packages/Crypto/Util/strxor.so
    .tox/py27/lib/python2.7/site-packages/Crypto/Util/_counter.so
    .tox/py27/lib/python2.7/site-packages/Crypto/Hash/_SHA512.so
    .tox/py27/lib/python2.7/site-packages/Crypto/Hash/_MD4.so
    .tox/py27/lib/python2.7/site-packages/Crypto/Hash/_RIPEMD160.so
    .tox/py27/lib/python2.7/site-packages/Crypto/Hash/_SHA384.so
    .tox/py27/lib/python2.7/site-packages/Crypto/Hash/_SHA256.so
    .tox/py27/lib/python2.7/site-packages/Crypto/Hash/_SHA224.so
    .tox/py27/lib/python2.7/site-packages/Crypto/Hash/_MD2.so
    .tox/py27/lib/python2.7/site-packages/_cffi_backend.so
    
  8. dhermes commented on Oct 24, 2014

    @dhermes
    dhermes
    on Oct 24, 2014
    ContributorAuthor
    More actions

    "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.

  9. dhermes commented on Oct 24, 2014

    @dhermes
    dhermes
    on Oct 24, 2014
    ContributorAuthor
    More actions

    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.6 testing and running in parallel with reduced install times via custom wheels may be the way to go.)

  10. dhermes commented on Oct 24, 2014

    @dhermes
    dhermes
    on Oct 24, 2014
    ContributorAuthor
    More actions

    Using 100% pre-built wheels the whole install (our library and test deps) takes 10.92s. Running a secondary pip install --upgrade on 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:

    • Build wheels on Travis, store in separate repo. These are static and only need to be updated on the order of once a week (but likely less).
    • Use our pre-built wheels to pip install --no-index --find-links=LOCAL_WHEELS
    • Run pip install --upgrade to make sure we are up-to-date (or get the new version). Since updating wheels is disjoint from the gcloud-python builds.

    We can incorporate this strategy into tox and still use the parallel builds or ditch tox and manage dependencies ourselves (seems scary).

  11. tseaver commented on Oct 27, 2014

    @tseaver
    tseaver
    on Oct 27, 2014
    Contributor
    More actions

    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':

    $ cd /path/to/indexrepo
    $ git pull
    $ python make_index.py
    $ git add gcloud/production
    $ git commit -m "Add foo 1.2.3."
    
  12. dhermes commented on Oct 27, 2014

    @dhermes
    dhermes
    on Oct 27, 2014
    ContributorAuthor
    More actions

    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).

  13. silvolu commented on Oct 27, 2014

    @silvolu
    silvolu
    on Oct 27, 2014
    Contributor
    More actions

    +1 for no manual intervention.

  14. dhermes commented on Oct 28, 2014

    @dhermes
    dhermes
    on Oct 28, 2014
    ContributorAuthor
    More actions

    @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 tox build process we were able to get with the wheelhouse solution.

  15. silvolu
    closed this as completedin #308on Oct 28, 2014
  16. 41 remaining items

  17. parthea
    added 10 commits that reference this issue on Nov 22, 2025

    test: add tests for instanceadmin sample (#290)

    890a743

    fix: add mypy checking + 'py.typed' file (#290)

    d29ca87

    fix: unnest failed in some cases (with table references failed when t…

    bccd897

    chore(python): use black==22.3.0 (#290)

    8dacf14

    chore(deps): update all dependencies (#290)

    28e0c04

    chore(deps): update dependency google-cloud-documentai to v2.24.2 (#290)

    e37b2b0

    tests: add system test to verify ArrayUnion upserts (#290)

    449bd03

    fix: remove noisy logs (#290)

    24db3b0

    fix compressed and repeated properties (#290)

    891e94d

    fix: remove noisy logs (#290)

    ad83a57
  18. parthea
    added a commit that references this issue on Mar 2, 2026

    feat: add support for signed resumable upload URLs (#290)

    67491e6
  19. parthea
    added 4 commits that reference this issue on Mar 9, 2026

    fix: alembic incompatibility with sqlalchemy < 1.3.11 (#290)

    27a2221

    fix: from_string method of blob and bucket class (#290)

    aabaf18

    fix(db_api): ensure DDL statements are being executed (#290)

    e513ed5

    chore: release 3.3.0 (#263)

    8d2417b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dhermes
    dhermes

Labels

🚨This issue needs some love.testingtriage meI really want to be triaged.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.