From cc3e1064bda25c8a1ba88bc8e6c07747259b10fc Mon Sep 17 00:00:00 2001 From: atheo89 Date: Mon, 24 Nov 2025 14:05:31 +0100 Subject: [PATCH] Add additional ARGS for pylock locations and names --- jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu | 11 ++++++++--- jupyter/minimal/ubi9-python-3.12/Dockerfile.cuda | 11 ++++++++--- jupyter/minimal/ubi9-python-3.12/Dockerfile.rocm | 11 ++++++++--- jupyter/minimal/ubi9-python-3.12/build-args/cpu.conf | 2 ++ jupyter/minimal/ubi9-python-3.12/build-args/cuda.conf | 2 ++ jupyter/minimal/ubi9-python-3.12/build-args/rocm.conf | 2 ++ 6 files changed, 30 insertions(+), 9 deletions(-) diff --git a/jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu b/jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu index b9ed08b9fc..b943009694 100644 --- a/jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu +++ b/jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu @@ -2,6 +2,8 @@ # configuration args # ######################### ARG BASE_IMAGE +ARG PYLOCK_PATH +ARG PYLOCK_NAME # External image alias for UBI repository configuration FROM registry.access.redhat.com/ubi9/ubi AS ubi-repos @@ -66,6 +68,8 @@ FROM cpu-base AS jupyter-minimal ARG JUPYTER_REUSABLE_UTILS=jupyter/utils ARG MINIMAL_SOURCE_CODE=jupyter/minimal/ubi9-python-3.12 +ARG PYLOCK_PATH +ARG PYLOCK_NAME LABEL name="odh-notebook-jupyter-minimal-ubi9-python-3.12" \ summary="Minimal Jupyter notebook image for ODH notebooks" \ @@ -91,15 +95,16 @@ ENV PATH="/usr/local/texlive/bin/linux:/usr/local/pandoc/bin:$PATH" USER 1001 -COPY ${MINIMAL_SOURCE_CODE}/pylock.toml ${MINIMAL_SOURCE_CODE}/start-notebook.sh ./ +COPY ${MINIMAL_SOURCE_CODE}${PYLOCK_PATH} ./${PYLOCK_NAME} +COPY ${MINIMAL_SOURCE_CODE}/start-notebook.sh . -# Install Python dependencies from requirements.txt file +# Install Python dependencies from pylock file RUN /bin/bash <<'EOF' set -Eeuxo pipefail echo "Installing softwares and packages" # This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`, # we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common. -uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./pylock.toml +uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./${PYLOCK_NAME} # Disable announcement plugin of jupyterlab jupyter labextension disable "@jupyterlab/apputils-extension:announcements" # Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y diff --git a/jupyter/minimal/ubi9-python-3.12/Dockerfile.cuda b/jupyter/minimal/ubi9-python-3.12/Dockerfile.cuda index 4f12a86b11..7ccb167994 100644 --- a/jupyter/minimal/ubi9-python-3.12/Dockerfile.cuda +++ b/jupyter/minimal/ubi9-python-3.12/Dockerfile.cuda @@ -4,6 +4,8 @@ ARG TARGETARCH # configuration args # ######################### ARG BASE_IMAGE +ARG PYLOCK_PATH +ARG PYLOCK_NAME #################### # cuda-base # @@ -65,6 +67,8 @@ FROM cuda-base AS cuda-jupyter-minimal ARG JUPYTER_REUSABLE_UTILS=jupyter/utils ARG MINIMAL_SOURCE_CODE=jupyter/minimal/ubi9-python-3.12 +ARG PYLOCK_PATH +ARG PYLOCK_NAME LABEL name="odh-notebook-jupyter-cuda-minimal-ubi9-python-3.12" \ summary="Minimal Jupyter CUDA notebook image for ODH notebooks" \ @@ -90,15 +94,16 @@ ENV PATH="/usr/local/texlive/bin/linux:/usr/local/pandoc/bin:$PATH" USER 1001 -COPY ${MINIMAL_SOURCE_CODE}/pylock.toml ${MINIMAL_SOURCE_CODE}/start-notebook.sh ./ +COPY ${MINIMAL_SOURCE_CODE}${PYLOCK_PATH} ./${PYLOCK_NAME} +COPY ${MINIMAL_SOURCE_CODE}/start-notebook.sh . -# Install Python dependencies from requirements.txt file +# Install Python dependencies from pylock file RUN /bin/bash <<'EOF' set -Eeuxo pipefail echo "Installing softwares and packages" # This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`, # we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common. -uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./pylock.toml +uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./${PYLOCK_NAME} # Disable announcement plugin of jupyterlab jupyter labextension disable "@jupyterlab/apputils-extension:announcements" # Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y diff --git a/jupyter/minimal/ubi9-python-3.12/Dockerfile.rocm b/jupyter/minimal/ubi9-python-3.12/Dockerfile.rocm index 82ed294aaf..b9f5b0e546 100644 --- a/jupyter/minimal/ubi9-python-3.12/Dockerfile.rocm +++ b/jupyter/minimal/ubi9-python-3.12/Dockerfile.rocm @@ -2,6 +2,8 @@ # configuration args # ######################### ARG BASE_IMAGE +ARG PYLOCK_PATH +ARG PYLOCK_NAME #################### # rocm-base # @@ -63,6 +65,8 @@ FROM rocm-base AS rocm-jupyter-minimal ARG JUPYTER_REUSABLE_UTILS=jupyter/utils ARG MINIMAL_SOURCE_CODE=jupyter/minimal/ubi9-python-3.12 +ARG PYLOCK_PATH +ARG PYLOCK_NAME LABEL name="odh-notebook-jupyter-rocm-minimal-ubi9-python-3.12" \ summary="Minimal Jupyter ROCm notebook image for ODH notebooks" \ @@ -88,15 +92,16 @@ ENV PATH="/usr/local/texlive/bin/linux:/usr/local/pandoc/bin:$PATH" USER 1001 -COPY ${MINIMAL_SOURCE_CODE}/pylock.toml ${MINIMAL_SOURCE_CODE}/start-notebook.sh ./ +COPY ${MINIMAL_SOURCE_CODE}${PYLOCK_PATH} ./${PYLOCK_NAME} +COPY ${MINIMAL_SOURCE_CODE}/start-notebook.sh . -# Install Python dependencies from Pipfile.lock file +# Install Python dependencies from pylock file RUN /bin/bash <<'EOF' set -Eeuxo pipefail echo "Installing softwares and packages" # This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`, # we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common. -uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./pylock.toml +uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./${PYLOCK_NAME} # Disable announcement plugin of jupyterlab jupyter labextension disable "@jupyterlab/apputils-extension:announcements" # Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y diff --git a/jupyter/minimal/ubi9-python-3.12/build-args/cpu.conf b/jupyter/minimal/ubi9-python-3.12/build-args/cpu.conf index 5ccf6d512d..33ac4b30fd 100644 --- a/jupyter/minimal/ubi9-python-3.12/build-args/cpu.conf +++ b/jupyter/minimal/ubi9-python-3.12/build-args/cpu.conf @@ -1,2 +1,4 @@ # Base Image : c9s with Python 3.12 BASE_IMAGE=quay.io/opendatahub/odh-base-image-cpu-py312-c9s:latest +PYLOCK_PATH=/pylock.toml +PYLOCK_NAME=pylock.toml diff --git a/jupyter/minimal/ubi9-python-3.12/build-args/cuda.conf b/jupyter/minimal/ubi9-python-3.12/build-args/cuda.conf index ee957f7643..731ae91884 100644 --- a/jupyter/minimal/ubi9-python-3.12/build-args/cuda.conf +++ b/jupyter/minimal/ubi9-python-3.12/build-args/cuda.conf @@ -1 +1,3 @@ BASE_IMAGE=quay.io/opendatahub/odh-base-image-cuda-py312-c9s:v12.8 +PYLOCK_PATH=/pylock.toml +PYLOCK_NAME=pylock.toml diff --git a/jupyter/minimal/ubi9-python-3.12/build-args/rocm.conf b/jupyter/minimal/ubi9-python-3.12/build-args/rocm.conf index 33fbb8b940..29ed0a8111 100644 --- a/jupyter/minimal/ubi9-python-3.12/build-args/rocm.conf +++ b/jupyter/minimal/ubi9-python-3.12/build-args/rocm.conf @@ -1 +1,3 @@ BASE_IMAGE=quay.io/opendatahub/odh-base-image-rocm-py312-c9s:v6.3 +PYLOCK_PATH=/pylock.toml +PYLOCK_NAME=pylock.toml