Conversation
…Docker objects, add version and tag commands to the script for interacting with Compose
… to the script for interacting with Compose
|
Alternate idea: You should be able to see in GitHub when the Docker files were last updated for your project – would combining that information with the "created" date of the container be sufficient to understand whether a given researcher is running the latest version of the container? |
Whoops, meant to tag @BeniamG there! |
Scope
Explore tagging images and containers in a versioned manner so that it is easier to detect what "version" of the container someone is running going forward in response to #7.
Implementation
Working with image tags makes working with
docker composeslightly more complicated. This PR addsenvironment/docker-environment-common.shto help abstract that complication away. Now, instead of lengthy and complicateddocker compose -f ...commands, you can use:environment/docker-environment-common.sh buildenvironment/docker-environment-common.sh upenvironment/docker-environment-common.sh startenvironment/docker-environment-common.sh stopenvironment/docker-environment-common.sh logsenvironment/docker-environment-common.sh down./environment/docker-environment-common.sh version./environment/docker-environment-common.sh tagsThe Docker image tag takes the form
datascience-notebook:${hash of the current commit in Git}. This is specified byimage: datascience-notebook:$TAGincompose.yml;$TAGis set by thebuildcommand inenvironment/docker-environment-common.shand saved inenvironment/image-tags.You can see your container's version with
./environment/docker-environment-common.sh version, provided Docker is running and the container is built and running.If the
org.opencontainers.image.versionvalue for your container matches that of a fellow researcher, you should be working from the same version of the Docker code.Things to note
The tag refers to the latest commit. That's mostly good. When it might go weird is if work is done on a branch over time (leading to commits) and someone needs to rebuild the containers or set up on a new machine, they'll have a different image tag even if the environment hasn't actually changed...
If that behavior does not work, lead researchers can elect to either
1. Hard code a value forThis probably won't work because $TAG won't be set in${TAG}inenvironment/compose.ymlenvironment/docker-environment-common.sh...2. Possibly (untested) – change the
retrieve_tag()function inenvironment/docker-environment-common.shto (replacingx.x.xwith the desired tag):This will more closely control the tag values across commits – the downside to this is that researchers will have to remember to manually change the tag value when the environment is changed.
TODO: add description of how implemented....
Future Work
None at this time
Testing
./environment/docker-environment-common.sh buildand./environment/docker-environment-common.sh upTo be completed by the person testing
Special considerations for making this live
environment/README.mdnow.