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
Docker image for optimade
on ghcr.io
#1171
Conversation
This job runs on every push to `master` and builds and tags the `Dockerfile` with `latest` and the current version of the `optimade` package.
Update Dockerfile significantly, making it more "production ready". Extend the `.docker/run.sh` file to have more relevant options. Update CI job to use `docker` instead of `docker compose`.
Codecov Report
@@ Coverage Diff @@
## master #1171 +/- ##
=======================================
Coverage 92.42% 92.42%
=======================================
Files 68 68
Lines 3909 3909
=======================================
Hits 3613 3613
Misses 296 296
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Can't immediately check, but the only thing that comes to mind are the limits on the number of packages we can have (i.e. whether we can keep the builds per version). We could consider getting this organisation upgraded to an academic one (equivalent to GitHub pro) to increase the limits. |
Indeed - if we want this to be truly useful there are some costs associated. But mainly I would use this in CI/CD in the context of GH Actions, where all data transfers are free. If at some point a limit is reached, one may always be able to clone the package and build anew at least. |
This is to add the version as a label to the image.
Are such bleeding edge images necessary, do you think? I wouldn't be against
Can't we switch the build for released versions to trigger on release only? |
I'd like these
This would make it more true to the version matching up with the code that can be retrieved from the releases on PyPI as well - so not against this. |
Fair enough, a personal use case is the best argument :)
I would strongly prefer this; I guess this can be achieved by separating the image build workflow into its own file that is triggered by both releases/master pushes and some detection of which one was the trigger? |
I'll just create 2 separate jobs I think - hmm, I'll think about it. We're already doing something similar concerning the documentation release. |
A re-usable workflow will be used to build and publish the container image. It will be called from the release workflow as well as the workflow that's running when an update to 'master' takes place.
As a comment - the many commits above (from db9eda0 to fd90ff4) show in the CI/CD that calling the re-usable workflow for publishing the container image seems to work as intended. The only thing missing now is some documentation, essentially. |
Add `typing.Optional` to type annotations in an attempt to fix docs building locally.
Note, after this PR has been merged, a new container image should be built and published with only the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great @CasperWA - few comments below about the docs.
I am a bit late to the party, but I am wondering whether it would not be more logical to name the release that corresponds to the current master |
Co-authored-by: Johan Bergsma <29785380+JPBergsma@users.noreply.github.com> Co-authored-by: Matthew Evans <7916000+ml-evs@users.noreply.github.com>
Create new top-level subjects "Deployment" and "Concepts". Move most of the new container information under the "Deployment" section.
I have updated the ToC for the documentation, moving stuff around and creating a couple more top-level subjects: "Deployment" and "Concepts". I have furthermore updated the |
Good point! I can quickly change this, having the releases update the |
Add a sentence concerning the `develop` tag in the installation documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me now @CasperWA, thanks. I was going to suggest breaking up the "getting started" guides a bit at some point anyway, so this is perfect.
Merge as you wish!
This all right for you as well @JPBergsma? |
Looking through the files, I did not see anything strange other than what I have already mentioned. |
Hmm - I'd rather just merge and then have a separate issue for docs updates - if necessary :) |
Closes #1111
Remove
docker-compose.yml
, which wasn't necessary, in favor of updating theDockerfile
, making it more "production ready" and fixing up the associated entrypoint bash script in.docker/run.sh
.The main point of this PR is to add the CD job of building and publishing the
Dockerfile
as a container image on the GitHub Container Registry (ghcr.io).This will be done in the following way: Every time a push to
master
happens, the job will run. Building an image and tagging it asoptimade
with the versionslatest
as well as the currentoptimade
package version (0.17.0
as of writing this).This image will be available for everyone under the full name:
ghcr.io/materials-consortia/optimade
.Due to the nature of tagging a newly built image with the version, a natural succession will happen with tagged images. The
latest
tag will always point be built from the head commit ofmaster
, while the versioned tags will correspond to the latest commit to bear the specific version. E.g., for the previous version (0.16.12
this would be 03ef91b, i.e., the commit immediately prior to the0.17.0
release commit).Still to do:
Dockerfile
.Updated tasks: