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 .

  1. Start by cloning the serac repository and creating a branch off develop.

  2. 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.

  3. Go to the scripts/docker directory and run build_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.

  4. Edit ./github/workflows/docker_build_tpls.yml to 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 and TAG, which should match the name of the compiler/generated Dockerfile. For example, a build for dockerfile_clang-14 must set TAG to clang-14. For clarity, the name field for the job should also be updated.

  5. Commit and push the added YAML file and new Dockerfile.

Update/Add Docker Image

  1. 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.

  2. 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.cmake to clang@14.0.0.cmake and commit them to your branch under host-configs/docker. You will also have to update azure-pipelines.yml if you added or change the existing compiler specs. These are all in variables called HOST_CONFIG.

  3. Copy the new docker image names from each job under the Get dockerhub repo name step. For example, seracllnl/tpls:clang-14_06-02-22_04h-11m. This will replace the previous image name at the top of azure-pipelines.yml under the matrix section or add a new entry if you are adding a new docker image.

  4. To include the new image in CI jobs, add/update the matrix entry to azure-pipelines.yml, modifying its attributes with the appropriate new image name (which is timestamped) and new host-config file.