Build docker images all in one step to avoid potentially building on different incompatible architectures #368
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.
I originally set the 3 docker builds up as a matrix in order to reduce code duplication. However, that has the effect of running the three builds on 3 different github-hosted runners. The problem with this is that the runners could be provisioned on multiple different architectures (see here and here). If the
deps.Dockerfile
gets built on Haswell for example, and thedev.Dockerfile
gets built on Cascade Lake, then thedev.Dockerfile
doesn't recognize the dependencies that spack installed indeps.Dockerfile
because the architecture is part of the package hash. In order to ensure that all 3 images are built on the same architecture, I've put them sequentially in the same job.Additionally, we can't accept a tag as a workflow dispatch input because checking out an older tag would lose the changes at the HEAD of the branch we're building. For example, I want to build the
v0.4.0-beta
tag, but If I check out that tag, then the docker files are at the top level directory instead of in thedocker
folder. That means if the docker builds fail on the initial tag, we have to either do another release, or build fromHEAD
instead of the tag.