MuonColliderSoft / MuonCollider-docker

Docker files for Muon Collider software
Apache License 2.0
2 stars 2 forks source link

Automatically Build Image Using GitHub Actions #1

Closed kkrizka closed 1 year ago

kkrizka commented 3 years ago

The new GitHub Action does two things:

The advantages are automated testing and deployment of the official images used by Muon Collider Collaboration. The testing goes beyond just making sure the images build. The automatically deployed work-in-progress images from Pull Requests can be pulled by users to test specific Processors. Long term, we can also add Actions that automatically test commonly used Processors.

This PR implements the standard docker/build-push-action@v2 workflow. Some important highlight are next.

Docker Image Tag

The images are tagged as "${DOCKERHUB_REPOSITORY}/imagename:${steps.meta.outputs.version}-centos8", where the meta step is an execution of docker/metadata-action@v3. The version is either pr-# (where # is the number of the PR), tag (for tagged ref's) or master (for direct pushes to master).

One caveat is that the tag is taken directly. So the current tag format would result in an image named infnpd/mucoll-ilc-framework:v.1.5-centos8. There is support for semver formatted tags which strip the v from vX.Y.Z. Our tag format is quite close to this, so it might be possible to use.

Dockerfile Changes

The automatic repository / version information needs to be forwarded to the later stage Dockerfiles (Dockerfile-ilc-base and Dockerfile-ilc-framework). This PR replaces the hard-coded information with the following Docker arguments.

Argument Default
REPOSITORY infnpd
VERSION devel

The README instructions have been updated correspondingly.

Repository Secrets

The action expects the following variables to be defined as secrets.

Secret Description
DOCKERHUB_USERNAME Username to use during the push action.
DOCKERHUB_TOKEN API token associated with the username.
DOCKERHUB_REPOSITORY Repository where to save the image.

TODO

kkrizka commented 3 years ago

Hi @pandreetto,

I'm almost done with this. Just need to

I'm not sure why the Action isn't running in this PR. Could you please check the "Action" tab in Settings if something is disabled? There also might be an "Approve and run" button in your view above the "Merge pull request" button for you to click as I am an outside collaborator. Note that the CI would fail anyways and the secrets first need to be setup.

In the meantime, you can see the action in action in at fork and my DockerHub repository.

-- Karol Krizka