Skip to content

Commit af1c490

Browse files
authored
[rhds] RHAIENG-304: switch from Pipfile.lock to pylock.toml for package management across all relevant Dockerfiles (#1508)
This propagates to rhds the changes done in * opendatahub-io#2145
1 parent 3ded715 commit af1c490

File tree

16 files changed

+73
-59
lines changed

16 files changed

+73
-59
lines changed

codeserver/ubi9-python-3.12/Dockerfile.konflux.cpu

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,14 @@ ENV PYTHONPATH=/opt/app-root/bin/python3
130130

131131
USER 1001
132132

133-
# Install useful packages from Pipfile.lock
134-
COPY ${CODESERVER_SOURCE_CODE}/Pipfile.lock ./
133+
# Install useful packages from requirements.txt
134+
COPY ${CODESERVER_SOURCE_CODE}/pylock.toml ./
135135

136136
# Install packages and cleanup
137137
RUN echo "Installing softwares and packages" && \
138-
micropipenv install && \
139-
rm -f ./Pipfile.lock && \
138+
# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`,
139+
# we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common.
140+
uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./pylock.toml && \
140141
# Fix permissions to support pip in Openshift environments \
141142
chmod -R g+w /opt/app-root/lib/python3.12/site-packages && \
142143
fix-permissions /opt/app-root -P

jupyter/datascience/ubi9-python-3.12/Dockerfile.konflux.cpu

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,15 @@ ENV PATH="$PATH:/opt/mssql-tools18/bin"
9898
# Other apps and tools installed as default user
9999
USER 1001
100100

101-
# Install Python packages and Jupyterlab extensions from Pipfile.lock
102-
COPY ${DATASCIENCE_SOURCE_CODE}/Pipfile.lock ./
101+
# Install Python packages and Jupyterlab extensions from requirements.txt
102+
COPY ${DATASCIENCE_SOURCE_CODE}/pylock.toml ./
103103
# Copy Elyra setup to utils so that it's sourced at startup
104104
COPY ${DATASCIENCE_SOURCE_CODE}/setup-elyra.sh ${DATASCIENCE_SOURCE_CODE}/utils ./utils/
105105

106106
RUN echo "Installing softwares and packages" && \
107-
micropipenv install && \
108-
rm -f ./Pipfile.lock && \
107+
# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`,
108+
# we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common.
109+
uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./pylock.toml && \
109110
# setup path for runtime configuration
110111
mkdir /opt/app-root/runtimes && \
111112
mkdir /opt/app-root/pipeline-runtimes && \

jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.cpu

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,13 @@ ENV PATH="/usr/local/texlive/bin/linux:/usr/local/pandoc/bin:$PATH"
8888

8989
USER 1001
9090

91-
COPY ${MINIMAL_SOURCE_CODE}/Pipfile.lock ${MINIMAL_SOURCE_CODE}/start-notebook.sh ./
91+
COPY ${MINIMAL_SOURCE_CODE}/pylock.toml ${MINIMAL_SOURCE_CODE}/start-notebook.sh ./
9292

93-
# Install Python dependencies from Pipfile.lock file
93+
# Install Python dependencies from requirements.txt file
9494
RUN echo "Installing softwares and packages" && \
95-
micropipenv install && \
96-
rm -f ./Pipfile.lock && \
95+
# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`,
96+
# we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common.
97+
uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./pylock.toml && \
9798
# Disable announcement plugin of jupyterlab \
9899
jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \
99100
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y \

jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.cuda

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,13 @@ ENV PATH="/usr/local/texlive/bin/linux:/usr/local/pandoc/bin:$PATH"
163163

164164
USER 1001
165165

166-
COPY ${MINIMAL_SOURCE_CODE}/Pipfile.lock ${MINIMAL_SOURCE_CODE}/start-notebook.sh ./
166+
COPY ${MINIMAL_SOURCE_CODE}/pylock.toml ${MINIMAL_SOURCE_CODE}/start-notebook.sh ./
167167

168-
# Install Python dependencies from Pipfile.lock file
168+
# Install Python dependencies from requirements.txt file
169169
RUN echo "Installing softwares and packages" && \
170-
micropipenv install && \
171-
rm -f ./Pipfile.lock && \
170+
# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`,
171+
# we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common.
172+
uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./pylock.toml && \
172173
# Disable announcement plugin of jupyterlab \
173174
jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \
174175
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y \

jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.rocm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,13 @@ ENV PATH="/usr/local/texlive/bin/linux:/usr/local/pandoc/bin:$PATH"
8585

8686
USER 1001
8787

88-
COPY ${MINIMAL_SOURCE_CODE}/Pipfile.lock ${MINIMAL_SOURCE_CODE}/start-notebook.sh ./
88+
COPY ${MINIMAL_SOURCE_CODE}/pylock.toml ${MINIMAL_SOURCE_CODE}/start-notebook.sh ./
8989

9090
# Install Python dependencies from Pipfile.lock file
9191
RUN echo "Installing softwares and packages" && \
92-
micropipenv install && \
93-
rm -f ./Pipfile.lock && \
92+
# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`,
93+
# we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common.
94+
uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./pylock.toml && \
9495
# Disable announcement plugin of jupyterlab \
9596
jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \
9697
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y \

jupyter/pytorch/ubi9-python-3.12/Dockerfile.konflux.cuda

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,13 @@ ARG PYTORCH_SOURCE_CODE=jupyter/pytorch/ubi9-python-3.12
215215

216216
WORKDIR /opt/app-root/bin
217217

218-
# Install Python packages and Jupyterlab extensions from Pipfile.lock
219-
COPY ${PYTORCH_SOURCE_CODE}/Pipfile.lock ./
218+
# Install Python packages and Jupyterlab extensions from requirements.txt
219+
COPY ${PYTORCH_SOURCE_CODE}/pylock.toml ./
220220

221221
RUN echo "Installing softwares and packages" && \
222-
micropipenv install && \
223-
rm -f ./Pipfile.lock && \
222+
# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`,
223+
# we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common.
224+
uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./pylock.toml && \
224225
# setup path for runtime configuration
225226
mkdir /opt/app-root/runtimes && \
226227
# Remove default Elyra runtime-images \

jupyter/rocm/pytorch/ubi9-python-3.12/Dockerfile.konflux.rocm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,12 @@ ARG PYTORCH_SOURCE_CODE=jupyter/rocm/pytorch/ubi9-python-3.12
148148

149149
WORKDIR /opt/app-root/bin
150150

151-
COPY ${PYTORCH_SOURCE_CODE}/Pipfile.lock ${PYTORCH_SOURCE_CODE}/de-vendor-torch.sh ./
151+
COPY ${PYTORCH_SOURCE_CODE}/pylock.toml ${PYTORCH_SOURCE_CODE}/de-vendor-torch.sh ./
152152

153153
RUN echo "Installing softwares and packages" && \
154-
micropipenv install && \
155-
rm -f ./Pipfile.lock && \
154+
# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`,
155+
# we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common.
156+
uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./pylock.toml && \
156157
# setup path for runtime configuration
157158
mkdir /opt/app-root/runtimes && \
158159
# Remove default Elyra runtime-images \

jupyter/rocm/tensorflow/ubi9-python-3.12/Dockerfile.konflux.rocm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,13 @@ ARG TENSORFLOW_SOURCE_CODE=jupyter/rocm/tensorflow/ubi9-python-3.12
159159

160160
WORKDIR /opt/app-root/bin
161161

162-
COPY ${TENSORFLOW_SOURCE_CODE}/requirements.txt ./
162+
COPY ${TENSORFLOW_SOURCE_CODE}/pylock.toml ./
163163

164164
RUN echo "Installing softwares and packages" && \
165165
# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`,
166166
# we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common.
167167
# Not using --build-constraints=./requirements.txt because error: Unnamed requirements are not allowed as constraints (found: `https://repo.radeon.com/rocm/manylinux/rocm-rel-6.4/
168-
uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./requirements.txt && \
168+
uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./pylock.toml && \
169169
# setup path for runtime configuration
170170
mkdir /opt/app-root/runtimes && \
171171
# Remove default Elyra runtime-images \

jupyter/tensorflow/ubi9-python-3.12/Dockerfile.konflux.cuda

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,13 @@ ARG TENSORFLOW_SOURCE_CODE=jupyter/tensorflow/ubi9-python-3.12
220220

221221
WORKDIR /opt/app-root/bin
222222

223-
# Install Python packages and Jupyterlab extensions from Pipfile.lock
224-
COPY ${TENSORFLOW_SOURCE_CODE}/Pipfile.lock ./
223+
# Install Python packages and Jupyterlab extensions from requirements.txt
224+
COPY ${TENSORFLOW_SOURCE_CODE}/pylock.toml ./
225225

226226
RUN echo "Installing softwares and packages" && \
227-
micropipenv install --dev && \
228-
rm -f ./Pipfile.lock && \
227+
# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`,
228+
# we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common.
229+
uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./pylock.toml && \
229230
# setup path for runtime configuration
230231
mkdir /opt/app-root/runtimes && \
231232
# Remove default Elyra runtime-images \

jupyter/trustyai/ubi9-python-3.12/Dockerfile.konflux.cpu

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,13 @@ RUN INSTALL_PKGS="java-17-openjdk" && \
120120

121121
USER 1001
122122

123-
# Install Python packages and Jupyterlab extensions from Pipfile.lock
124-
COPY ${TRUSTYAI_SOURCE_CODE}/Pipfile.lock ./
123+
# Install Python packages and Jupyterlab extensions from requirements.txt
124+
COPY ${TRUSTYAI_SOURCE_CODE}/pylock.toml ./
125125

126126
RUN echo "Installing softwares and packages" && \
127-
micropipenv install && \
128-
rm -f ./Pipfile.lock && \
127+
# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`,
128+
# we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common.
129+
uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./pylock.toml && \
129130
# setup path for runtime configuration
130131
mkdir /opt/app-root/runtimes && \
131132
# Remove default Elyra runtime-images \

0 commit comments

Comments
 (0)