-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Travis CI Integration with Docker Build Image #20
Travis CI Integration with Docker Build Image #20
Conversation
…lopment image Target Issue: GenericMappingTools#13
💖 Thanks for opening this pull request! 💖 A few things to keep in mind:
|
Hi @akshmakov thanks for putting this together! From what I understand, Travis will create a new docker container every time that runs the tests. Is that right? What I had in mind was having a container that had the dependencies and coastlines/borders. Then we could pull it and run our tests inside it. This way, we avoid running Is this possible to do? |
By the way, kudos on writing up a whole documentation file for this! Awesome 🥇 |
@leouieda Indeed, in the current configuration it will download packages every time when built on a clean system. Travis CI does not persist the environment between builds so the docker cache is lost every build. On other build systems or your local machine the cache can be preserved between builds. On the other hand even without the cache the base images are much more stable than Travis CI build environment, so while you waste time and bandwidth, at least the image is consistent and repeatable. There are some other, technical benefits that may become more obvious when/if you decide to publish docker based releases, but basically, yes, its a heavy and verbose approach. In a nutshell, the issue is that somewhere, someone, needs to build and push that build image to dockerhub (or a private registry, whatever) for it to be available globally. Now that someone can replace or change that image without you really having any control. Additionally that external image is now decoupled from your project, so if dependencies change you would need to go update something else t before you can build, it also means maintaining version maps between the build environment and the project version. This is done all the time but I wanted to make sure you understand what this would imply. For me to proceed with the pre-built image approach I would need you to weigh in on the following choices from the GMT organizations perspective. There are two basic ways to proceed
Basically its an exercise in infrastructure management. We take what I have done and break it up into separate pieces that are pre-built and fetched at build time. |
Hopefully some of that was understandable. In any case, I have updated the image to use a pre-built one instead of downloading dependencies every build. Do you think it would be useful to upload every build to docker repository (dockerhub) so that people can try whatever gmt version they want? |
Any updates on this PR? |
@akshmakov sorry for leaving this hanging for so long. I recently realised that using the image kind of defeats the purpose of the CI. It won't save time downloading the packages and data because we have to download the docker image (with these things in there) anyway. And using this on Mac defeats the purpose of testing on Mac since we'd be running things on the Linux image. That said, having the docker images for recent GMT might be useful for other users. We could add instructions for using your images on the GMT docs or in the install instructions. What do you think? |
Closed since we no longer need dockers for travis CI. |
Travis Docker integration with monolithic docker image for build pipeline
This is intentionally a very verbose and arguably "heavy" approach, there are alternatives we can persue to reduce build time and image size. The main benefit is that build steps and requirements can be updated in one place and the docker image can be used to publish to dockerhub out of the box once you are ready to do so.
Documentation was updated to give some guidance on use, build has been tested with travis ci.
Sample Build (if PR doesn't trigger build with new CI file): https://travis-ci.org/nc5ng/gmt/builds/417081935
Fixes #13