Skip to content

Commit 6440f63

Browse files
committed
Revert "RHAIENG-2042: chore(Dockerfile.*): enable DNF cache mount for improved build efficiency in all Dockerfiles (opendatahub-io#2697)"
We're not ready. This reverts commit 4e6f48f
1 parent d164e58 commit 6440f63

File tree

41 files changed

+404
-259
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+404
-259
lines changed

base-images/cpu/c9s-python-3.12/Dockerfile.cpu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ COPY --from=buildscripts /mnt/usr/bin/ /usr/bin/
6060

6161
RUN \
6262
--mount=from=buildscripts,source=/mnt,target=/mnt \
63-
--mount=type=cache,sharing=locked,id=notebooks-dnf,target=/var/cache/dnf \
63+
--mount=type=cache,sharing=locked,id=dnf-c9s,target=/var/cache/dnf \
6464
/bin/bash <<'EOF'
6565
set -Eeuxo pipefail
6666
/mnt/aipcc.sh

base-images/cpu/ubi9-python-3.12/Dockerfile.cpu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ USER 0
1212

1313
RUN \
1414
--mount=from=buildscripts,source=/mnt,target=/mnt \
15-
--mount=type=cache,sharing=locked,id=notebooks-dnf,target=/var/cache/dnf \
15+
--mount=type=cache,sharing=locked,id=dnf-ubi9,target=/var/cache/dnf \
1616
/bin/bash <<'EOF'
1717
/mnt/aipcc.sh
1818
EOF

base-images/cuda/12.6/c9s-python-3.11/Dockerfile.cuda

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ RUN NVIDIA_GPGKEY_SUM=d0664fbbdb8c32356d45de36c5984617217b2d0bef41b93ccecd326ba3
3939
ENV CUDA_VERSION=12.6.3
4040

