Building a Docker Image¶
The following instructions apply to the creation of a new compiler image.
Create New Docker File¶
Note
If a Dockerfile for the desired compiler already exists, you can skip this section and go to update-docker-image-label .
Start by cloning the
seracrepository and creating a branch offdevelop.Ensure that an image exists on Dockerhub for the desired compiler. If no corresponding compiler image exists, it should be created before proceeding. Here is the RADIUSS Docker repository images.
Go to the
scripts/dockerdirectory and runbuild_new_dockerfile.sh, passing the compiler name and full version, e.g. for Clang 14, run./build_new_dockerfile.sh clang 14.0.0. This will create a Dockerfile whose name corresponds to a specific compiler and major version, e.g.,dockerfile_clang-14. This may require modifications depending on the compiler and base image - for example, an extra system package might be installed so Spack doesn't need to build it from source.Edit
./github/workflows/docker_build_tpls.ymlto add new job for the new compiler image. This can be copy-pasted from one of the existing jobs - the only things that must be changed are the job name andTAG, which should match the name of the compiler/generatedDockerfile. For example, a build fordockerfile_clang-14must setTAGtoclang-14. For clarity, thenamefield for the job should also be updated.Commit and push the added YAML file and new Dockerfile.
Update/Add Docker Image¶
Go to the Actions tab on GitHub, select the "Docker TPL Build" action, and run the workflow on the branch to which the above changes were pushed.
Once the "Docker TPL Build" action completes, it will produce artifacts for each of the generated host-configs. Download these artifacts and rename them to just the compiler spec. For example,
buildkitsandbox-linux-clang@14.0.0.cmaketoclang@14.0.0.cmakeand commit them to your branch underhost-configs/docker. You will also have to update.github/workflows/build-and-test.ymlif you added or change the existing compiler specs. These are all in variables calledhost_config.Copy the new docker image names from each job under the
Get dockerhub repo namestep. For example,seracllnl/tpls:clang-14_06-02-22_04h-11m. This will replace the previous image name at the top of.github/workflows/build-and-test.ymlunder thematrixsection or add a new entry if you are adding a new docker image.To include the new image in CI jobs, add/update the
matrixentry to.github/workflows/build-and-test.yml, modifying its attributes with the appropriate new image name (which is timestamped) and new host-config file.