From 1e88ef427e0ebf99a8cbd21110c9508518bd8f64 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 14:47:34 -0700 Subject: [PATCH 01/22] Refresh `cudatoolkit` caching on `linux_ppc64le` --- linux-anvil-ppc64le-cuda/Dockerfile | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/linux-anvil-ppc64le-cuda/Dockerfile b/linux-anvil-ppc64le-cuda/Dockerfile index a6faf5a7..79a0f3bd 100644 --- a/linux-anvil-ppc64le-cuda/Dockerfile +++ b/linux-anvil-ppc64le-cuda/Dockerfile @@ -101,19 +101,15 @@ COPY scripts/run_commands /opt/docker/bin/run_commands RUN /opt/docker/bin/run_commands # Download and cache CUDA related packages. -RUN if [[ "$CUDA_VER" == "9.2" || "$CUDA_VER" == "10.0" || "$CUDA_VER" == "10.1" ]]; then \ - echo "`cudatoolkit` not available for CUDA_VER<10.2"; \ - else \ - source /opt/conda/etc/profile.d/conda.sh && \ - conda activate && \ - conda create -n test --yes --quiet --download-only \ - conda-forge::cudatoolkit=${CUDA_VER} \ - && \ - conda remove --yes --quiet -n test --all && \ - conda clean -tiy && \ - chgrp -R lucky /opt/conda && \ - chmod -R g=u /opt/conda; \ - fi +RUN source /opt/conda/etc/profile.d/conda.sh && \ + conda activate && \ + conda create -n test --yes --quiet --download-only \ + conda-forge::cudatoolkit=${CUDA_VER} \ + && \ + conda remove --yes --quiet -n test --all && \ + conda clean -tiy && \ + chgrp -R lucky /opt/conda && \ + chmod -R g=u /opt/conda # Add a file for users to source to activate the `conda` # environment `root`. Also add a file that wraps that for From c9c15a6b034dcf2a9230077bde5539d9edb2baec Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 14:50:55 -0700 Subject: [PATCH 02/22] Drop old CUDA bits from `ldconfig` logic --- linux-anvil-aarch64-cuda/Dockerfile | 2 +- linux-anvil-cuda/Dockerfile | 20 ++++---------------- linux-anvil-ppc64le-cuda/Dockerfile | 24 ++++++------------------ 3 files changed, 11 insertions(+), 35 deletions(-) diff --git a/linux-anvil-aarch64-cuda/Dockerfile b/linux-anvil-aarch64-cuda/Dockerfile index fed7ccbe..1ae2bb3e 100644 --- a/linux-anvil-aarch64-cuda/Dockerfile +++ b/linux-anvil-aarch64-cuda/Dockerfile @@ -24,7 +24,7 @@ ENV CUDA_HOME /usr/local/cuda # we want to persist a path in ldconfig (to avoid having to always set LD_LIBRARY_PATH), but *after* the existing entries; # since entries in ld.so.conf.d have precedence before the preconfigured directories, we first add the latter to the former -# the upstream images for 10.x all have libcuda.so under $CUDA_HOME/compat; +# the upstream images all have libcuda.so under $CUDA_HOME/compat; # add this to the ldconfig so it will be found correctly. # don't forget to update settings by running ldconfig RUN ldconfig -v 2>/dev/null | grep -v ^$'\t' | cut -f1 -d":" >> /etc/ld.so.conf.d/cuda-$CUDA_VER.conf && \ diff --git a/linux-anvil-cuda/Dockerfile b/linux-anvil-cuda/Dockerfile index 028d71c0..58e74420 100644 --- a/linux-anvil-cuda/Dockerfile +++ b/linux-anvil-cuda/Dockerfile @@ -21,23 +21,11 @@ ENV CUDA_HOME /usr/local/cuda # we want to persist a path in ldconfig (to avoid having to always set LD_LIBRARY_PATH), but *after* the existing entries; # since entries in ld.so.conf.d have precedence before the preconfigured directories, we first add the latter to the former +# The upstream images all have libcuda.so under $CUDA_HOME/compat; +# add this to the ldconfig so it will be found correctly. +# don't forget to update settings by running ldconfig RUN ldconfig -v 2>/dev/null | grep -v ^$'\t' | cut -f1 -d":" >> /etc/ld.so.conf.d/cuda-$CUDA_VER.conf \ - && if [ ${CUDA_VER} != "9.2" ]; then \ - # the upstream images for 10.x all have libcuda.so under $CUDA_HOME/compat; - # add this to the ldconfig so it will be found correctly. - echo "$CUDA_HOME/compat" >> /etc/ld.so.conf.d/cuda-$CUDA_VER.conf ; \ - else \ - # For 9.2, the image nvidia/cuda:9.2-devel-centos6 contains neither - # $CUDA_HOME/compat, nor any (non-stub) libcuda.so. We fix this by - # adding cuda-compat-10.0 (which is not used for building, but to - # test if loading the respective library/package works). However, - # due to licensing reasons, these cannot be part of the conda-forge - # docker images, but are instead added for CI purposes in: - # github.com/conda-forge/conda-forge-ci-setup-feedstock/blob/master/recipe/run_conda_forge_build_setup_linux - # Here we only set the ldconfig accordingly. - echo "/usr/local/cuda-10.0/compat" >> /etc/ld.so.conf.d/cuda-$CUDA_VER.conf ; \ - fi \ - # don't forget to update settings by running ldconfig + echo "$CUDA_HOME/compat" >> /etc/ld.so.conf.d/cuda-$CUDA_VER.conf ; \ && ldconfig # bust the docker cache so that we always rerun the installs below diff --git a/linux-anvil-ppc64le-cuda/Dockerfile b/linux-anvil-ppc64le-cuda/Dockerfile index 79a0f3bd..684592dd 100644 --- a/linux-anvil-ppc64le-cuda/Dockerfile +++ b/linux-anvil-ppc64le-cuda/Dockerfile @@ -29,24 +29,12 @@ ENV CUDA_HOME /usr/local/cuda # we want to persist a path in ldconfig (to avoid having to always set LD_LIBRARY_PATH), but *after* the existing entries; # since entries in ld.so.conf.d have precedence before the preconfigured directories, we first add the latter to the former -RUN ldconfig -v 2>/dev/null | grep -v ^$'\t' | cut -f1 -d":" >> /etc/ld.so.conf.d/cuda-$CUDA_VER.conf \ - && if [ ${CUDA_VER} != "9.2" ]; then \ - # the upstream images for 10.x all have libcuda.so under $CUDA_HOME/compat; - # add this to the ldconfig so it will be found correctly. - echo "$CUDA_HOME/compat" >> /etc/ld.so.conf.d/cuda-$CUDA_VER.conf ; \ - else \ - # For 9.2, the image nvidia/cuda:9.2-devel-centos6 contains neither - # $CUDA_HOME/compat, nor any (non-stub) libcuda.so. We fix this by - # adding cuda-compat-10.0 (which is not used for building, but to - # test if loading the respective library/package works). However, - # due to licensing reasons, these cannot be part of the conda-forge - # docker images, but are instead added for CI purposes in: - # github.com/conda-forge/conda-forge-ci-setup-feedstock/blob/master/recipe/run_conda_forge_build_setup_linux - # Here we only set the ldconfig accordingly. - echo "/usr/local/cuda-10.0/compat" >> /etc/ld.so.conf.d/cuda-$CUDA_VER.conf ; \ - fi \ - # don't forget to update settings by running ldconfig - && ldconfig +# the upstream images all have libcuda.so under $CUDA_HOME/compat; +# add this to the ldconfig so it will be found correctly. +# don't forget to update settings by running ldconfig +RUN ldconfig -v 2>/dev/null | grep -v ^$'\t' | cut -f1 -d":" >> /etc/ld.so.conf.d/cuda-$CUDA_VER.conf && \ + echo "$CUDA_HOME/compat" >> /etc/ld.so.conf.d/cuda-$CUDA_VER.conf && \ + ldconfig # bust the docker cache so that we always rerun the installs below ADD https://loripsum.net/api /opt/docker/etc/gibberish From 1083a769ea88305c7b84fda6a38af9cd72785340 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 14:53:22 -0700 Subject: [PATCH 03/22] Drop old CUDA 10.1 header workaround This bug has long since been fixed making this code a no-op. The arch images already work without it. So go ahead and drop it from `x86_64` too. --- linux-anvil-cuda/Dockerfile | 8 -------- 1 file changed, 8 deletions(-) diff --git a/linux-anvil-cuda/Dockerfile b/linux-anvil-cuda/Dockerfile index 58e74420..c7fd8163 100644 --- a/linux-anvil-cuda/Dockerfile +++ b/linux-anvil-cuda/Dockerfile @@ -64,14 +64,6 @@ RUN source /opt/conda/etc/profile.d/conda.sh && \ chgrp -R lucky /opt/conda && \ chmod -R g=u /opt/conda -# Symlink CUDA headers that were moved from $CUDA_HOME/include to /usr/include -# in CUDA 10.1. -RUN for HEADER_FILE in cublas_api.h cublas.h cublasLt.h cublas_v2.h cublasXt.h nvblas.h; do \ - if [[ ! -f "${CUDA_HOME}/include/${HEADER_FILE}" ]]; \ - then ln -s "/usr/include/${HEADER_FILE}" "${CUDA_HOME}/include/${HEADER_FILE}"; \ - fi; \ - done - # Add qemu in here so that we can use this image on regular linux hosts with qemu user installed ADD qemu-aarch64-static /usr/bin/qemu-aarch64-static ADD qemu-ppc64le-static /usr/bin/qemu-ppc64le-static From 0bf9907c7e9e1b330415ec3e01bdb7fa41c4beb5 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 14:56:45 -0700 Subject: [PATCH 04/22] Refresh CUDA mentions in README Use CUDA 11.8.0 for all examples. Drop mentions to prior CUDA versions (especially those before CUDA 11.x). --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 224718d9..4f54fabd 100644 --- a/README.md +++ b/README.md @@ -18,15 +18,13 @@ environment variables passed in to be able to build. In this case, you will want to use a command similar to the following: ```sh -docker build --rm --build-arg DISTRO_NAME=centos --build-arg DISTRO_VER=6 --build-arg CUDA_VER=10.2 -f linux-anvil-cuda/Dockerfile . +docker build --rm --build-arg DISTRO_NAME=centos --build-arg DISTRO_VER=6 --build-arg CUDA_VER=11.8.0 -f linux-anvil-cuda/Dockerfile . ``` ## Environment variables * `$CUDA_VER`: This is the cuda & cudatoolkit version that will be used. The - value of this variable should be in major-minor for, e.g. `9.2` for versions - `9.x` and `10.x`. For versions `11.x` the variable should be in - major-minor-patch format, e.g. `11.2.0`. + value of this variable should be in major-minor-patch format, e.g. `11.8.0`. * `DISTRO_NAME`: This is the Linux distro image name that should be built with. Should match the upstream Docker image, e.g. `centos`. * `DISTRO_VER`: This is version of Linux distro (typical CentOS) that the image From 445c84ff5122a4b52551b7944d2f0c00f92719a6 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 15:08:42 -0700 Subject: [PATCH 05/22] Drop outdated CUDA PPC provisio --- linux-anvil-ppc64le-cuda/Dockerfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/linux-anvil-ppc64le-cuda/Dockerfile b/linux-anvil-ppc64le-cuda/Dockerfile index 684592dd..4a9ef153 100644 --- a/linux-anvil-ppc64le-cuda/Dockerfile +++ b/linux-anvil-ppc64le-cuda/Dockerfile @@ -1,7 +1,3 @@ -# Note that this image doesn't cache cudatoolkit as it is not packaged by defaults. -# This docker image is meant for packages using CUDA driver and not for packages -# using the CUDA runtime. - ARG CUDA_VER ARG DISTRO_NAME ARG DISTRO_VER From 7c2dadb290feca82198050a8f5c44190941a8c6b Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 15:11:08 -0700 Subject: [PATCH 06/22] Lineup initial comments between images --- linux-anvil-aarch64-cuda/Dockerfile | 1 + linux-anvil-ppc64le-cuda/Dockerfile | 1 + 2 files changed, 2 insertions(+) diff --git a/linux-anvil-aarch64-cuda/Dockerfile b/linux-anvil-aarch64-cuda/Dockerfile index 1ae2bb3e..a392eae6 100644 --- a/linux-anvil-aarch64-cuda/Dockerfile +++ b/linux-anvil-aarch64-cuda/Dockerfile @@ -1,3 +1,4 @@ +# Set environment variables during runtime. ARG CUDA_VER ARG DISTRO_NAME ARG DISTRO_VER diff --git a/linux-anvil-ppc64le-cuda/Dockerfile b/linux-anvil-ppc64le-cuda/Dockerfile index 4a9ef153..64e3afd9 100644 --- a/linux-anvil-ppc64le-cuda/Dockerfile +++ b/linux-anvil-ppc64le-cuda/Dockerfile @@ -1,3 +1,4 @@ +# Set environment variables during runtime. ARG CUDA_VER ARG DISTRO_NAME ARG DISTRO_VER From e2f770eb51aa8f71afe143b519e14830aaa6f0da Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 15:15:46 -0700 Subject: [PATCH 07/22] Align QEMU installation across images --- linux-anvil-aarch64-cuda/Dockerfile | 5 +++-- linux-anvil-cuda/Dockerfile | 8 ++++---- linux-anvil-ppc64le-cuda/Dockerfile | 6 +++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/linux-anvil-aarch64-cuda/Dockerfile b/linux-anvil-aarch64-cuda/Dockerfile index a392eae6..9019ec08 100644 --- a/linux-anvil-aarch64-cuda/Dockerfile +++ b/linux-anvil-aarch64-cuda/Dockerfile @@ -6,8 +6,6 @@ FROM --platform=linux/arm64 nvidia/cuda:${CUDA_VER}-devel-${DISTRO_NAME}${DISTRO LABEL maintainer="conda-forge " -ADD qemu-aarch64-static /usr/bin/qemu-aarch64-static - # Set CUDA_VER during runtime. ARG CUDA_VER ARG DISTRO_NAME @@ -23,6 +21,9 @@ ENV LANGUAGE=en_US.UTF-8 # Set path to CUDA install. ENV CUDA_HOME /usr/local/cuda +# Add qemu in here so that we can use this image on regular linux hosts with qemu user installed +ADD qemu-aarch64-static /usr/bin/qemu-aarch64-static + # we want to persist a path in ldconfig (to avoid having to always set LD_LIBRARY_PATH), but *after* the existing entries; # since entries in ld.so.conf.d have precedence before the preconfigured directories, we first add the latter to the former # the upstream images all have libcuda.so under $CUDA_HOME/compat; diff --git a/linux-anvil-cuda/Dockerfile b/linux-anvil-cuda/Dockerfile index c7fd8163..57934105 100644 --- a/linux-anvil-cuda/Dockerfile +++ b/linux-anvil-cuda/Dockerfile @@ -19,6 +19,10 @@ ENV LANG en_US.UTF-8 # Set path to CUDA install (this is a symlink to /usr/local/cuda-${CUDA_VER}) ENV CUDA_HOME /usr/local/cuda +# Add qemu in here so that we can use this image on regular linux hosts with qemu user installed +ADD qemu-aarch64-static /usr/bin/qemu-aarch64-static +ADD qemu-ppc64le-static /usr/bin/qemu-ppc64le-static + # we want to persist a path in ldconfig (to avoid having to always set LD_LIBRARY_PATH), but *after* the existing entries; # since entries in ld.so.conf.d have precedence before the preconfigured directories, we first add the latter to the former # The upstream images all have libcuda.so under $CUDA_HOME/compat; @@ -64,10 +68,6 @@ RUN source /opt/conda/etc/profile.d/conda.sh && \ chgrp -R lucky /opt/conda && \ chmod -R g=u /opt/conda -# Add qemu in here so that we can use this image on regular linux hosts with qemu user installed -ADD qemu-aarch64-static /usr/bin/qemu-aarch64-static -ADD qemu-ppc64le-static /usr/bin/qemu-ppc64le-static - # Add a file for users to source to activate the `conda` # environment `base`. Also add a file that wraps that for # use with the `ENTRYPOINT`. diff --git a/linux-anvil-ppc64le-cuda/Dockerfile b/linux-anvil-ppc64le-cuda/Dockerfile index 64e3afd9..442c4813 100644 --- a/linux-anvil-ppc64le-cuda/Dockerfile +++ b/linux-anvil-ppc64le-cuda/Dockerfile @@ -6,9 +6,6 @@ FROM --platform=linux/ppc64le nvidia/cuda:${CUDA_VER}-devel-${DISTRO_NAME}${DIST LABEL maintainer="conda-forge " -# Add qemu in here so that we can use this image on regular linux hosts with qemu user installed -ADD qemu-ppc64le-static /usr/bin/qemu-ppc64le-static - # Set CUDA_VER during runtime. ARG CUDA_VER ARG DISTRO_NAME @@ -24,6 +21,9 @@ ENV LANGUAGE=en_US.UTF-8 # Set path to CUDA install. ENV CUDA_HOME /usr/local/cuda +# Add qemu in here so that we can use this image on regular linux hosts with qemu user installed +ADD qemu-ppc64le-static /usr/bin/qemu-ppc64le-static + # we want to persist a path in ldconfig (to avoid having to always set LD_LIBRARY_PATH), but *after* the existing entries; # since entries in ld.so.conf.d have precedence before the preconfigured directories, we first add the latter to the former # the upstream images all have libcuda.so under $CUDA_HOME/compat; From 0a6d48ac9bdffeb8e0608e2570850bbb1188eb1c Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 15:17:17 -0700 Subject: [PATCH 08/22] Tweak comments about `ARG`s --- linux-anvil-aarch64-cuda/Dockerfile | 2 +- linux-anvil-cuda/Dockerfile | 1 + linux-anvil-ppc64le-cuda/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/linux-anvil-aarch64-cuda/Dockerfile b/linux-anvil-aarch64-cuda/Dockerfile index 9019ec08..85617bab 100644 --- a/linux-anvil-aarch64-cuda/Dockerfile +++ b/linux-anvil-aarch64-cuda/Dockerfile @@ -6,7 +6,7 @@ FROM --platform=linux/arm64 nvidia/cuda:${CUDA_VER}-devel-${DISTRO_NAME}${DISTRO LABEL maintainer="conda-forge " -# Set CUDA_VER during runtime. +# Set `ARG`s during runtime. ARG CUDA_VER ARG DISTRO_NAME ARG DISTRO_VER diff --git a/linux-anvil-cuda/Dockerfile b/linux-anvil-cuda/Dockerfile index 57934105..f23b2dbe 100644 --- a/linux-anvil-cuda/Dockerfile +++ b/linux-anvil-cuda/Dockerfile @@ -6,6 +6,7 @@ FROM --platform=linux/amd64 nvidia/cuda:${CUDA_VER}-devel-${DISTRO_NAME}${DISTRO LABEL maintainer="conda-forge " +# Set `ARG`s during runtime. ARG CUDA_VER ARG DISTRO_NAME ARG DISTRO_VER diff --git a/linux-anvil-ppc64le-cuda/Dockerfile b/linux-anvil-ppc64le-cuda/Dockerfile index 442c4813..f2fdad9d 100644 --- a/linux-anvil-ppc64le-cuda/Dockerfile +++ b/linux-anvil-ppc64le-cuda/Dockerfile @@ -6,7 +6,7 @@ FROM --platform=linux/ppc64le nvidia/cuda:${CUDA_VER}-devel-${DISTRO_NAME}${DIST LABEL maintainer="conda-forge " -# Set CUDA_VER during runtime. +# Set `ARG`s during runtime. ARG CUDA_VER ARG DISTRO_NAME ARG DISTRO_VER From 91a206c6a131a9642fc6e8f68e63a1c2a567e68b Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 15:22:28 -0700 Subject: [PATCH 09/22] Reference the conda env `base` (not `root`) --- linux-anvil-aarch64-cuda/Dockerfile | 4 ++-- linux-anvil-cuda/Dockerfile | 2 +- linux-anvil-ppc64le-cuda/Dockerfile | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/linux-anvil-aarch64-cuda/Dockerfile b/linux-anvil-aarch64-cuda/Dockerfile index 85617bab..4147a700 100644 --- a/linux-anvil-aarch64-cuda/Dockerfile +++ b/linux-anvil-aarch64-cuda/Dockerfile @@ -97,13 +97,13 @@ RUN source /opt/conda/etc/profile.d/conda.sh && \ chmod -R g=u /opt/conda # Add a file for users to source to activate the `conda` -# environment `root`. Also add a file that wraps that for +# environment `base`. Also add a file that wraps that for # use with the `ENTRYPOINT`. COPY linux-anvil-aarch64-cuda/entrypoint_source /opt/docker/bin/entrypoint_source COPY scripts/entrypoint /opt/docker/bin/entrypoint # Ensure that all containers start with tini and the user selected process. -# Activate the `conda` environment `root`. +# Activate the `conda` environment `base`. # Provide a default command (`bash`), which will start if the user doesn't specify one. ENTRYPOINT [ "/opt/conda/bin/tini", "--", "/opt/docker/bin/entrypoint" ] CMD [ "/bin/bash" ] diff --git a/linux-anvil-cuda/Dockerfile b/linux-anvil-cuda/Dockerfile index f23b2dbe..bd5ffb87 100644 --- a/linux-anvil-cuda/Dockerfile +++ b/linux-anvil-cuda/Dockerfile @@ -76,7 +76,7 @@ COPY linux-anvil-cuda/entrypoint_source /opt/docker/bin/entrypoint_source COPY scripts/entrypoint /opt/docker/bin/entrypoint # Ensure that all containers start with tini and the user selected process. -# Activate the `conda` environment `base` and the devtoolset compiler. +# Activate the `conda` environment `base`. # Provide a default command (`bash`), which will start if the user doesn't specify one. ENTRYPOINT [ "/opt/conda/bin/tini", "--", "/opt/docker/bin/entrypoint" ] CMD [ "/bin/bash" ] diff --git a/linux-anvil-ppc64le-cuda/Dockerfile b/linux-anvil-ppc64le-cuda/Dockerfile index f2fdad9d..d5eced7d 100644 --- a/linux-anvil-ppc64le-cuda/Dockerfile +++ b/linux-anvil-ppc64le-cuda/Dockerfile @@ -97,13 +97,13 @@ RUN source /opt/conda/etc/profile.d/conda.sh && \ chmod -R g=u /opt/conda # Add a file for users to source to activate the `conda` -# environment `root`. Also add a file that wraps that for +# environment `base`. Also add a file that wraps that for # use with the `ENTRYPOINT`. COPY linux-anvil-ppc64le-cuda/entrypoint_source /opt/docker/bin/entrypoint_source COPY scripts/entrypoint /opt/docker/bin/entrypoint # Ensure that all containers start with tini and the user selected process. -# Activate the `conda` environment `root`. +# Activate the `conda` environment `base`. # Provide a default command (`bash`), which will start if the user doesn't specify one. ENTRYPOINT [ "/opt/conda/bin/tini", "--", "/opt/docker/bin/entrypoint" ] CMD [ "/bin/bash" ] From b650359b8d40700b4b620429d64ba6d616754226 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 15:27:09 -0700 Subject: [PATCH 10/22] Align `CUDA_HOME` comment --- linux-anvil-aarch64-cuda/Dockerfile | 2 +- linux-anvil-ppc64le-cuda/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-anvil-aarch64-cuda/Dockerfile b/linux-anvil-aarch64-cuda/Dockerfile index 4147a700..1da0f72c 100644 --- a/linux-anvil-aarch64-cuda/Dockerfile +++ b/linux-anvil-aarch64-cuda/Dockerfile @@ -18,7 +18,7 @@ ENV CUDA_VER=${CUDA_VER} \ ENV LANG en_US.UTF-8 ENV LANGUAGE=en_US.UTF-8 -# Set path to CUDA install. +# Set path to CUDA install (this is a symlink to /usr/local/cuda-${CUDA_VER}) ENV CUDA_HOME /usr/local/cuda # Add qemu in here so that we can use this image on regular linux hosts with qemu user installed diff --git a/linux-anvil-ppc64le-cuda/Dockerfile b/linux-anvil-ppc64le-cuda/Dockerfile index d5eced7d..1789b5aa 100644 --- a/linux-anvil-ppc64le-cuda/Dockerfile +++ b/linux-anvil-ppc64le-cuda/Dockerfile @@ -18,7 +18,7 @@ ENV CUDA_VER=${CUDA_VER} \ ENV LANG en_US.UTF-8 ENV LANGUAGE=en_US.UTF-8 -# Set path to CUDA install. +# Set path to CUDA install (this is a symlink to /usr/local/cuda-${CUDA_VER}) ENV CUDA_HOME /usr/local/cuda # Add qemu in here so that we can use this image on regular linux hosts with qemu user installed From 0d359ae10abfc077dc32da51292390a9a71546c2 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 15:28:39 -0700 Subject: [PATCH 11/22] Align encoding environment variables & values --- linux-anvil-aarch64-cuda/Dockerfile | 2 +- linux-anvil-cuda/Dockerfile | 1 + linux-anvil-ppc64le-cuda/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/linux-anvil-aarch64-cuda/Dockerfile b/linux-anvil-aarch64-cuda/Dockerfile index 1da0f72c..fda9c741 100644 --- a/linux-anvil-aarch64-cuda/Dockerfile +++ b/linux-anvil-aarch64-cuda/Dockerfile @@ -16,7 +16,7 @@ ENV CUDA_VER=${CUDA_VER} \ # Set an encoding to make things work smoothly. ENV LANG en_US.UTF-8 -ENV LANGUAGE=en_US.UTF-8 +ENV LANGUAGE en_US.UTF-8 # Set path to CUDA install (this is a symlink to /usr/local/cuda-${CUDA_VER}) ENV CUDA_HOME /usr/local/cuda diff --git a/linux-anvil-cuda/Dockerfile b/linux-anvil-cuda/Dockerfile index bd5ffb87..c37c1938 100644 --- a/linux-anvil-cuda/Dockerfile +++ b/linux-anvil-cuda/Dockerfile @@ -16,6 +16,7 @@ ENV CUDA_VER=${CUDA_VER} \ # Set an encoding to make things work smoothly. ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US.UTF-8 # Set path to CUDA install (this is a symlink to /usr/local/cuda-${CUDA_VER}) ENV CUDA_HOME /usr/local/cuda diff --git a/linux-anvil-ppc64le-cuda/Dockerfile b/linux-anvil-ppc64le-cuda/Dockerfile index 1789b5aa..ef4a5f09 100644 --- a/linux-anvil-ppc64le-cuda/Dockerfile +++ b/linux-anvil-ppc64le-cuda/Dockerfile @@ -16,7 +16,7 @@ ENV CUDA_VER=${CUDA_VER} \ # Set an encoding to make things work smoothly. ENV LANG en_US.UTF-8 -ENV LANGUAGE=en_US.UTF-8 +ENV LANGUAGE en_US.UTF-8 # Set path to CUDA install (this is a symlink to /usr/local/cuda-${CUDA_VER}) ENV CUDA_HOME /usr/local/cuda From d4a399053caa8edd248ce2cf2bb3e2f1e17f55f8 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 15:30:44 -0700 Subject: [PATCH 12/22] Fixup `ldconfig` logic --- linux-anvil-cuda/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/linux-anvil-cuda/Dockerfile b/linux-anvil-cuda/Dockerfile index c37c1938..ba1e828e 100644 --- a/linux-anvil-cuda/Dockerfile +++ b/linux-anvil-cuda/Dockerfile @@ -27,12 +27,12 @@ ADD qemu-ppc64le-static /usr/bin/qemu-ppc64le-static # we want to persist a path in ldconfig (to avoid having to always set LD_LIBRARY_PATH), but *after* the existing entries; # since entries in ld.so.conf.d have precedence before the preconfigured directories, we first add the latter to the former -# The upstream images all have libcuda.so under $CUDA_HOME/compat; +# the upstream images all have libcuda.so under $CUDA_HOME/compat; # add this to the ldconfig so it will be found correctly. # don't forget to update settings by running ldconfig -RUN ldconfig -v 2>/dev/null | grep -v ^$'\t' | cut -f1 -d":" >> /etc/ld.so.conf.d/cuda-$CUDA_VER.conf \ - echo "$CUDA_HOME/compat" >> /etc/ld.so.conf.d/cuda-$CUDA_VER.conf ; \ - && ldconfig +RUN ldconfig -v 2>/dev/null | grep -v ^$'\t' | cut -f1 -d":" >> /etc/ld.so.conf.d/cuda-$CUDA_VER.conf && \ + echo "$CUDA_HOME/compat" >> /etc/ld.so.conf.d/cuda-$CUDA_VER.conf && \ + ldconfig # bust the docker cache so that we always rerun the installs below ADD https://loripsum.net/api /opt/docker/etc/gibberish From cd3512a73bc39d01a3ab5d8da35eaafae52c2653 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 15:41:36 -0700 Subject: [PATCH 13/22] Adjust `yum install` wrapping --- linux-anvil-cuda/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux-anvil-cuda/Dockerfile b/linux-anvil-cuda/Dockerfile index ba1e828e..02b3dc87 100644 --- a/linux-anvil-cuda/Dockerfile +++ b/linux-anvil-cuda/Dockerfile @@ -49,7 +49,8 @@ RUN yum update -y --disablerepo=cuda && \ bzip2 \ sudo \ tar \ - which && \ + which \ + && \ /opt/docker/bin/yum_clean_all # Remove preinclude system compilers From 524c0e1ef3511d3b4f5ed5cf60923d004f6e63cb Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 15:42:30 -0700 Subject: [PATCH 14/22] Separate `yum_clean_all` script install from rest --- linux-anvil-cuda/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/linux-anvil-cuda/Dockerfile b/linux-anvil-cuda/Dockerfile index 02b3dc87..f03f25de 100644 --- a/linux-anvil-cuda/Dockerfile +++ b/linux-anvil-cuda/Dockerfile @@ -42,8 +42,10 @@ ADD centos7-repos /tmp/centos7-repos ADD scripts/fix_rpm /opt/docker/bin/fix_rpm RUN /opt/docker/bin/fix_rpm -# Install basic requirements. +# Add custom `yum_clean_all` script before using `yum` COPY scripts/yum_clean_all /opt/docker/bin/ + +# Install basic requirements. RUN yum update -y --disablerepo=cuda && \ yum install -y \ bzip2 \ From 39ca0c46b3f396a5820125188d654847b266a4ab Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 15:47:27 -0700 Subject: [PATCH 15/22] Move cache buster earlier --- linux-anvil-aarch64-cuda/Dockerfile | 6 +++--- linux-anvil-cuda/Dockerfile | 6 +++--- linux-anvil-ppc64le-cuda/Dockerfile | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/linux-anvil-aarch64-cuda/Dockerfile b/linux-anvil-aarch64-cuda/Dockerfile index fda9c741..a73ec5d8 100644 --- a/linux-anvil-aarch64-cuda/Dockerfile +++ b/linux-anvil-aarch64-cuda/Dockerfile @@ -21,6 +21,9 @@ ENV LANGUAGE en_US.UTF-8 # Set path to CUDA install (this is a symlink to /usr/local/cuda-${CUDA_VER}) ENV CUDA_HOME /usr/local/cuda +# bust the docker cache so that we always rerun the installs below +ADD https://loripsum.net/api /opt/docker/etc/gibberish + # Add qemu in here so that we can use this image on regular linux hosts with qemu user installed ADD qemu-aarch64-static /usr/bin/qemu-aarch64-static @@ -33,9 +36,6 @@ RUN ldconfig -v 2>/dev/null | grep -v ^$'\t' | cut -f1 -d":" >> /etc/ld.so.conf. echo "$CUDA_HOME/compat" >> /etc/ld.so.conf.d/cuda-$CUDA_VER.conf && \ ldconfig -# bust the docker cache so that we always rerun the installs below -ADD https://loripsum.net/api /opt/docker/etc/gibberish - # Resolves a nasty NOKEY warning that appears when using yum. # Naming convention changed with cos8 - see: # * https://lists.centos.org/pipermail/centos-devel/2019-September/017847.html diff --git a/linux-anvil-cuda/Dockerfile b/linux-anvil-cuda/Dockerfile index f03f25de..8e5f8b22 100644 --- a/linux-anvil-cuda/Dockerfile +++ b/linux-anvil-cuda/Dockerfile @@ -21,6 +21,9 @@ ENV LANGUAGE en_US.UTF-8 # Set path to CUDA install (this is a symlink to /usr/local/cuda-${CUDA_VER}) ENV CUDA_HOME /usr/local/cuda +# bust the docker cache so that we always rerun the installs below +ADD https://loripsum.net/api /opt/docker/etc/gibberish + # Add qemu in here so that we can use this image on regular linux hosts with qemu user installed ADD qemu-aarch64-static /usr/bin/qemu-aarch64-static ADD qemu-ppc64le-static /usr/bin/qemu-ppc64le-static @@ -34,9 +37,6 @@ RUN ldconfig -v 2>/dev/null | grep -v ^$'\t' | cut -f1 -d":" >> /etc/ld.so.conf. echo "$CUDA_HOME/compat" >> /etc/ld.so.conf.d/cuda-$CUDA_VER.conf && \ ldconfig -# bust the docker cache so that we always rerun the installs below -ADD https://loripsum.net/api /opt/docker/etc/gibberish - # Add the archived repo URL and fix RPM imports ADD centos7-repos /tmp/centos7-repos ADD scripts/fix_rpm /opt/docker/bin/fix_rpm diff --git a/linux-anvil-ppc64le-cuda/Dockerfile b/linux-anvil-ppc64le-cuda/Dockerfile index ef4a5f09..ffe30c6e 100644 --- a/linux-anvil-ppc64le-cuda/Dockerfile +++ b/linux-anvil-ppc64le-cuda/Dockerfile @@ -21,6 +21,9 @@ ENV LANGUAGE en_US.UTF-8 # Set path to CUDA install (this is a symlink to /usr/local/cuda-${CUDA_VER}) ENV CUDA_HOME /usr/local/cuda +# bust the docker cache so that we always rerun the installs below +ADD https://loripsum.net/api /opt/docker/etc/gibberish + # Add qemu in here so that we can use this image on regular linux hosts with qemu user installed ADD qemu-ppc64le-static /usr/bin/qemu-ppc64le-static @@ -33,9 +36,6 @@ RUN ldconfig -v 2>/dev/null | grep -v ^$'\t' | cut -f1 -d":" >> /etc/ld.so.conf. echo "$CUDA_HOME/compat" >> /etc/ld.so.conf.d/cuda-$CUDA_VER.conf && \ ldconfig -# bust the docker cache so that we always rerun the installs below -ADD https://loripsum.net/api /opt/docker/etc/gibberish - # Resolves a nasty NOKEY warning that appears when using yum. # Naming convention changed with cos8 - see: # * https://lists.centos.org/pipermail/centos-devel/2019-September/017847.html From d9548492ede4286166f4c409ad6736f611107d5f Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 16:20:03 -0700 Subject: [PATCH 16/22] Drop CentOS 7 from CUDA arch images This is no longer relevant for these images as they are on 8 only now. --- linux-anvil-aarch64-cuda/Dockerfile | 5 +---- linux-anvil-ppc64le-cuda/Dockerfile | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/linux-anvil-aarch64-cuda/Dockerfile b/linux-anvil-aarch64-cuda/Dockerfile index a73ec5d8..d40454e3 100644 --- a/linux-anvil-aarch64-cuda/Dockerfile +++ b/linux-anvil-aarch64-cuda/Dockerfile @@ -40,10 +40,7 @@ RUN ldconfig -v 2>/dev/null | grep -v ^$'\t' | cut -f1 -d":" >> /etc/ld.so.conf. # Naming convention changed with cos8 - see: # * https://lists.centos.org/pipermail/centos-devel/2019-September/017847.html # * https://www.centos.org/keys/#project-keys -RUN if [ "${DISTRO_NAME}${DISTRO_VER}" = "centos7" ]; then \ - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-7-aarch64; \ - elif [ "${DISTRO_NAME}${DISTRO_VER}" = "centos8" ]; then \ +RUN if [ "${DISTRO_NAME}${DISTRO_VER}" = "centos8" ]; then \ rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial; \ elif [ "${DISTRO_NAME}${DISTRO_VER}" = "ubi8" ]; then \ rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release; \ diff --git a/linux-anvil-ppc64le-cuda/Dockerfile b/linux-anvil-ppc64le-cuda/Dockerfile index ffe30c6e..2aab2aa1 100644 --- a/linux-anvil-ppc64le-cuda/Dockerfile +++ b/linux-anvil-ppc64le-cuda/Dockerfile @@ -40,10 +40,7 @@ RUN ldconfig -v 2>/dev/null | grep -v ^$'\t' | cut -f1 -d":" >> /etc/ld.so.conf. # Naming convention changed with cos8 - see: # * https://lists.centos.org/pipermail/centos-devel/2019-September/017847.html # * https://www.centos.org/keys/#project-keys -RUN if [ "${DISTRO_NAME}${DISTRO_VER}" = "centos7" ]; then \ - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-7-ppc64le; \ - elif [ "${DISTRO_NAME}${DISTRO_VER}" = "centos8" ]; then \ +RUN if [ "${DISTRO_NAME}${DISTRO_VER}" = "centos8" ]; then \ rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial; \ elif [ "${DISTRO_NAME}${DISTRO_VER}" = "ubi8" ]; then \ rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release; \ From 58724bf6b67a1fbde41ef51e919bee126acf0dee Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 16:20:04 -0700 Subject: [PATCH 17/22] With CUDA arch images, only use UBI 8 fixes As CentOS 8 base CUDA arch images have been removed, only UBI 8 is relevant here. So drop the CentOS 8 logic. --- linux-anvil-aarch64-cuda/Dockerfile | 26 ++++---------------------- linux-anvil-ppc64le-cuda/Dockerfile | 26 ++++---------------------- 2 files changed, 8 insertions(+), 44 deletions(-) diff --git a/linux-anvil-aarch64-cuda/Dockerfile b/linux-anvil-aarch64-cuda/Dockerfile index d40454e3..7bfeb301 100644 --- a/linux-anvil-aarch64-cuda/Dockerfile +++ b/linux-anvil-aarch64-cuda/Dockerfile @@ -37,26 +37,11 @@ RUN ldconfig -v 2>/dev/null | grep -v ^$'\t' | cut -f1 -d":" >> /etc/ld.so.conf. ldconfig # Resolves a nasty NOKEY warning that appears when using yum. -# Naming convention changed with cos8 - see: -# * https://lists.centos.org/pipermail/centos-devel/2019-September/017847.html -# * https://www.centos.org/keys/#project-keys -RUN if [ "${DISTRO_NAME}${DISTRO_VER}" = "centos8" ]; then \ - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial; \ - elif [ "${DISTRO_NAME}${DISTRO_VER}" = "ubi8" ]; then \ - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release; \ - fi +RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release # Add custom `yum_clean_all` script before using `yum` COPY scripts/yum_clean_all /opt/docker/bin/ -# Fallback to CentOS vault for CentOS 8 support. -RUN if [ "${DISTRO_NAME}${DISTRO_VER}" = "centos8" ]; then \ - find /etc/yum.repos.d/ -name "CentOS-*.repo" -exec \ - sed -i 's/mirrorlist/#mirrorlist/g;s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' {} \; && \ - yum update -y --disablerepo=cuda && \ - /opt/docker/bin/yum_clean_all; \ - fi - # Install basic requirements. RUN yum update -y --disablerepo=cuda && \ yum install -y \ @@ -67,13 +52,10 @@ RUN yum update -y --disablerepo=cuda && \ && \ /opt/docker/bin/yum_clean_all -# Fix locale in CentOS8 images +# Fix locale in UBI 8 images # See https://github.com/CentOS/sig-cloud-instance-images/issues/154 -RUN if [ "${DISTRO_NAME}${DISTRO_VER}" = "centos8" ] || [ "${DISTRO_NAME}${DISTRO_VER}" = "ubi8" ]; then \ - yum install -y glibc-langpack-en \ - && \ - /opt/docker/bin/yum_clean_all; \ - fi +RUN yum install -y glibc-langpack-en && \ + /opt/docker/bin/yum_clean_all # Remove preinclude system compilers RUN rpm -e --nodeps --verbose gcc gcc-c++ diff --git a/linux-anvil-ppc64le-cuda/Dockerfile b/linux-anvil-ppc64le-cuda/Dockerfile index 2aab2aa1..36d1fbb6 100644 --- a/linux-anvil-ppc64le-cuda/Dockerfile +++ b/linux-anvil-ppc64le-cuda/Dockerfile @@ -37,26 +37,11 @@ RUN ldconfig -v 2>/dev/null | grep -v ^$'\t' | cut -f1 -d":" >> /etc/ld.so.conf. ldconfig # Resolves a nasty NOKEY warning that appears when using yum. -# Naming convention changed with cos8 - see: -# * https://lists.centos.org/pipermail/centos-devel/2019-September/017847.html -# * https://www.centos.org/keys/#project-keys -RUN if [ "${DISTRO_NAME}${DISTRO_VER}" = "centos8" ]; then \ - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial; \ - elif [ "${DISTRO_NAME}${DISTRO_VER}" = "ubi8" ]; then \ - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release; \ - fi +RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release # Add custom `yum_clean_all` script before using `yum` COPY scripts/yum_clean_all /opt/docker/bin/ -# Fallback to CentOS vault for CentOS 8 support. -RUN if [ "${DISTRO_NAME}${DISTRO_VER}" = "centos8" ]; then \ - find /etc/yum.repos.d/ -name "CentOS-*.repo" -exec \ - sed -i 's/mirrorlist/#mirrorlist/g;s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' {} \; && \ - yum update -y --disablerepo=cuda && \ - /opt/docker/bin/yum_clean_all; \ - fi - # Install basic requirements. RUN yum update -y --disablerepo=cuda && \ yum install -y \ @@ -67,13 +52,10 @@ RUN yum update -y --disablerepo=cuda && \ && \ /opt/docker/bin/yum_clean_all -# Fix locale in CentOS8 images +# Fix locale in UBI 8 images # See https://github.com/CentOS/sig-cloud-instance-images/issues/154 -RUN if [ "${DISTRO_NAME}${DISTRO_VER}" = "centos8" ] || [ "${DISTRO_NAME}${DISTRO_VER}" = "ubi8" ]; then \ - yum install -y glibc-langpack-en \ - && \ - /opt/docker/bin/yum_clean_all; \ - fi +RUN yum install -y glibc-langpack-en && \ + /opt/docker/bin/yum_clean_all # Remove preinclude system compilers RUN rpm -e --nodeps --verbose gcc gcc-c++ From 705134e8b4558f2bd19b84e406bafc30a48848dd Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 16:30:11 -0700 Subject: [PATCH 18/22] Adjust `&&` indentation --- linux-anvil-aarch64-cuda/Dockerfile | 2 +- linux-anvil-cuda/Dockerfile | 2 +- linux-anvil-ppc64le-cuda/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/linux-anvil-aarch64-cuda/Dockerfile b/linux-anvil-aarch64-cuda/Dockerfile index 7bfeb301..f7c5b53f 100644 --- a/linux-anvil-aarch64-cuda/Dockerfile +++ b/linux-anvil-aarch64-cuda/Dockerfile @@ -49,7 +49,7 @@ RUN yum update -y --disablerepo=cuda && \ sudo \ tar \ which \ - && \ + && \ /opt/docker/bin/yum_clean_all # Fix locale in UBI 8 images diff --git a/linux-anvil-cuda/Dockerfile b/linux-anvil-cuda/Dockerfile index 8e5f8b22..4f07e775 100644 --- a/linux-anvil-cuda/Dockerfile +++ b/linux-anvil-cuda/Dockerfile @@ -52,7 +52,7 @@ RUN yum update -y --disablerepo=cuda && \ sudo \ tar \ which \ - && \ + && \ /opt/docker/bin/yum_clean_all # Remove preinclude system compilers diff --git a/linux-anvil-ppc64le-cuda/Dockerfile b/linux-anvil-ppc64le-cuda/Dockerfile index 36d1fbb6..ceb6a0dc 100644 --- a/linux-anvil-ppc64le-cuda/Dockerfile +++ b/linux-anvil-ppc64le-cuda/Dockerfile @@ -49,7 +49,7 @@ RUN yum update -y --disablerepo=cuda && \ sudo \ tar \ which \ - && \ + && \ /opt/docker/bin/yum_clean_all # Fix locale in UBI 8 images From 467e35b6f41881ab2ff9b5db7fd528b4186c6f9b Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 16:39:01 -0700 Subject: [PATCH 19/22] Move UBI 8 RPM key fix to `fix_rpm` --- linux-anvil-aarch64-cuda/Dockerfile | 5 +++-- linux-anvil-ppc64le-cuda/Dockerfile | 5 +++-- scripts/fix_rpm | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/linux-anvil-aarch64-cuda/Dockerfile b/linux-anvil-aarch64-cuda/Dockerfile index f7c5b53f..35646c25 100644 --- a/linux-anvil-aarch64-cuda/Dockerfile +++ b/linux-anvil-aarch64-cuda/Dockerfile @@ -36,8 +36,9 @@ RUN ldconfig -v 2>/dev/null | grep -v ^$'\t' | cut -f1 -d":" >> /etc/ld.so.conf. echo "$CUDA_HOME/compat" >> /etc/ld.so.conf.d/cuda-$CUDA_VER.conf && \ ldconfig -# Resolves a nasty NOKEY warning that appears when using yum. -RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release +# Fix RPM imports +ADD scripts/fix_rpm /opt/docker/bin/fix_rpm +RUN /opt/docker/bin/fix_rpm # Add custom `yum_clean_all` script before using `yum` COPY scripts/yum_clean_all /opt/docker/bin/ diff --git a/linux-anvil-ppc64le-cuda/Dockerfile b/linux-anvil-ppc64le-cuda/Dockerfile index ceb6a0dc..fac24d78 100644 --- a/linux-anvil-ppc64le-cuda/Dockerfile +++ b/linux-anvil-ppc64le-cuda/Dockerfile @@ -36,8 +36,9 @@ RUN ldconfig -v 2>/dev/null | grep -v ^$'\t' | cut -f1 -d":" >> /etc/ld.so.conf. echo "$CUDA_HOME/compat" >> /etc/ld.so.conf.d/cuda-$CUDA_VER.conf && \ ldconfig -# Resolves a nasty NOKEY warning that appears when using yum. -RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release +# Fix RPM imports +ADD scripts/fix_rpm /opt/docker/bin/fix_rpm +RUN /opt/docker/bin/fix_rpm # Add custom `yum_clean_all` script before using `yum` COPY scripts/yum_clean_all /opt/docker/bin/ diff --git a/scripts/fix_rpm b/scripts/fix_rpm index 788c3766..d64b8bc8 100755 --- a/scripts/fix_rpm +++ b/scripts/fix_rpm @@ -14,6 +14,8 @@ if [[ "${DISTRO_NAME}${DISTRO_VER}" == "centos7" ]]; then elif [[ "$(uname -m)" == "aarch64" ]]; then rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7-aarch64 fi +elif [ "${DISTRO_NAME}${DISTRO_VER}" = "ubi8" ]; then + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release fi rm -rf "/tmp/centos7-repos" From 5c983a51c51ad240f878e09c34b983fafa342b73 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 16:59:34 -0700 Subject: [PATCH 20/22] Consolidate CUDA images --- .github/workflows/ci.yaml | 6 ++ linux-anvil-aarch64-cuda/Dockerfile | 89 ---------------------- linux-anvil-aarch64-cuda/entrypoint_source | 5 -- linux-anvil-cuda/Dockerfile | 14 +++- linux-anvil-ppc64le-cuda/Dockerfile | 89 ---------------------- linux-anvil-ppc64le-cuda/entrypoint_source | 5 -- 6 files changed, 19 insertions(+), 189 deletions(-) delete mode 100644 linux-anvil-aarch64-cuda/Dockerfile delete mode 100644 linux-anvil-aarch64-cuda/entrypoint_source delete mode 100644 linux-anvil-ppc64le-cuda/Dockerfile delete mode 100644 linux-anvil-ppc64le-cuda/entrypoint_source diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3684ebce..cf9e9df8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -36,22 +36,28 @@ jobs: SHORT_DESCRIPTION: "conda-forge build image for Cent0S 7 on aarch64" - DOCKERIMAGE: linux-anvil-cuda + DOCKERFILE: linux-anvil-cuda DOCKERTAG: "11.8" CUDA_VER: "11.8.0" + DISTRO_ARCH: "amd64" DISTRO_NAME: "centos" DISTRO_VER: "7" SHORT_DESCRIPTION: "conda-forge build image for Cent0S 7 on x86_64 with CUDA" - DOCKERIMAGE: linux-anvil-ppc64le-cuda + DOCKERFILE: linux-anvil-cuda DOCKERTAG: "11.8" CUDA_VER: "11.8.0" + DISTRO_ARCH: "ppc64le" DISTRO_NAME: "ubi" DISTRO_VER: "8" SHORT_DESCRIPTION: "conda-forge build image for Cent0S 8 on ppc64le with CUDA" - DOCKERIMAGE: linux-anvil-aarch64-cuda + DOCKERFILE: linux-anvil-cuda DOCKERTAG: "11.8" CUDA_VER: "11.8.0" + DISTRO_ARCH: "arm64" DISTRO_NAME: "ubi" DISTRO_VER: "8" SHORT_DESCRIPTION: "conda-forge build image for Cent0S 8 on aarch64 with CUDA" diff --git a/linux-anvil-aarch64-cuda/Dockerfile b/linux-anvil-aarch64-cuda/Dockerfile deleted file mode 100644 index 35646c25..00000000 --- a/linux-anvil-aarch64-cuda/Dockerfile +++ /dev/null @@ -1,89 +0,0 @@ -# Set environment variables during runtime. -ARG CUDA_VER -ARG DISTRO_NAME -ARG DISTRO_VER -FROM --platform=linux/arm64 nvidia/cuda:${CUDA_VER}-devel-${DISTRO_NAME}${DISTRO_VER} - -LABEL maintainer="conda-forge " - -# Set `ARG`s during runtime. -ARG CUDA_VER -ARG DISTRO_NAME -ARG DISTRO_VER -ENV CUDA_VER=${CUDA_VER} \ - DISTRO_NAME=${DISTRO_NAME} \ - DISTRO_VER=${DISTRO_VER} - -# Set an encoding to make things work smoothly. -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US.UTF-8 - -# Set path to CUDA install (this is a symlink to /usr/local/cuda-${CUDA_VER}) -ENV CUDA_HOME /usr/local/cuda - -# bust the docker cache so that we always rerun the installs below -ADD https://loripsum.net/api /opt/docker/etc/gibberish - -# Add qemu in here so that we can use this image on regular linux hosts with qemu user installed -ADD qemu-aarch64-static /usr/bin/qemu-aarch64-static - -# we want to persist a path in ldconfig (to avoid having to always set LD_LIBRARY_PATH), but *after* the existing entries; -# since entries in ld.so.conf.d have precedence before the preconfigured directories, we first add the latter to the former -# the upstream images all have libcuda.so under $CUDA_HOME/compat; -# add this to the ldconfig so it will be found correctly. -# don't forget to update settings by running ldconfig -RUN ldconfig -v 2>/dev/null | grep -v ^$'\t' | cut -f1 -d":" >> /etc/ld.so.conf.d/cuda-$CUDA_VER.conf && \ - echo "$CUDA_HOME/compat" >> /etc/ld.so.conf.d/cuda-$CUDA_VER.conf && \ - ldconfig - -# Fix RPM imports -ADD scripts/fix_rpm /opt/docker/bin/fix_rpm -RUN /opt/docker/bin/fix_rpm - -# Add custom `yum_clean_all` script before using `yum` -COPY scripts/yum_clean_all /opt/docker/bin/ - -# Install basic requirements. -RUN yum update -y --disablerepo=cuda && \ - yum install -y \ - bzip2 \ - sudo \ - tar \ - which \ - && \ - /opt/docker/bin/yum_clean_all - -# Fix locale in UBI 8 images -# See https://github.com/CentOS/sig-cloud-instance-images/issues/154 -RUN yum install -y glibc-langpack-en && \ - /opt/docker/bin/yum_clean_all - -# Remove preinclude system compilers -RUN rpm -e --nodeps --verbose gcc gcc-c++ - -# Run common commands -COPY scripts/run_commands /opt/docker/bin/run_commands -RUN /opt/docker/bin/run_commands - -# Download and cache CUDA related packages. -RUN source /opt/conda/etc/profile.d/conda.sh && \ - conda activate && \ - conda create -n test --yes --quiet --download-only \ - conda-forge::cudatoolkit=${CUDA_VER} \ - && \ - conda remove --yes --quiet -n test --all && \ - conda clean -tiy && \ - chgrp -R lucky /opt/conda && \ - chmod -R g=u /opt/conda - -# Add a file for users to source to activate the `conda` -# environment `base`. Also add a file that wraps that for -# use with the `ENTRYPOINT`. -COPY linux-anvil-aarch64-cuda/entrypoint_source /opt/docker/bin/entrypoint_source -COPY scripts/entrypoint /opt/docker/bin/entrypoint - -# Ensure that all containers start with tini and the user selected process. -# Activate the `conda` environment `base`. -# Provide a default command (`bash`), which will start if the user doesn't specify one. -ENTRYPOINT [ "/opt/conda/bin/tini", "--", "/opt/docker/bin/entrypoint" ] -CMD [ "/bin/bash" ] diff --git a/linux-anvil-aarch64-cuda/entrypoint_source b/linux-anvil-aarch64-cuda/entrypoint_source deleted file mode 100644 index 55d440c2..00000000 --- a/linux-anvil-aarch64-cuda/entrypoint_source +++ /dev/null @@ -1,5 +0,0 @@ -# Add `CUDA_HOME` binaries to `PATH`. -export PATH="${PATH}:${CUDA_HOME}/bin" - -# Activate the `base` conda environment. -conda activate base diff --git a/linux-anvil-cuda/Dockerfile b/linux-anvil-cuda/Dockerfile index 4f07e775..582e1168 100644 --- a/linux-anvil-cuda/Dockerfile +++ b/linux-anvil-cuda/Dockerfile @@ -1,16 +1,19 @@ # Set environment variables during runtime. ARG CUDA_VER +ARG DISTRO_ARCH ARG DISTRO_NAME ARG DISTRO_VER -FROM --platform=linux/amd64 nvidia/cuda:${CUDA_VER}-devel-${DISTRO_NAME}${DISTRO_VER} +FROM --platform=linux/${DISTRO_ARCH} nvidia/cuda:${CUDA_VER}-devel-${DISTRO_NAME}${DISTRO_VER} LABEL maintainer="conda-forge " # Set `ARG`s during runtime. ARG CUDA_VER +ARG DISTRO_ARCH ARG DISTRO_NAME ARG DISTRO_VER ENV CUDA_VER=${CUDA_VER} \ + DISTRO_ARCH=${DISTRO_ARCH} \ DISTRO_NAME=${DISTRO_NAME} \ DISTRO_VER=${DISTRO_VER} @@ -55,6 +58,15 @@ RUN yum update -y --disablerepo=cuda && \ && \ /opt/docker/bin/yum_clean_all +# Fix locale in UBI 8 images +# See https://github.com/CentOS/sig-cloud-instance-images/issues/154 +RUN if [ "${DISTRO_NAME}${DISTRO_VER}" = "ubi8" ]; then \ + yum install -y \ + glibc-langpack-en \ + && \ + /opt/docker/bin/yum_clean_all; \ + fi + # Remove preinclude system compilers RUN rpm -e --nodeps --verbose gcc gcc-c++ diff --git a/linux-anvil-ppc64le-cuda/Dockerfile b/linux-anvil-ppc64le-cuda/Dockerfile deleted file mode 100644 index fac24d78..00000000 --- a/linux-anvil-ppc64le-cuda/Dockerfile +++ /dev/null @@ -1,89 +0,0 @@ -# Set environment variables during runtime. -ARG CUDA_VER -ARG DISTRO_NAME -ARG DISTRO_VER -FROM --platform=linux/ppc64le nvidia/cuda:${CUDA_VER}-devel-${DISTRO_NAME}${DISTRO_VER} - -LABEL maintainer="conda-forge " - -# Set `ARG`s during runtime. -ARG CUDA_VER -ARG DISTRO_NAME -ARG DISTRO_VER -ENV CUDA_VER=${CUDA_VER} \ - DISTRO_NAME=${DISTRO_NAME} \ - DISTRO_VER=${DISTRO_VER} - -# Set an encoding to make things work smoothly. -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US.UTF-8 - -# Set path to CUDA install (this is a symlink to /usr/local/cuda-${CUDA_VER}) -ENV CUDA_HOME /usr/local/cuda - -# bust the docker cache so that we always rerun the installs below -ADD https://loripsum.net/api /opt/docker/etc/gibberish - -# Add qemu in here so that we can use this image on regular linux hosts with qemu user installed -ADD qemu-ppc64le-static /usr/bin/qemu-ppc64le-static - -# we want to persist a path in ldconfig (to avoid having to always set LD_LIBRARY_PATH), but *after* the existing entries; -# since entries in ld.so.conf.d have precedence before the preconfigured directories, we first add the latter to the former -# the upstream images all have libcuda.so under $CUDA_HOME/compat; -# add this to the ldconfig so it will be found correctly. -# don't forget to update settings by running ldconfig -RUN ldconfig -v 2>/dev/null | grep -v ^$'\t' | cut -f1 -d":" >> /etc/ld.so.conf.d/cuda-$CUDA_VER.conf && \ - echo "$CUDA_HOME/compat" >> /etc/ld.so.conf.d/cuda-$CUDA_VER.conf && \ - ldconfig - -# Fix RPM imports -ADD scripts/fix_rpm /opt/docker/bin/fix_rpm -RUN /opt/docker/bin/fix_rpm - -# Add custom `yum_clean_all` script before using `yum` -COPY scripts/yum_clean_all /opt/docker/bin/ - -# Install basic requirements. -RUN yum update -y --disablerepo=cuda && \ - yum install -y \ - bzip2 \ - sudo \ - tar \ - which \ - && \ - /opt/docker/bin/yum_clean_all - -# Fix locale in UBI 8 images -# See https://github.com/CentOS/sig-cloud-instance-images/issues/154 -RUN yum install -y glibc-langpack-en && \ - /opt/docker/bin/yum_clean_all - -# Remove preinclude system compilers -RUN rpm -e --nodeps --verbose gcc gcc-c++ - -# Run common commands -COPY scripts/run_commands /opt/docker/bin/run_commands -RUN /opt/docker/bin/run_commands - -# Download and cache CUDA related packages. -RUN source /opt/conda/etc/profile.d/conda.sh && \ - conda activate && \ - conda create -n test --yes --quiet --download-only \ - conda-forge::cudatoolkit=${CUDA_VER} \ - && \ - conda remove --yes --quiet -n test --all && \ - conda clean -tiy && \ - chgrp -R lucky /opt/conda && \ - chmod -R g=u /opt/conda - -# Add a file for users to source to activate the `conda` -# environment `base`. Also add a file that wraps that for -# use with the `ENTRYPOINT`. -COPY linux-anvil-ppc64le-cuda/entrypoint_source /opt/docker/bin/entrypoint_source -COPY scripts/entrypoint /opt/docker/bin/entrypoint - -# Ensure that all containers start with tini and the user selected process. -# Activate the `conda` environment `base`. -# Provide a default command (`bash`), which will start if the user doesn't specify one. -ENTRYPOINT [ "/opt/conda/bin/tini", "--", "/opt/docker/bin/entrypoint" ] -CMD [ "/bin/bash" ] diff --git a/linux-anvil-ppc64le-cuda/entrypoint_source b/linux-anvil-ppc64le-cuda/entrypoint_source deleted file mode 100644 index 55d440c2..00000000 --- a/linux-anvil-ppc64le-cuda/entrypoint_source +++ /dev/null @@ -1,5 +0,0 @@ -# Add `CUDA_HOME` binaries to `PATH`. -export PATH="${PATH}:${CUDA_HOME}/bin" - -# Activate the `base` conda environment. -conda activate base From 986107bcd0798ef13f943298984d463f9b4a70f2 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 17:10:21 -0700 Subject: [PATCH 21/22] Drop extraneous `$` --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4f54fabd..d53e5c1e 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ docker build --rm --build-arg DISTRO_NAME=centos --build-arg DISTRO_VER=6 --buil ## Environment variables -* `$CUDA_VER`: This is the cuda & cudatoolkit version that will be used. The +* `CUDA_VER`: This is the cuda & cudatoolkit version that will be used. The value of this variable should be in major-minor-patch format, e.g. `11.8.0`. * `DISTRO_NAME`: This is the Linux distro image name that should be built with. Should match the upstream Docker image, e.g. `centos`. From 5ffec6ed1a3d1e3fa552daccfac76c7570b1dbb4 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 1 Jul 2024 17:11:30 -0700 Subject: [PATCH 22/22] Document `DISTRO_ARCH` --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d53e5c1e..36bd8901 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,8 @@ docker build --rm --build-arg DISTRO_NAME=centos --build-arg DISTRO_VER=6 --buil * `CUDA_VER`: This is the cuda & cudatoolkit version that will be used. The value of this variable should be in major-minor-patch format, e.g. `11.8.0`. +* `DISTRO_ARCH`: This is the Linux architecture that the image should use. + Should match the upstream Docker image, e.g. `amd64`. * `DISTRO_NAME`: This is the Linux distro image name that should be built with. Should match the upstream Docker image, e.g. `centos`. * `DISTRO_VER`: This is version of Linux distro (typical CentOS) that the image