4141
# For libraries in the cuda-compat-* package: https://docs.nvidia.com/cuda/eula/index.html#attachment-a
42-
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf upgrade -y --setopt=keepcache=1 && dnf install -y --setopt=keepcache=1 \
42+
RUN dnf upgrade -y && dnf install -y \
4343
cuda-cudart-12-6-${NV_CUDA_CUDART_VERSION} \
44-
cuda-compat-12-6
44+
cuda-compat-12-6 \
45+
&& dnf clean all \
46+
&& rm -rf /var/cache/yum/*
4547

4648
# nvidia-docker 1.0
4749
RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \
@@ -67,17 +69,21 @@ ENV NV_LIBNCCL_VERSION=2.23.4
6769
ENV NCCL_VERSION=2.23.4
6870
ENV NV_LIBNCCL_PACKAGE=${NV_LIBNCCL_PACKAGE_NAME}-${NV_LIBNCCL_PACKAGE_VERSION}+cuda12.6
6971

70-
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf install -y --setopt=keepcache=1 \
72+
RUN dnf install -y \
7173
cuda-libraries-12-6-${NV_CUDA_LIB_VERSION} \
7274
cuda-nvtx-12-6-${NV_NVTX_VERSION} \
7375
${NV_LIBNPP_PACKAGE} \
7476
libcublas-12-6-${NV_LIBCUBLAS_VERSION} \
75-
${NV_LIBNCCL_PACKAGE}
77+
${NV_LIBNCCL_PACKAGE} \
78+
&& dnf clean all \
79+
&& rm -rf /var/cache/yum/*
7680

7781
# Install devel tools
78-
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf install -y --setopt=keepcache=1 \
82+
RUN dnf install -y \
7983
make \
80-
findutils
84+
findutils \
85+
&& dnf clean all \
86+
&& rm -rf /var/cache/yum/*
8187

8288
# Install CUDA cudnn9 from:
8389
# https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/12.6.3/ubi9/runtime/cudnn/Dockerfile
@@ -86,14 +92,17 @@ ENV NV_CUDNN_PACKAGE=libcudnn9-cuda-12-${NV_CUDNN_VERSION}
8692

8793
LABEL com.nvidia.cudnn.version="${NV_CUDNN_VERSION}"
8894

89-
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf install -y --setopt=keepcache=1 \
90-
${NV_CUDNN_PACKAGE}
95+
RUN dnf install -y \
96+
${NV_CUDNN_PACKAGE} \
97+
&& dnf clean all \
98+
&& rm -rf /var/cache/yum/*
9199

92100
# Set this flag so that libraries can find the location of CUDA
93101
ENV XLA_FLAGS=--xla_gpu_cuda_data_dir=/usr/local/cuda
94102

95103
# Install CUDA toolkit 12.6
96-
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf -y install --setopt=keepcache=1 cuda-toolkit-12-6
104+
RUN dnf -y install cuda-toolkit-12-6 && \
105+
dnf -y clean all --enablerepo="*"
97106

98107
# Restore user workspace
99108
USER 1001

base-images/cuda/12.6/c9s-python-3.12/Dockerfile.cuda

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ RUN NVIDIA_GPGKEY_SUM=d0664fbbdb8c32356d45de36c5984617217b2d0bef41b93ccecd326ba3
3939
ENV CUDA_VERSION=12.6.3
4040

4141
# For libraries in the cuda-compat-* package: https://docs.nvidia.com/cuda/eula/index.html#attachment-a
42-
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf upgrade -y --setopt=keepcache=1 && dnf install -y --setopt=keepcache=1 \
42+
RUN dnf upgrade -y && dnf install -y \
4343
cuda-cudart-12-6-${NV_CUDA_CUDART_VERSION} \
44-
cuda-compat-12-6
44+
cuda-compat-12-6 \
45+
&& dnf clean all \
46+
&& rm -rf /var/cache/yum/*
4547

4648
# nvidia-docker 1.0
4749
RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \
@@ -67,17 +69,21 @@ ENV NV_LIBNCCL_VERSION=2.23.4
6769
ENV NCCL_VERSION=2.23.4
6870
ENV NV_LIBNCCL_PACKAGE=${NV_LIBNCCL_PACKAGE_NAME}-${NV_LIBNCCL_PACKAGE_VERSION}+cuda12.6
6971

70-
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf install -y --setopt=keepcache=1 \
72+
RUN dnf install -y \
7173
cuda-libraries-12-6-${NV_CUDA_LIB_VERSION} \
7274
cuda-nvtx-12-6-${NV_NVTX_VERSION} \
7375
${NV_LIBNPP_PACKAGE} \
7476
libcublas-12-6-${NV_LIBCUBLAS_VERSION} \
75-
${NV_LIBNCCL_PACKAGE}
77+
${NV_LIBNCCL_PACKAGE} \
78+
&& dnf clean all \
79+
&& rm -rf /var/cache/yum/*
7680

7781
# Install devel tools
78-
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf install -y --setopt=keepcache=1 \
82+
RUN dnf install -y \
7983
make \
80-
findutils
84+
findutils \
85+
&& dnf clean all \
86+
&& rm -rf /var/cache/yum/*
8187

8288
# Install CUDA cudnn9 from:
8389
# https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/12.6.3/ubi9/runtime/cudnn/Dockerfile
@@ -86,14 +92,17 @@ ENV NV_CUDNN_PACKAGE=libcudnn9-cuda-12-${NV_CUDNN_VERSION}
8692

8793
LABEL com.nvidia.cudnn.version="${NV_CUDNN_VERSION}"
8894

89-
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf install -y --setopt=keepcache=1 \
90-
${NV_CUDNN_PACKAGE}
95+
RUN dnf install -y \
96+
${NV_CUDNN_PACKAGE} \
97+
&& dnf clean all \
98+
&& rm -rf /var/cache/yum/*
9199

92100
# Set this flag so that libraries can find the location of CUDA
93101
ENV XLA_FLAGS=--xla_gpu_cuda_data_dir=/usr/local/cuda
94102

95103
# Install CUDA toolkit 12.6
96-
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf -y install --setopt=keepcache=1 cuda-toolkit-12-6
104+
RUN dnf -y install cuda-toolkit-12-6 && \
105+
dnf -y clean all --enablerepo="*"
97106

98107
# Restore user workspace
99108
USER 1001

base-images/cuda/12.6/ubi9-python-3.12/Dockerfile.cuda

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ RUN NVIDIA_GPGKEY_SUM=d0664fbbdb8c32356d45de36c5984617217b2d0bef41b93ccecd326ba3
3939
ENV CUDA_VERSION=12.6.3
4040

4141
# For libraries in the cuda-compat-* package: https://docs.nvidia.com/cuda/eula/index.html#attachment-a
42-
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf upgrade -y --setopt=keepcache=1 && dnf install -y --setopt=keepcache=1 \
42+
RUN dnf upgrade -y && dnf install -y \
4343
cuda-cudart-12-6-${NV_CUDA_CUDART_VERSION} \
44-
cuda-compat-12-6
44+
cuda-compat-12-6 \
45+
&& dnf clean all \
46+
&& rm -rf /var/cache/yum/*
4547

4648
# nvidia-docker 1.0
4749
RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \
@@ -67,17 +69,21 @@ ENV NV_LIBNCCL_VERSION=2.23.4
6769
ENV NCCL_VERSION=2.23.4
6870
ENV NV_LIBNCCL_PACKAGE=${NV_LIBNCCL_PACKAGE_NAME}-${NV_LIBNCCL_PACKAGE_VERSION}+cuda12.6
6971

70-
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf install -y --setopt=keepcache=1 \
72+
RUN dnf install -y \
7173
cuda-libraries-12-6-${NV_CUDA_LIB_VERSION} \
7274
cuda-nvtx-12-6-${NV_NVTX_VERSION} \
7375
${NV_LIBNPP_PACKAGE} \
7476
libcublas-12-6-${NV_LIBCUBLAS_VERSION} \
75-
${NV_LIBNCCL_PACKAGE}
77+
${NV_LIBNCCL_PACKAGE} \
78+
&& dnf clean all \
79+
&& rm -rf /var/cache/yum/*
7680

7781
# Install devel tools
78-
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf install -y --setopt=keepcache=1 \
82+
RUN dnf install -y \
7983
make \
80-
findutils
84+
findutils \
85+
&& dnf clean all \
86+
&& rm -rf /var/cache/yum/*
8187

8288
# Install CUDA cudnn9 from:
8389
# https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/12.6.3/ubi9/runtime/cudnn/Dockerfile
@@ -86,8 +92,10 @@ ENV NV_CUDNN_PACKAGE=libcudnn9-cuda-12-${NV_CUDNN_VERSION}
8692

8793
LABEL com.nvidia.cudnn.version="${NV_CUDNN_VERSION}"
8894

89-
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf install -y --setopt=keepcache=1 \
90-
${NV_CUDNN_PACKAGE}
95+
RUN dnf install -y \
96+
${NV_CUDNN_PACKAGE} \
97+
&& dnf clean all \
98+
&& rm -rf /var/cache/yum/*
9199

92100
# Set this flag so that libraries can find the location of CUDA
93101
ENV XLA_FLAGS=--xla_gpu_cuda_data_dir=/usr/local/cuda

base-images/cuda/12.8/c9s-python-3.12/Dockerfile.cuda

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ RUN NVIDIA_GPGKEY_SUM=d0664fbbdb8c32356d45de36c5984617217b2d0bef41b93ccecd326ba3
3939
ENV CUDA_VERSION=12.8.1
4040

4141
# For libraries in the cuda-compat-* package: https://docs.nvidia.com/cuda/eula/index.html#attachment-a
42-
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf upgrade -y --setopt=keepcache=1 && dnf install -y --setopt=keepcache=1 \
42+
RUN dnf upgrade -y && dnf install -y \
4343
cuda-cudart-12-8-${NV_CUDA_CUDART_VERSION} \
44-
cuda-compat-12-8
44+
cuda-compat-12-8 \
45+
&& dnf clean all \
46+
&& rm -rf /var/cache/yum/*
4547

4648
# nvidia-docker 1.0
4749
RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \
@@ -67,17 +69,21 @@ ENV NV_LIBNCCL_VERSION=2.25.1
6769
ENV NCCL_VERSION=2.25.1
6870
ENV NV_LIBNCCL_PACKAGE=${NV_LIBNCCL_PACKAGE_NAME}-${NV_LIBNCCL_PACKAGE_VERSION}+cuda12.8
6971

70-
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf install -y --setopt=keepcache=1 \
72+
RUN dnf install -y \
7173
cuda-libraries-12-8-${NV_CUDA_LIB_VERSION} \
7274
cuda-nvtx-12-8-${NV_NVTX_VERSION} \
7375
${NV_LIBNPP_PACKAGE} \
7476
libcublas-12-8-${NV_LIBCUBLAS_VERSION} \
75-
${NV_LIBNCCL_PACKAGE}
77+
${NV_LIBNCCL_PACKAGE} \
78+
&& dnf clean all \
79+
&& rm -rf /var/cache/yum/*
7680

7781
# Install devel tools
78-
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf install -y --setopt=keepcache=1 \
82+
RUN dnf install -y \
7983
make \
80-
findutils
84+
findutils \
85+
&& dnf clean all \
86+
&& rm -rf /var/cache/yum/*
8187

8288
# Install CUDA cudnn9 from:
8389
# https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/12.8.1/ubi9/runtime/cudnn/Dockerfile
@@ -86,14 +92,17 @@ ENV NV_CUDNN_PACKAGE libcudnn9-cuda-12-${NV_CUDNN_VERSION}
8692

8793
LABEL com.nvidia.cudnn.version="${NV_CUDNN_VERSION}"
8894

89-
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf install -y --setopt=keepcache=1 \
90-
${NV_CUDNN_PACKAGE}
95+
RUN dnf install -y \
96+
${NV_CUDNN_PACKAGE} \
97+
&& dnf clean all \
98+
&& rm -rf /var/cache/yum/*
9199

92100
# Set this flag so that libraries can find the location of CUDA
93101
ENV XLA_FLAGS=--xla_gpu_cuda_data_dir=/usr/local/cuda
94102

95103
# Install CUDA toolkit 12.8
96-
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf -y install --setopt=keepcache=1 cuda-toolkit-12-8
104+
RUN dnf -y install cuda-toolkit-12-8 && \
105+
dnf -y clean all --enablerepo="*"
97106

98107
# Restore user workspace
99108
USER 1001

base-images/cuda/12.8/ubi9-python-3.12/Dockerfile.cuda

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ RUN NVIDIA_GPGKEY_SUM=d0664fbbdb8c32356d45de36c5984617217b2d0bef41b93ccecd326ba3
3939
ENV CUDA_VERSION=12.8.1
4040

4141
# For libraries in the cuda-compat-* package: https://docs.nvidia.com/cuda/eula/index.html#attachment-a
42-
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf upgrade -y --setopt=keepcache=1 && dnf install -y --setopt=keepcache=1 \
42+
RUN dnf upgrade -y && dnf install -y \
4343
cuda-cudart-12-8-${NV_CUDA_CUDART_VERSION} \
44-
cuda-compat-12-8
44+
cuda-compat-12-8 \
45+
&& dnf clean all \
46+
&& rm -rf /var/cache/yum/*
4547

4648
# nvidia-docker 1.0
4749
RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \
@@ -67,17 +69,21 @@ ENV NV_LIBNCCL_VERSION=2.25.1
6769
ENV NCCL_VERSION=2.25.1
6870
ENV NV_LIBNCCL_PACKAGE=${NV_LIBNCCL_PACKAGE_NAME}-${NV_LIBNCCL_PACKAGE_VERSION}+cuda12.8
6971

70-
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf install -y --setopt=keepcache=1 \
72+
RUN dnf install -y \
7173
cuda-libraries-12-8-${NV_CUDA_LIB_VERSION} \
7274
cuda-nvtx-12-8-${NV_NVTX_VERSION} \
7375
${NV_LIBNPP_PACKAGE} \
7476
libcublas-12-8-${NV_LIBCUBLAS_VERSION} \
75-
${NV_LIBNCCL_PACKAGE}
77+
${NV_LIBNCCL_PACKAGE} \
78+
&& dnf clean all \
79+
&& rm -rf /var/cache/yum/*
7680

7781
# Install devel tools
78-
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf install -y --setopt=keepcache=1 \
82+
RUN dnf install -y \
7983
make \
80-
findutils
84+
findutils \
85+
&& dnf clean all \
86+
&& rm -rf /var/cache/yum/*
8187

8288
# Install CUDA cudnn9 from:
8389
# https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/12.8.1/ubi9/runtime/cudnn/Dockerfile
@@ -86,8 +92,10 @@ ENV NV_CUDNN_PACKAGE libcudnn9-cuda-12-${NV_CUDNN_VERSION}
8692

8793
LABEL com.nvidia.cudnn.version="${NV_CUDNN_VERSION}"
8894

89-
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf install -y --setopt=keepcache=1 \
90-
${NV_CUDNN_PACKAGE}
95+
RUN dnf install -y \
96+
${NV_CUDNN_PACKAGE} \
97+
&& dnf clean all \
98+
&& rm -rf /var/cache/yum/*
9199

92100
# Set this flag so that libraries can find the location of CUDA
93101
ENV XLA_FLAGS=--xla_gpu_cuda_data_dir=/usr/local/cuda

base-images/rocm/6.2/c9s-python-3.12/Dockerfile.rocm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ARG AMDGPU_VERSION=6.2.4
2222
# Note: Based on 6.2 above new package mivisionx is a pre-requistes, which bring in more dependent packages
2323
# so we are only installing meta packages of rocm
2424
# ref: https://rocm.docs.amd.com/projects/install-on-linux/en/develop/reference/package-manager-integration.html#packages-in-rocm-programming-models
25-
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf echo "[ROCm]" > /etc/yum.repos.d/rocm.repo && \
25+
RUN echo "[ROCm]" > /etc/yum.repos.d/rocm.repo && \
2626
echo "name=ROCm" >> /etc/yum.repos.d/rocm.repo && \
2727
echo "baseurl=https://repo.radeon.com/rocm/rhel9/$ROCM_VERSION/main" >> /etc/yum.repos.d/rocm.repo && \
2828
echo "enabled=1" >> /etc/yum.repos.d/rocm.repo && \
@@ -32,15 +32,16 @@ RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf ech
3232
echo "baseurl=https://repo.radeon.com/amdgpu/$AMDGPU_VERSION/rhel/9.4/main/x86_64" >> /etc/yum.repos.d/amdgpu.repo && \
3333
echo "enabled=1" >> /etc/yum.repos.d/amdgpu.repo && \
3434
echo "gpgcheck=0" >> /etc/yum.repos.d/amdgpu.repo && \
35-
dnf install -y --setopt=keepcache=1 \
35+
dnf install -y \
3636
rocm-core hip-runtime-amd \
3737
# system utilities
3838
rocm-smi-lib rocminfo \
3939
rocblas rocsolver rocfft rocrand rocsparse miopen-hip rccl \
4040
# HIP (Heterogeneous-compute Interface for Portability)
4141
hipblas hipblaslt hipfft hipsparse hiprand hipsolver \
4242
# suitesparse's /lib64/libspqr.so.2.0.9 needs libtbb.so.2
43-
tbb
43+
tbb && \
44+
dnf clean all && rm -rf /var/cache/yum
4445

4546
# https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/post-install.html#configure-rocm-shared-objects
4647
RUN tee --append /etc/ld.so.conf.d/rocm.conf <<EOF

base-images/rocm/6.2/ubi9-python-3.12/Dockerfile.rocm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ARG AMDGPU_VERSION=6.2.4
2222
# Note: Based on 6.2 above new package mivisionx is a pre-requistes, which bring in more dependent packages
2323
# so we are only installing meta packages of rocm
2424
# ref: https://rocm.docs.amd.com/projects/install-on-linux/en/develop/reference/package-manager-integration.html#packages-in-rocm-programming-models
25-
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf echo "[ROCm]" > /etc/yum.repos.d/rocm.repo && \
25+
RUN echo "[ROCm]" > /etc/yum.repos.d/rocm.repo && \
2626
echo "name=ROCm" >> /etc/yum.repos.d/rocm.repo && \
2727
echo "baseurl=https://repo.radeon.com/rocm/rhel9/$ROCM_VERSION/main" >> /etc/yum.repos.d/rocm.repo && \
2828
echo "enabled=1" >> /etc/yum.repos.d/rocm.repo && \
@@ -32,15 +32,16 @@ RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf ech
3232
echo "baseurl=https://repo.radeon.com/amdgpu/$AMDGPU_VERSION/rhel/9.4/main/x86_64" >> /etc/yum.repos.d/amdgpu.repo && \
3333
echo "enabled=1" >> /etc/yum.repos.d/amdgpu.repo && \
3434
echo "gpgcheck=0" >> /etc/yum.repos.d/amdgpu.repo && \
35-
dnf install -y --setopt=keepcache=1 \
35+
dnf install -y \
3636
rocm-core hip-runtime-amd \
3737
# system utilities
3838
rocm-smi-lib rocminfo \
3939
rocblas rocsolver rocfft rocrand rocsparse miopen-hip rccl \
4040
# HIP (Heterogeneous-compute Interface for Portability)
4141
hipblas hipblaslt hipfft hipsparse hiprand hipsolver \
4242
# suitesparse's /lib64/libspqr.so.2.0.9 needs libtbb.so.2
43-
tbb
43+
tbb && \
44+
dnf clean all && rm -rf /var/cache/yum
4445

4546
# https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/post-install.html#configure-rocm-shared-objects
4647
RUN tee --append /etc/ld.so.conf.d/rocm.conf <<EOF

base-images/rocm/6.3/c9s-python-3.12/Dockerfile.rocm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ARG AMDGPU_VERSION=6.3.4
2222
# Note: Based on 6.4 above new package mivisionx is a pre-requistes, which bring in more dependent packages
2323
# so we are only installing meta packages of rocm
2424
# ref: https://rocm.docs.amd.com/projects/install-on-linux/en/develop/reference/package-manager-integration.html#packages-in-rocm-programming-models
25-
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf echo "[ROCm]" > /etc/yum.repos.d/rocm.repo && \
25+
RUN echo "[ROCm]" > /etc/yum.repos.d/rocm.repo && \
2626
echo "name=ROCm" >> /etc/yum.repos.d/rocm.repo && \
2727
echo "baseurl=https://repo.radeon.com/rocm/rhel9/$ROCM_VERSION/main" >> /etc/yum.repos.d/rocm.repo && \
2828
echo "enabled=1" >> /etc/yum.repos.d/rocm.repo && \
@@ -32,15 +32,16 @@ RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf ech
3232
echo "baseurl=https://repo.radeon.com/amdgpu/$AMDGPU_VERSION/rhel/9.4/main/x86_64" >> /etc/yum.repos.d/amdgpu.repo && \
3333
echo "enabled=1" >> /etc/yum.repos.d/amdgpu.repo && \
3434
echo "gpgcheck=0" >> /etc/yum.repos.d/amdgpu.repo && \
35-
dnf install -y --setopt=keepcache=1 \
35+
dnf install -y \
3636
rocm-core hip-runtime-amd \
3737
# system utilities
3838
rocm-smi-lib rocminfo \
3939
rocblas rocsolver rocfft rocrand rocsparse miopen-hip rccl \
4040
# HIP (Heterogeneous-compute Interface for Portability)
4141
hipblas hipblaslt hipfft hipsparse hiprand hipsolver \
4242
# suitesparse's /lib64/libspqr.so.2.0.9 needs libtbb.so.2
43-
tbb
43+
tbb && \
44+
dnf clean all && rm -rf /var/cache/yum
4445

4546
# https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/post-install.html#configure-rocm-shared-objects
4647
RUN tee --append /etc/ld.so.conf.d/rocm.conf <<EOF

0 commit comments

Comments
 (0)