PyBaMM
PyBaMM copied to clipboard
Build & Push Docker Images on releases
Description
Push Docker images on releases, starting from either 23.9 or 24.1 before the 24.1rc0 release
Type of change
Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Optimization (back-end change that speeds up the code)
- [ ] Bug fix (non-breaking change which fixes an issue)
Key checklist:
- [ ] No style issues:
$ pre-commit run(or$ nox -s pre-commit) (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code) - [ ] All tests pass:
$ python run-tests.py --all(or$ nox -s tests) - [ ] The documentation builds:
$ python run-tests.py --doctest(or$ nox -s doctests)
You can run integration tests, unit tests, and doctests together at once, using $ python run-tests.py --quick (or $ nox -s quick).
Further checks:
- [ ] Code is commented, particularly in hard-to-understand areas
- [ ] Tests added that prove fix is effective or that feature works
Related to #3312 cc: @agriyakhetarpal
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
8dc0421) 99.59% compared to head (bc0fa0b) 99.59%. Report is 2 commits behind head on develop.
Additional details and impacted files
@@ Coverage Diff @@
## develop #3661 +/- ##
========================================
Coverage 99.59% 99.59%
========================================
Files 258 258
Lines 20797 20797
========================================
Hits 20712 20712
Misses 85 85
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Question: what will happen if the git tag is manually adjusted through a force push, a few commits ahead or behind in the tree? Will that trigger a push?
We won't need to do that usually, but maybe a way out of that situation would be to be able to set the image tags from inputs to the workflow (we already support the workflow_dispatch: event) and overwrite the release image – this would tie in with reducing the amount of images we push. But then we currently clone the repository inside the Dockerfile, which would always fetch the latest changes from develop... perhaps @Saransh-cpp can confirm the most recent instance of having to adjust the GitHub tag, was it for 23.9rc0?
Edit: if we don't push Docker images on pre-releases and ensure that the non-pre-release tag is never modified then this shouldn't be a problem 🙂 (i.e., use types: [released] instead of [published])