Skip to content

Commit 7a7cce3

Browse files
atheo89jiridanek
authored andcommitted
RHAIENG-332: (feat): align the Dockerfiles for llmcompressor with the other current cuda Dockerfiles (opendatahub-io#1972)
1 parent 2db06b2 commit 7a7cce3

File tree

2 files changed

+86
-80
lines changed

2 files changed

+86
-80
lines changed

jupyter/pytorch+llmcompressor/ubi9-python-3.12/Dockerfile.cuda

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ RUN dnf install -y mesa-libGL skopeo && dnf clean all && rm -rf /var/cache/yum
3232
# Other apps and tools installed as default user
3333
USER 1001
3434

35-
# Install micropipenv to deploy packages from Pipfile.lock
36-
RUN pip install --no-cache-dir -U "micropipenv[toml]"
35+
# Install micropipenv and uv to deploy packages from requirements.txt begin
36+
RUN pip install --no-cache-dir -U "micropipenv[toml]==1.9.0" "uv==0.8.12"
37+
# Install micropipenv and uv to deploy packages from requirements.txt end
3738

3839
# Install the oc client begin
3940
RUN curl -L https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/ocp/stable/openshift-client-linux.tar.gz \
@@ -45,7 +46,16 @@ RUN curl -L https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/oc
4546
####################
4647
# cuda-base #
4748
####################
48-
FROM base AS cuda-base
49+
FROM base AS cuda-base-amd64
50+
ENV NVARCH=x86_64
51+
# cuda-nvprof only gets installed on amd64 currently
52+
ENV NV_NVPROF_VERSION=12.6.80-1
53+
ENV NV_NVPROF_DEV_PACKAGE=cuda-nvprof-12-6-${NV_NVPROF_VERSION}
54+
55+
FROM base AS cuda-base-arm64
56+
ENV NVARCH=sbsa
57+
58+
FROM cuda-base-${TARGETARCH} AS cuda-base
4959

5060
ARG TARGETARCH
5161

@@ -56,9 +66,8 @@ ARG CUDA_SOURCE_CODE=cuda
5666
USER 0
5767
WORKDIR /opt/app-root/bin
5868

59-
ENV NVARCH=x86_64
60-
ENV NVIDIA_REQUIRE_CUDA "cuda>=12.4 brand=tesla,driver>=470,driver<471 brand=unknown,driver>=470,driver<471 brand=nvidia,driver>=470,driver<471 brand=nvidiartx,driver>=470,driver<471 brand=geforce,driver>=470,driver<471 brand=geforcertx,driver>=470,driver<471 brand=quadro,driver>=470,driver<471 brand=quadrortx,driver>=470,driver<471 brand=titan,driver>=470,driver<471 brand=titanrtx,driver>=470,driver<471 brand=tesla,driver>=525,driver<526 brand=unknown,driver>=525,driver<526 brand=nvidia,driver>=525,driver<526 brand=nvidiartx,driver>=525,driver<526 brand=geforce,driver>=525,driver<526 brand=geforcertx,driver>=525,driver<526 brand=quadro,driver>=525,driver<526 brand=quadrortx,driver>=525,driver<526 brand=titan,driver>=525,driver<526 brand=titanrtx,driver>=525,driver<526 brand=tesla,driver>=535,driver<536 brand=unknown,driver>=535,driver<536 brand=nvidia,driver>=535,driver<536 brand=nvidiartx,driver>=535,driver<536 brand=geforce,driver>=535,driver<536 brand=geforcertx,driver>=535,driver<536 brand=quadro,driver>=535,driver<536 brand=quadrortx,driver>=535,driver<536 brand=titan,driver>=535,driver<536 brand=titanrtx,driver>=535,driver<536"
61-
ENV NV_CUDA_CUDART_VERSION 12.4.127-1
69+
ENV NVIDIA_REQUIRE_CUDA="cuda>=12.6 brand=unknown,driver>=470,driver<471 brand=grid,driver>=470,driver<471 brand=tesla,driver>=470,driver<471 brand=nvidia,driver>=470,driver<471 brand=quadro,driver>=470,driver<471 brand=quadrortx,driver>=470,driver<471 brand=nvidiartx,driver>=470,driver<471 brand=vapps,driver>=470,driver<471 brand=vpc,driver>=470,driver<471 brand=vcs,driver>=470,driver<471 brand=vws,driver>=470,driver<471 brand=cloudgaming,driver>=470,driver<471 brand=unknown,driver>=535,driver<536 brand=grid,driver>=535,driver<536 brand=tesla,driver>=535,driver<536 brand=nvidia,driver>=535,driver<536 brand=quadro,driver>=535,driver<536 brand=quadrortx,driver>=535,driver<536 brand=nvidiartx,driver>=535,driver<536 brand=vapps,driver>=535,driver<536 brand=vpc,driver>=535,driver<536 brand=vcs,driver>=535,driver<536 brand=vws,driver>=535,driver<536 brand=cloudgaming,driver>=535,driver<536 brand=unknown,driver>=550,driver<551 brand=grid,driver>=550,driver<551 brand=tesla,driver>=550,driver<551 brand=nvidia,driver>=550,driver<551 brand=quadro,driver>=550,driver<551 brand=quadrortx,driver>=550,driver<551 brand=nvidiartx,driver>=550,driver<551 brand=vapps,driver>=550,driver<551 brand=vpc,driver>=550,driver<551 brand=vcs,driver>=550,driver<551 brand=vws,driver>=550,driver<551 brand=cloudgaming,driver>=550,driver<551"
70+
ENV NV_CUDA_CUDART_VERSION=12.6.77-1
6271

6372
COPY ${CUDA_SOURCE_CODE}/cuda.repo-${TARGETARCH} /etc/yum.repos.d/cuda.repo
6473
COPY ${CUDA_SOURCE_CODE}/NGC-DL-CONTAINER-LICENSE /
@@ -67,12 +76,12 @@ RUN NVIDIA_GPGKEY_SUM=d0664fbbdb8c32356d45de36c5984617217b2d0bef41b93ccecd326ba3
6776
curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/rhel9/${NVARCH}/D42D0685.pub | sed '/^Version/d' > /etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA && \
6877
echo "$NVIDIA_GPGKEY_SUM /etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA" | sha256sum -c --strict -
6978

70-
ENV CUDA_VERSION 12.4.1
79+
ENV CUDA_VERSION=12.6.3
7180

7281
# For libraries in the cuda-compat-* package: https://docs.nvidia.com/cuda/eula/index.html#attachment-a
7382
RUN yum upgrade -y && yum install -y \
74-
cuda-cudart-12-4-${NV_CUDA_CUDART_VERSION} \
75-
cuda-compat-12-4 \
83+
cuda-cudart-12-6-${NV_CUDA_CUDART_VERSION} \
84+
cuda-compat-12-6 \
7685
&& yum clean all \
7786
&& rm -rf /var/cache/yum/*
7887

@@ -89,22 +98,22 @@ ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility
8998

9099
# Install CUDA runtime from:
91100
# https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/12.6.3/ubi9/runtime/Dockerfile
92-
ENV NV_CUDA_LIB_VERSION 12.4.1-1
93-
ENV NV_NVTX_VERSION 12.4.127-1
94-
ENV NV_LIBNPP_VERSION 12.2.5.30-1
95-
ENV NV_LIBNPP_PACKAGE libnpp-12-4-${NV_LIBNPP_VERSION}
96-
ENV NV_LIBCUBLAS_VERSION 12.4.5.8-1
97-
ENV NV_LIBNCCL_PACKAGE_NAME libnccl
98-
ENV NV_LIBNCCL_PACKAGE_VERSION 2.21.5-1
99-
ENV NV_LIBNCCL_VERSION 2.21.5
100-
ENV NCCL_VERSION 2.21.5
101-
ENV NV_LIBNCCL_PACKAGE ${NV_LIBNCCL_PACKAGE_NAME}-${NV_LIBNCCL_PACKAGE_VERSION}+cuda12.4
101+
ENV NV_CUDA_LIB_VERSION=12.6.3-1
102+
ENV NV_NVTX_VERSION=12.6.77-1
103+
ENV NV_LIBNPP_VERSION=12.3.1.54-1
104+
ENV NV_LIBNPP_PACKAGE=libnpp-12-6-${NV_LIBNPP_VERSION}
105+
ENV NV_LIBCUBLAS_VERSION=12.6.4.1-1
106+
ENV NV_LIBNCCL_PACKAGE_NAME=libnccl
107+
ENV NV_LIBNCCL_PACKAGE_VERSION=2.23.4-1
108+
ENV NV_LIBNCCL_VERSION=2.23.4
109+
ENV NCCL_VERSION=2.23.4
110+
ENV NV_LIBNCCL_PACKAGE=${NV_LIBNCCL_PACKAGE_NAME}-${NV_LIBNCCL_PACKAGE_VERSION}+cuda12.6
102111

103112
RUN yum install -y \
104-
cuda-libraries-12-4-${NV_CUDA_LIB_VERSION} \
105-
cuda-nvtx-12-4-${NV_NVTX_VERSION} \
113+
cuda-libraries-12-6-${NV_CUDA_LIB_VERSION} \
114+
cuda-nvtx-12-6-${NV_NVTX_VERSION} \
106115
${NV_LIBNPP_PACKAGE} \
107-
libcublas-12-4-${NV_LIBCUBLAS_VERSION} \
116+
libcublas-12-6-${NV_LIBCUBLAS_VERSION} \
108117
${NV_LIBNCCL_PACKAGE} \
109118
&& yum clean all \
110119
&& rm -rf /var/cache/yum/*
@@ -206,30 +215,29 @@ ARG PYTORCH_SOURCE_CODE=jupyter/pytorch+llmcompressor/ubi9-python-3.12
206215

207216
WORKDIR /opt/app-root/bin
208217

209-
LABEL name="odh-notebook-jupyter-cuda-pytorch-ubi9-python-3.12" \
210-
summary="Jupyter CUDA pytorch notebook image for ODH notebooks" \
211-
description="Jupyter CUDA pytorch notebook image with base Python 3.12 builder image based on UBI9 for ODH notebooks" \
212-
io.k8s.display-name="Jupyter CUDA pytorch notebook image for ODH notebooks" \
213-
io.k8s.description="Jupyter CUDA pytorch notebook image with base Python 3.12 builder image based on UBI9 for ODH notebooks" \
218+
LABEL name="odh-notebook-jupyter-cuda-pytorch-llmcompressor-ubi9-python-3.12" \
219+
summary="Jupyter CUDA pytorch-llmcompressor notebook image for ODH notebooks" \
220+
description="Jupyter CUDA pytorch-llmcompressor notebook image with base Python 3.12 builder image based on UBI9 for ODH notebooks" \
221+
io.k8s.display-name="Jupyter CUDA pytorch-llmcompressor notebook image for ODH notebooks" \
222+
io.k8s.description="Jupyter CUDA pytorch-llmcompressor notebook image with base Python 3.12 builder image based on UBI9 for ODH notebooks" \
214223
authoritative-source-url="https://github.com/opendatahub-io/notebooks" \
215224
io.openshift.build.commit.ref="main" \
216-
io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/jupyter/pytorch/ubi9-python-3.12" \
217-
io.openshift.build.image="quay.io/opendatahub/workbench-images:cuda-jupyter-pytorch-ubi9-python-3.12"
225+
io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/jupyter/pytorch+llmcompressor/ubi9-python-3.12" \
226+
io.openshift.build.image="quay.io/opendatahub/workbench-images:cuda-jupyter-pytorch-llmcompressor-ubi9-python-3.12"
218227

219-
# Install Python packages and Jupyterlab extensions from Pipfile.lock
220-
COPY ${PYTORCH_SOURCE_CODE}/Pipfile.lock ./
228+
# Install Python packages and Jupyterlab extensions from requirements.txt
229+
COPY ${PYTORCH_SOURCE_CODE}/requirements.txt ./
221230

222231
RUN echo "Installing softwares and packages" && \
223-
micropipenv install --dev && \
224-
rm -f ./Pipfile.lock && \
232+
# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`,
233+
# we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common.
234+
uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./requirements.txt --build-constraints=./requirements.txt && \
225235
# setup path for runtime configuration
226236
mkdir /opt/app-root/runtimes && \
227237
# Remove default Elyra runtime-images \
228238
rm /opt/app-root/share/jupyter/metadata/runtime-images/*.json && \
229239
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y \
230240
sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json && \
231-
# copy jupyter configuration
232-
cp /opt/app-root/bin/utils/jupyter_server_config.py /opt/app-root/etc/jupyter && \
233241
# Disable announcement plugin of jupyterlab \
234242
jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \
235243
# Apply JupyterLab addons \
@@ -238,12 +246,4 @@ RUN echo "Installing softwares and packages" && \
238246
chmod -R g+w /opt/app-root/lib/python3.12/site-packages && \
239247
fix-permissions /opt/app-root -P
240248

241-
# Copy Elyra runtime-images definitions and set the version
242-
COPY ${DATASCIENCE_SOURCE_CODE}/runtime-images/ /opt/app-root/share/jupyter/metadata/runtime-images/
243-
COPY ${PYTORCH_SOURCE_CODE}/runtime-images/ /opt/app-root/share/jupyter/metadata/runtime-images/
244-
245249
WORKDIR /opt/app-root/src
246-
247-
# Install micropipenv and uv to deploy packages from requirements.txt begin
248-
RUN pip install --no-cache-dir -U "micropipenv[toml]==1.9.0" "uv==0.8.12"
249-
# Install micropipenv and uv to deploy packages from requirements.txt end

runtimes/pytorch+llmcompressor/ubi9-python-3.12/Dockerfile.cuda

Lines changed: 43 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ RUN dnf install -y mesa-libGL skopeo && dnf clean all && rm -rf /var/cache/yum
1919
# Other apps and tools installed as default user
2020
USER 1001
2121

22-
# Install micropipenv to deploy packages from Pipfile.lock
23-
RUN pip install --no-cache-dir -U "micropipenv[toml]"
22+
# Install micropipenv and uv to deploy packages from requirements.txt begin
23+
RUN pip install --no-cache-dir -U "micropipenv[toml]==1.9.0" "uv==0.8.12"
24+
# Install micropipenv and uv to deploy packages from requirements.txt end
2425

2526
# Install the oc client begin
2627
RUN curl -L https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/ocp/stable/openshift-client-linux.tar.gz \
@@ -32,7 +33,16 @@ RUN curl -L https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/oc
3233
####################
3334
# cuda-base #
3435
####################
35-
FROM base AS cuda-base
36+
FROM base AS cuda-base-amd64
37+
ENV NVARCH=x86_64
38+
# cuda-nvprof only gets installed on amd64 currently
39+
ENV NV_NVPROF_VERSION=12.6.80-1
40+
ENV NV_NVPROF_DEV_PACKAGE=cuda-nvprof-12-6-${NV_NVPROF_VERSION}
41+
42+
FROM base AS cuda-base-arm64
43+
ENV NVARCH=sbsa
44+
45+
FROM cuda-base-${TARGETARCH} AS cuda-base
3646

3747
ARG TARGETARCH
3848

@@ -43,9 +53,8 @@ ARG CUDA_SOURCE_CODE=cuda
4353
USER 0
4454
WORKDIR /opt/app-root/bin
4555

46-
ENV NVARCH=x86_64
47-
ENV NVIDIA_REQUIRE_CUDA "cuda>=12.4 brand=tesla,driver>=470,driver<471 brand=unknown,driver>=470,driver<471 brand=nvidia,driver>=470,driver<471 brand=nvidiartx,driver>=470,driver<471 brand=geforce,driver>=470,driver<471 brand=geforcertx,driver>=470,driver<471 brand=quadro,driver>=470,driver<471 brand=quadrortx,driver>=470,driver<471 brand=titan,driver>=470,driver<471 brand=titanrtx,driver>=470,driver<471 brand=tesla,driver>=525,driver<526 brand=unknown,driver>=525,driver<526 brand=nvidia,driver>=525,driver<526 brand=nvidiartx,driver>=525,driver<526 brand=geforce,driver>=525,driver<526 brand=geforcertx,driver>=525,driver<526 brand=quadro,driver>=525,driver<526 brand=quadrortx,driver>=525,driver<526 brand=titan,driver>=525,driver<526 brand=titanrtx,driver>=525,driver<526 brand=tesla,driver>=535,driver<536 brand=unknown,driver>=535,driver<536 brand=nvidia,driver>=535,driver<536 brand=nvidiartx,driver>=535,driver<536 brand=geforce,driver>=535,driver<536 brand=geforcertx,driver>=535,driver<536 brand=quadro,driver>=535,driver<536 brand=quadrortx,driver>=535,driver<536 brand=titan,driver>=535,driver<536 brand=titanrtx,driver>=535,driver<536"
48-
ENV NV_CUDA_CUDART_VERSION 12.4.127-1
56+
ENV NVIDIA_REQUIRE_CUDA="cuda>=12.6 brand=unknown,driver>=470,driver<471 brand=grid,driver>=470,driver<471 brand=tesla,driver>=470,driver<471 brand=nvidia,driver>=470,driver<471 brand=quadro,driver>=470,driver<471 brand=quadrortx,driver>=470,driver<471 brand=nvidiartx,driver>=470,driver<471 brand=vapps,driver>=470,driver<471 brand=vpc,driver>=470,driver<471 brand=vcs,driver>=470,driver<471 brand=vws,driver>=470,driver<471 brand=cloudgaming,driver>=470,driver<471 brand=unknown,driver>=535,driver<536 brand=grid,driver>=535,driver<536 brand=tesla,driver>=535,driver<536 brand=nvidia,driver>=535,driver<536 brand=quadro,driver>=535,driver<536 brand=quadrortx,driver>=535,driver<536 brand=nvidiartx,driver>=535,driver<536 brand=vapps,driver>=535,driver<536 brand=vpc,driver>=535,driver<536 brand=vcs,driver>=535,driver<536 brand=vws,driver>=535,driver<536 brand=cloudgaming,driver>=535,driver<536 brand=unknown,driver>=550,driver<551 brand=grid,driver>=550,driver<551 brand=tesla,driver>=550,driver<551 brand=nvidia,driver>=550,driver<551 brand=quadro,driver>=550,driver<551 brand=quadrortx,driver>=550,driver<551 brand=nvidiartx,driver>=550,driver<551 brand=vapps,driver>=550,driver<551 brand=vpc,driver>=550,driver<551 brand=vcs,driver>=550,driver<551 brand=vws,driver>=550,driver<551 brand=cloudgaming,driver>=550,driver<551"
57+
ENV NV_CUDA_CUDART_VERSION=12.6.77-1
4958

5059
COPY ${CUDA_SOURCE_CODE}/cuda.repo-${TARGETARCH} /etc/yum.repos.d/cuda.repo
5160
COPY ${CUDA_SOURCE_CODE}/NGC-DL-CONTAINER-LICENSE /
@@ -54,12 +63,12 @@ RUN NVIDIA_GPGKEY_SUM=d0664fbbdb8c32356d45de36c5984617217b2d0bef41b93ccecd326ba3
5463
curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/rhel9/${NVARCH}/D42D0685.pub | sed '/^Version/d' > /etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA && \
5564
echo "$NVIDIA_GPGKEY_SUM /etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA" | sha256sum -c --strict -
5665

57-
ENV CUDA_VERSION 12.4.1
66+
ENV CUDA_VERSION=12.6.3
5867

5968
# For libraries in the cuda-compat-* package: https://docs.nvidia.com/cuda/eula/index.html#attachment-a
6069
RUN yum upgrade -y && yum install -y \
61-
cuda-cudart-12-4-${NV_CUDA_CUDART_VERSION} \
62-
cuda-compat-12-4 \
70+
cuda-cudart-12-6-${NV_CUDA_CUDART_VERSION} \
71+
cuda-compat-12-6 \
6372
&& yum clean all \
6473
&& rm -rf /var/cache/yum/*
6574

@@ -76,22 +85,22 @@ ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility
7685

7786
# Install CUDA runtime from:
7887
# https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/12.6.3/ubi9/runtime/Dockerfile
79-
ENV NV_CUDA_LIB_VERSION 12.4.1-1
80-
ENV NV_NVTX_VERSION 12.4.127-1
81-
ENV NV_LIBNPP_VERSION 12.2.5.30-1
82-
ENV NV_LIBNPP_PACKAGE libnpp-12-4-${NV_LIBNPP_VERSION}
83-
ENV NV_LIBCUBLAS_VERSION 12.4.5.8-1
84-
ENV NV_LIBNCCL_PACKAGE_NAME libnccl
85-
ENV NV_LIBNCCL_PACKAGE_VERSION 2.21.5-1
86-
ENV NV_LIBNCCL_VERSION 2.21.5
87-
ENV NCCL_VERSION 2.21.5
88-
ENV NV_LIBNCCL_PACKAGE ${NV_LIBNCCL_PACKAGE_NAME}-${NV_LIBNCCL_PACKAGE_VERSION}+cuda12.4
88+
ENV NV_CUDA_LIB_VERSION=12.6.3-1
89+
ENV NV_NVTX_VERSION=12.6.77-1
90+
ENV NV_LIBNPP_VERSION=12.3.1.54-1
91+
ENV NV_LIBNPP_PACKAGE=libnpp-12-6-${NV_LIBNPP_VERSION}
92+
ENV NV_LIBCUBLAS_VERSION=12.6.4.1-1
93+
ENV NV_LIBNCCL_PACKAGE_NAME=libnccl
94+
ENV NV_LIBNCCL_PACKAGE_VERSION=2.23.4-1
95+
ENV NV_LIBNCCL_VERSION=2.23.4
96+
ENV NCCL_VERSION=2.23.4
97+
ENV NV_LIBNCCL_PACKAGE=${NV_LIBNCCL_PACKAGE_NAME}-${NV_LIBNCCL_PACKAGE_VERSION}+cuda12.6
8998

9099
RUN yum install -y \
91-
cuda-libraries-12-4-${NV_CUDA_LIB_VERSION} \
92-
cuda-nvtx-12-4-${NV_NVTX_VERSION} \
100+
cuda-libraries-12-6-${NV_CUDA_LIB_VERSION} \
101+
cuda-nvtx-12-6-${NV_NVTX_VERSION} \
93102
${NV_LIBNPP_PACKAGE} \
94-
libcublas-12-4-${NV_LIBCUBLAS_VERSION} \
103+
libcublas-12-6-${NV_LIBCUBLAS_VERSION} \
95104
${NV_LIBNCCL_PACKAGE} \
96105
&& yum clean all \
97106
&& rm -rf /var/cache/yum/*
@@ -130,32 +139,29 @@ FROM cuda-base AS cuda-runtime-pytorch
130139

131140
ARG PYTORCH_SOURCE_CODE=runtimes/pytorch+llmcompressor/ubi9-python-3.12
132141

133-
LABEL name="odh-notebook-runtime-pytorch-ubi9-python-3.12" \
134-
summary="Runtime pytorch notebook image for ODH notebooks" \
135-
description="Runtime pytorch notebook image with base Python 3.12 builder image based on UBI9 for ODH notebooks" \
136-
io.k8s.display-name="Runtime pytorch notebook image for ODH notebooks" \
137-
io.k8s.description="Runtime pytorch notebook image with base Python 3.12 builder image based on UBI9 for ODH notebooks" \
142+
LABEL name="odh-notebook-runtime-cuda-pytorch-llmcompressor-ubi9-python-3.12" \
143+
summary="Runtime CUDA pytorch-llmcompressor notebook image for ODH notebooks" \
144+
description="Runtime CUDA pytorch-llmcompressor notebook image with base Python 3.12 builder image based on UBI9 for ODH notebooks" \
145+
io.k8s.display-name="Runtime CUDA pytorch-llmcompressor notebook image for ODH notebooks" \
146+
io.k8s.description="Runtime CUDA pytorch-llmcompressor notebook image with base Python 3.12 builder image based on UBI9 for ODH notebooks" \
138147
authoritative-source-url="https://github.com/opendatahub-io/notebooks" \
139148
io.openshift.build.commit.ref="main" \
140-
io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/runtimes/pytorch/ubi9-python-3.12" \
141-
io.openshift.build.image="quay.io/opendatahub/workbench-images:runtime-pytorch-ubi9-python-3.12"
149+
io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/runtimes/pytorch+llmcompressor/ubi9-python-3.12" \
150+
io.openshift.build.image="quay.io/opendatahub/workbench-images:runtime-pytorch-llmcompressor-ubi9-python-3.12"
142151

143152
WORKDIR /opt/app-root/bin
144153

145-
# Install Python packages from Pipfile.lock
146-
COPY ${PYTORCH_SOURCE_CODE}/Pipfile.lock ./
154+
# Install Python packages from requirements.txt
155+
COPY ${PYTORCH_SOURCE_CODE}/requirements.txt ./
147156
# Copy Elyra dependencies for air-gapped enviroment
148157
COPY ${PYTORCH_SOURCE_CODE}/utils ./utils/
149158

150159
RUN echo "Installing softwares and packages" && \
151-
micropipenv install --dev && \
152-
rm -f ./Pipfile.lock && \
160+
# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`,
161+
# we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common.
162+
uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./requirements.txt --build-constraints=./requirements.txt && \
153163
# Fix permissions to support pip in Openshift environments \
154164
chmod -R g+w /opt/app-root/lib/python3.12/site-packages && \
155165
fix-permissions /opt/app-root -P
156166

157167
WORKDIR /opt/app-root/src
158-
159-
# Install micropipenv and uv to deploy packages from requirements.txt begin
160-
RUN pip install --no-cache-dir -U "micropipenv[toml]==1.9.0" "uv==0.8.12"
161-
# Install micropipenv and uv to deploy packages from requirements.txt end

0 commit comments

Comments
 (0)