[gdal-dev] Docker images for development/testing?

Robert Coup robert.coup at koordinates.com
Mon Jul 16 06:51:26 PDT 2018


Hi All,

For me at least, maintaining working dev environments for GDAL can be
frustrating... there are a lot of dependencies, platforms, and a huge
number of config options. Let alone switching branches for backports/etc. I
typically use OSX as a desktop and linux environments running under that
via Docker & Virtualbox.

GDAL has really comprehensive CI, but I wonder if there's ways to improve
local dev & testing workflows? There is a Vagrant image from a while back,
but it runs Ubuntu Precise which is well EOL, so I assume it's not in
regular use.

What are other people doing? Does anyone have an elegant dev environment
they could share?

Suggestion:

1. docker images with all the build/test/library dependencies already
installed — publish them so getting the right dependencies & environment is
only a download.

2. docker-compose files with ccache and source trees mapped to the host
checkout. This should make builds & rebuilds comprehensive, and as quick as
possible (but won't be as fast as native builds). Could also be wrappers
around docker run.

I made a very rough proof of concept out of the trusty_clang travis
scripts...

https://github.com/koordinates/gdal/tree/docker-dev-poc/gdal/ci/docker

# build the base image with the dependencies
$ docker-compose -f gdal/ci/docker/docker-compose.yml build
# start the dev environment
$ docker-compose -f gdal/ci/docker/docker-compose.yml up -d

# repeat this bit as you develop
  # use the CI steps
  $ docker-compose -f gdal/ci/docker/docker-compose.yml exec /ci.sh all  #
build+test
  $ docker-compose -f gdal/ci/docker/docker-compose.yml exec /ci.sh build
  $ docker-compose -f gdal/ci/docker/docker-compose.yml exec /ci.sh test

  # or do it manually
  $ docker-compose -f gdal/ci/docker/docker-compose.yml exec bash

# tear it all down
$ docker-compose -f gdal/ci/docker/docker-compose.yml down

Thoughts? Comments?

Without other steering, I guess the next steps would be:

- do it for the best/cleanest/modern/featureful environment & compiler
rather than the venerable Trusty (which one?)
- don't run as root, make sure steps are fully repeatable, etc
- ideally a bunch of the stuff in the existing ci .sh files would be in
Makefiles or elsewhere I think?
- have a script that runs configure/etc with all the options + dependencies
that will work in the environment. (ie. extract more of install.sh)
- keep the .o files in the container instance rather than the source tree?
http://make.mad-scientist.net/papers/multi-architecture-builds/ via some
autotools voodoo?
- make it easier to extend for supporting other environments

Cheers,

Rob :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20180716/102a81e3/attachment.html>


More information about the gdal-dev mailing list