This repository orchestrates Travis CI and Quay to build Docker images for vg automatically and transparently.
Above, a specific revision of vg is recorded as a git submodule. Updating this repository - particularly the vg submodule revision - causes the generation of a pair of Docker images in Quay:
In this example pair, each image is built from vg git revision 37f68b6e
. (v1.4.0
is the newest git tag on the lineage leading to that revision, and this lineage has 2,425 commits following that tag.)
- The
-run
image contains the static vg executable and some additional scripts and tools, suitable for low-overhead runtime deployment. - The far larger
-build
image contains the fully compiled source tree of vg, in which the aforementioned executable was built from scratch, thereafter useful to fiddle with the build or test suite.
Click through to quay.io/vgteam/vg to find the most recently built images.
Example pulling and using the -run
image:
$ sudo docker run -it -v $(pwd):/io quay.io/vgteam/vg:v1.4.0-2425-g37f68b6e-run vg version
Unable to find image 'quay.io/vgteam/vg:v1.4.0-2425-g37f68b6e-run' locally
v1.4.0-2425-g37f68b6e-run: Pulling from vgteam/vg
64c2d346debd: Pull complete
Digest: sha256:7b4ea8f409132e75a82fc7b22370130624547f944c55d3c14e6bc61d9b2ce92e
Status: Downloaded newer image for quay.io/vgteam/vg:v1.4.0-2425-g37f68b6e-run
v1.4.0-2425-g37f68b6
$
Using the -build
image to run the full test suite:
$ sudo docker run -it quay.io/vgteam/vg:v1.4.0-2425-g37f68b6e-build make test
The vg source tree, and all its submodules, are built from scratch on each update here, according to the recipe in Dockerfile.build. This is complementary to the vg repository's own Travis CI, which takes advantage of Travis caching to speed up builds and provide rapid feedback, but occasionally hides festering statefulness/dependency problems (that's bitten us a few times).
Clone this repository locally, then update the vg submodule revision and push back to GitHub:
git clone https://github.com/vgteam/vg_docker.git
cd vg_docker
git submodule update --init
git -C vg fetch origin
git -C vg checkout DESIRED_VG_REVISION
git add vg
git commit -m 'vg DESIRED_VG_REVISION'
git push origin
If you'll be iterating rapidly, then as a courtesy you could do this on your own branch of vg_docker instead of master.
Once you push the update, monitor the image build progress on Travis CI, then hopefully find the new images in quay.io/vgteam/vg after 30-40 minutes.
When you push an update to this repository,
- Travis CI notices and, according to
.travis.yml
above, runsbuild.sh
which: - uses
docker build
to bake and test the images (on the Travis CI worker) - logs in to Quay using an authentication token for the
vgteam+travis
robot account, stored using a Travis secure environment variable. - pushes the images to Quay.
Compared to the simpler automatic build features of Quay and Docker Hub, this provides us more control over how the images are prepared, tested, and tagged.
Release images are also mirrored to Docker Hub variantgraphs/vg, using the dedicated vgdockerci
Docker Hub account with the password also in a Travis secure environment variable.