Skip to content

Cache on Travis

Quentin Madec edited this page Mar 27, 2015 · 1 revision

In order to speed up builds on Travis, we use two different caches.

Travis cache for python lib

By default, Travis cache are shared by python version (might be improved in the future, see https://github.com/travis-ci/travis-ci/issues/3023), which is perfect for lib caching !

How does it work

It's using the default Travis cache, configured like this: (see https://github.com/DataDog/dd-agent/blob/master/.travis.yml#L8-L12)

cache:
  directories:
    - $HOME/virtualenv/python2.6.9/lib/python2.6/site-packages
    - $HOME/virtualenv/python2.7.9/lib/python2.7/site-packages

Only using pip cache is useless because pip spends a lot more time compiling python package than downloading them.

What could break it ?

  • Change of python version

How can I clear it ?

http://docs.travis-ci.com/user/caching/#Clearing-Caches

Datadog S3 cache for external dependencies (MySQL, PostgreSQL, ...)

Fork of Travis cache, using casher. Source is here: https://github.com/DataDog/dd-agent/blob/master/ci/resources/cache.rb and https://github.com/DataDog/dd-agent/blob/master/ci/resources/cache/aws4_signature.rb

It caches the $HOME/embedded directory, which should contain any external program used to test the agent.

What could break it ?

  • Change of AWS authentification (but Travis would also have to change, so update the aws4_signature.rb with theirs)

How can I clear it ?

You need to be part of the Datadog Team and have access to dd-agent-travis-cache bucket.

Travis cache just changed its S3 cache implementation, how can we upgrade ?

We use a fork of casher (https://github.com/DataDog/casher) in order to avoid collision with Travis cache (check the only change on the production branch). Update it with the latest change from Travis.

Updating https://github.com/DataDog/dd-agent/blob/master/ci/resources/cache.rb and https://github.com/DataDog/dd-agent/blob/master/ci/resources/cache/aws4_signature.rb will probably be needed.

Clone this wiki locally