Keep on releasin'
Continuous delivery for open source
Continuous Delivery
an approach in which teams ensure that every change to the system is releasable,
and that we can release any version at the push of a button.
Continuous Delivery aims to make releases boring, so we can deliver
frequently and get fast feedback on what users care about.
Thought Works
Continuous Delivery
Driving principles:
Make it easy for anybody to get built executables from the HEAD of a repository
Automate build
- The principles of continuous integration include "Make
it Easy for Anyone to Get the Latest Executable" and
"Automate Deployment"....
Why?
Pros
Fast user feedback
Simplified (trivial) releases
Easy development version testing
Cons
Requires build automation
Many build artifacts
- User feedback: the biggest risk to any software effort
is that you end up building something that isn't
useful. The earlier and more frequently you get working
software in front of real users, the quicker you get
feedback to find out how valuable it really is.
- Community contributions: If a user can see
that a small change has an quick/immediate impact on
documentation or feature, they will be more likely to
contribute again next time. If it takes a year to see
the benefits, why bother?
Why I care
cartopy - 2 minor releases / 15 months
Iris - 2 minor releases / 16 months
matplotlib - 2 minor releases / 21 months
- Comes from git tags found with: "git tag | xargs -i git log -1 --format="{} %ad" {} --date=short"
How can we deploy non-compiled packages automatically?
For pure python
packages, simply† :
$> cat .travis.yml
...
after_success:
python setup.py register sdist upload
† There are a few other things that need to be dealt with in configuring TravisCI.
There is configuration needed to setup authentication to
pypi - this can be done with Travis CI environment
secrets. This will be covered in Damian Avila's talk
(following this one).
Complexities of continuous delivery
There are some things we need to think about:
Versioning
Toggling major changes
Versioning
Versioneer +
PR #90
We want to be able to uniquely reference each change,
and maintain sortability (so that newer versions get
installed over older ones). Additionally, we want to
conform to PEP0440.
Although we need automatic
versioning, we still want to explicitly tag versions
which represent a complete cycle - for users who want
to opt out of CD releases, the tagged versions are the
versions that the development team recommend in this
case.
and ensure that from pip, unless explicitly
stated by the user, only tagged versions are installed.
Toggling major changes
To maintain continuity between releases, we want to toggle major changes.
from __future__ import print_function
with matplotlib.feature.extensible_toolbar:
...
There is already an example of this kind of functionality in iris.Future .
http://martinfowler.com/bliki/FeatureToggle.html
There
are two cases to think about: - incomplete
functionality - intrusive changes
Deploying compiled binary packages automatically
To build binary packages, we need access to Windows, OSX and Linux machines.
TravisCI AppVeyor CircleCI
OSX X
Linux X X†
Windows X
† CircleCI gives us the ability to build using our own docker image, allowing us to support older libc versions.
Should we adopt continuous delivery?
Not necessarily, but we should dramatically shorten our release cycles with automation.
Read:
http://martinfowler.com/articles/continuousIntegration.html
http://martinfowler.com/books/continuousDelivery.html