Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a
Dockerfile
for DAMNIT and a CI workflow to build a container and push it to GHCR. Intended usecase is adding a new desktop shortcut to the Visa VMs which will start up DAMNIT via singularity.A follow up PR could (should?) bundle a small example DB with the image which can be selected from the GUI at startup so that we can say "Click the DAMNIT button/copy-paste this docker or singularity command to see a demo of the GUI", since without that it's just the DAMNIT GUI with an empty table and nothing to see.
To try and keep the size of the container as small as possible it's a multi-stage Dockerfile where the
build
stage sets up the build environment and a venv in/app
with the required python dependencies, then the final unnamed stage copies over the/app
directory, installs runtime requirements, then installs DAMNIT into the venv.The resulting image is still relatively huge (~1GB) but a bit smaller than it would otherwise be with build tools/layers included.
Options if size is an issue
Starting the GUI from the container can be done with:
As for the actual tags, the workflow will build the image and push it to the container registry with different tags based on the workflow trigger:
damnit:{x.y.z}
,damnit:latest
- 'latest' and version no.damnit:pr-{N}
- pull request numberdamnit:edge
- 'edge' for most recent commit to masterWhich covers the main use cases I think we'd have: using a tagged release, a current PR, and using current head.
Tested this with some local PRs to a fork of the repo here: RobertRosca#3
ghcr.io/robertrosca/damnit:pr-3
, created from the PR branchghcr.io/robertrosca/damnit:edge
, created from master branchghcr.io/robertrosca/damnit:0.1.0
andlatest
, created from master branchFew additional comments:
I can modify the CD/tag generation a bit so that you can get per-branch tags, which would let you run
damnit:mid_4656
to start up a specific branch. Seems like this would fit the feature-branch development style better than the current approach.But the problem with this is that any push to any branch would trigger the build, and branch names may not be unique. So if you merge a branch and create a new one w/ the same name then the image would be modified
I would rather leave it as is, then if you want a feature-branch image build you can make a PR and it'll tag the image with the pr number.
Image build happens in parallel to tests. Could be set to only trigger after tests pass, but it's not a big deal.
There was some other kinda important point that I forgot... will leave this here in case I remember