Skip to content

Commit 8b4bd61

Browse files
committed
NO-JIRA: refactor(jupyter/*/Dockerfile*): wrap multiple RUN commands with bash for improved readability and error handling
1 parent fcee493 commit 8b4bd61

File tree

6 files changed

+298
-191
lines changed

6 files changed

+298
-191
lines changed

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

Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@ FROM registry.access.redhat.com/ubi9/go-toolset:latest AS mongocli-builder
1616
ARG MONGOCLI_VERSION=2.0.4
1717

1818
WORKDIR /tmp/
19-
RUN curl -Lo mongodb-cli-mongocli-v${MONGOCLI_VERSION}.zip https://github.com/mongodb/mongodb-cli/archive/refs/tags/mongocli/v${MONGOCLI_VERSION}.zip
20-
RUN unzip ./mongodb-cli-mongocli-v${MONGOCLI_VERSION}.zip
21-
RUN cd ./mongodb-cli-mongocli-v${MONGOCLI_VERSION}/ && \
22-
CGO_ENABLED=1 GOOS=linux go build -a -tags strictfipsruntime -o /tmp/mongocli ./cmd/mongocli/
19+
RUN /bin/bash <<'EOF'
20+
set -Eeuxo pipefail
21+
curl -Lo mongodb-cli-mongocli-v${MONGOCLI_VERSION}.zip https://github.com/mongodb/mongodb-cli/archive/refs/tags/mongocli/v${MONGOCLI_VERSION}.zip
22+
unzip ./mongodb-cli-mongocli-v${MONGOCLI_VERSION}.zip
23+
cd ./mongodb-cli-mongocli-v${MONGOCLI_VERSION}/
24+
CGO_ENABLED=1 GOOS=linux go build -a -tags strictfipsruntime -o /tmp/mongocli ./cmd/mongocli/
25+
EOF
2326

2427
####################
2528
# cuda-base #
@@ -49,7 +52,12 @@ EOF
4952
# upgrade first to avoid fixable vulnerabilities end
5053

5154
# Install useful OS packages
52-
RUN dnf install -y perl mesa-libGL skopeo && dnf clean all && rm -rf /var/cache/yum
55+
RUN /bin/bash <<'EOF'
56+
set -Eeuxo pipefail
57+
dnf install -y perl mesa-libGL skopeo
58+
dnf clean all
59+
rm -rf /var/cache/yum
60+
EOF
5361

5462
# Other apps and tools installed as default user
5563
USER 1001
@@ -110,7 +118,12 @@ WORKDIR /opt/app-root/bin
110118
USER root
111119

112120
# Install useful OS packages
113-
RUN dnf install -y jq unixODBC postgresql git-lfs libsndfile && dnf clean all && rm -rf /var/cache/yum
121+
RUN /bin/bash <<'EOF'
122+
set -Eeuxo pipefail
123+
dnf install -y jq unixODBC postgresql git-lfs libsndfile
124+
dnf clean all
125+
rm -rf /var/cache/yum
126+
EOF
114127

115128
# Copy dynamically-linked mongocli built in earlier build stage
116129
COPY --from=mongocli-builder /tmp/mongocli /opt/app-root/bin/
@@ -146,24 +159,27 @@ LABEL name="odh-notebook-jupyter-cuda-pytorch-llmcompressor-ubi9-python-3.12" \
146159
# Install Python packages and Jupyterlab extensions from requirements.txt
147160
COPY ${PYTORCH_SOURCE_CODE}/pylock.toml ./
148161

149-
RUN echo "Installing softwares and packages" && \
150-
# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`,
151-
# we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common.
152-
uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./pylock.toml && \
153-
# setup path for runtime configuration
154-
mkdir /opt/app-root/runtimes && \
155-
# Remove default Elyra runtime-images \
156-
rm /opt/app-root/share/jupyter/metadata/runtime-images/*.json && \
157-
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y \
158-
sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json && \
159-
# copy jupyter configuration
160-
cp /opt/app-root/bin/utils/jupyter_server_config.py /opt/app-root/etc/jupyter && \
161-
# Disable announcement plugin of jupyterlab \
162-
jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \
163-
# Apply JupyterLab addons \
164-
/opt/app-root/bin/utils/addons/apply.sh && \
165-
# Fix permissions to support pip in Openshift environments \
166-
chmod -R g+w /opt/app-root/lib/python3.12/site-packages && \
167-
fix-permissions /opt/app-root -P
162+
RUN /bin/bash <<'EOF'
163+
set -Eeuxo pipefail
164+
echo "Installing softwares and packages"
165+
# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`,
166+
# we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common.
167+
uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./pylock.toml
168+
# setup path for runtime configuration
169+
mkdir /opt/app-root/runtimes
170+
# Remove default Elyra runtime-images
171+
rm /opt/app-root/share/jupyter/metadata/runtime-images/*.json
172+
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y
173+
sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json
174+
# copy jupyter configuration
175+
cp /opt/app-root/bin/utils/jupyter_server_config.py /opt/app-root/etc/jupyter
176+
# Disable announcement plugin of jupyterlab
177+
jupyter labextension disable "@jupyterlab/apputils-extension:announcements"
178+
# Apply JupyterLab addons
179+
/opt/app-root/bin/utils/addons/apply.sh
180+
# Fix permissions to support pip in Openshift environments
181+
chmod -R g+w /opt/app-root/lib/python3.12/site-packages
182+
fix-permissions /opt/app-root -P
183+
EOF
168184

169185
WORKDIR /opt/app-root/src

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

Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@ FROM registry.access.redhat.com/ubi9/go-toolset:latest AS mongocli-builder
1616
ARG MONGOCLI_VERSION=2.0.4
1717

1818
WORKDIR /tmp/
19-
RUN curl -Lo mongodb-cli-mongocli-v${MONGOCLI_VERSION}.zip https://github.com/mongodb/mongodb-cli/archive/refs/tags/mongocli/v${MONGOCLI_VERSION}.zip
20-
RUN unzip ./mongodb-cli-mongocli-v${MONGOCLI_VERSION}.zip
21-
RUN cd ./mongodb-cli-mongocli-v${MONGOCLI_VERSION}/ && \
22-
CGO_ENABLED=1 GOOS=linux go build -a -tags strictfipsruntime -o /tmp/mongocli ./cmd/mongocli/
19+
RUN /bin/bash <<'EOF'
20+
set -Eeuxo pipefail
21+
curl -Lo mongodb-cli-mongocli-v${MONGOCLI_VERSION}.zip https://github.com/mongodb/mongodb-cli/archive/refs/tags/mongocli/v${MONGOCLI_VERSION}.zip
22+
unzip ./mongodb-cli-mongocli-v${MONGOCLI_VERSION}.zip
23+
cd ./mongodb-cli-mongocli-v${MONGOCLI_VERSION}/
24+
CGO_ENABLED=1 GOOS=linux go build -a -tags strictfipsruntime -o /tmp/mongocli ./cmd/mongocli/
25+
EOF
2326

2427
####################
2528
# cuda-base #
@@ -49,7 +52,12 @@ EOF
4952
# upgrade first to avoid fixable vulnerabilities end
5053

5154
# Install useful OS packages
52-
RUN dnf install -y perl mesa-libGL skopeo && dnf clean all && rm -rf /var/cache/yum
55+
RUN /bin/bash <<'EOF'
56+
set -Eeuxo pipefail
57+
dnf install -y perl mesa-libGL skopeo
58+
dnf clean all
59+
rm -rf /var/cache/yum
60+
EOF
5361

5462
# Other apps and tools installed as default user
5563
USER 1001
@@ -110,7 +118,12 @@ WORKDIR /opt/app-root/bin
110118
USER root
111119

112120
# Install useful OS packages
113-
RUN dnf install -y jq unixODBC postgresql git-lfs libsndfile libxcrypt-compat && dnf clean all && rm -rf /var/cache/yum
121+
RUN /bin/bash <<'EOF'
122+
set -Eeuxo pipefail
123+
dnf install -y jq unixODBC postgresql git-lfs libsndfile libxcrypt-compat
124+
dnf clean all
125+
rm -rf /var/cache/yum
126+
EOF
114127

115128
# Copy dynamically-linked mongocli built in earlier build stage
116129
COPY --from=mongocli-builder /tmp/mongocli /opt/app-root/bin/
@@ -146,24 +159,27 @@ LABEL name="odh-notebook-jupyter-cuda-pytorch-ubi9-python-3.12" \
146159
# Install Python packages and Jupyterlab extensions from requirements.txt
147160
COPY ${PYTORCH_SOURCE_CODE}/pylock.toml ./
148161

149-
RUN echo "Installing softwares and packages" && \
150-
# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`,
151-
# we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common.
152-
uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./pylock.toml && \
153-
# setup path for runtime configuration
154-
mkdir /opt/app-root/runtimes && \
155-
# Remove default Elyra runtime-images \
156-
rm /opt/app-root/share/jupyter/metadata/runtime-images/*.json && \
157-
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y \
158-
sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json && \
159-
# copy jupyter configuration
160-
cp /opt/app-root/bin/utils/jupyter_server_config.py /opt/app-root/etc/jupyter && \
161-
# Disable announcement plugin of jupyterlab \
162-
jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \
163-
# Apply JupyterLab addons \
164-
/opt/app-root/bin/utils/addons/apply.sh && \
165-
# Fix permissions to support pip in Openshift environments \
166-
chmod -R g+w /opt/app-root/lib/python3.12/site-packages && \
167-
fix-permissions /opt/app-root -P
162+
RUN /bin/bash <<'EOF'
163+
set -Eeuxo pipefail
164+
echo "Installing softwares and packages"
165+
# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`,
166+
# we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common.
167+
uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./pylock.toml
168+
# setup path for runtime configuration
169+
mkdir /opt/app-root/runtimes
170+
# Remove default Elyra runtime-images
171+
rm /opt/app-root/share/jupyter/metadata/runtime-images/*.json
172+
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y
173+
sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json
174+
# copy jupyter configuration
175+
cp /opt/app-root/bin/utils/jupyter_server_config.py /opt/app-root/etc/jupyter
176+
# Disable announcement plugin of jupyterlab
177+
jupyter labextension disable "@jupyterlab/apputils-extension:announcements"
178+
# Apply JupyterLab addons
179+
/opt/app-root/bin/utils/addons/apply.sh
180+
# Fix permissions to support pip in Openshift environments
181+
chmod -R g+w /opt/app-root/lib/python3.12/site-packages
182+
fix-permissions /opt/app-root -P
183+
EOF
168184

169185
WORKDIR /opt/app-root/src

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

Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@ FROM registry.access.redhat.com/ubi9/go-toolset:latest AS mongocli-builder
1414
ARG MONGOCLI_VERSION=2.0.4
1515

1616
WORKDIR /tmp/
17-
RUN curl -Lo mongodb-cli-mongocli-v${MONGOCLI_VERSION}.zip https://github.com/mongodb/mongodb-cli/archive/refs/tags/mongocli/v${MONGOCLI_VERSION}.zip
18-
RUN unzip ./mongodb-cli-mongocli-v${MONGOCLI_VERSION}.zip
19-
RUN cd ./mongodb-cli-mongocli-v${MONGOCLI_VERSION}/ && \
20-
CGO_ENABLED=1 GOOS=linux go build -a -tags strictfipsruntime -o /tmp/mongocli ./cmd/mongocli/
17+
RUN /bin/bash <<'EOF'
18+
set -Eeuxo pipefail
19+
curl -Lo mongodb-cli-mongocli-v${MONGOCLI_VERSION}.zip https://github.com/mongodb/mongodb-cli/archive/refs/tags/mongocli/v${MONGOCLI_VERSION}.zip
20+
unzip ./mongodb-cli-mongocli-v${MONGOCLI_VERSION}.zip
21+
cd ./mongodb-cli-mongocli-v${MONGOCLI_VERSION}/
22+
CGO_ENABLED=1 GOOS=linux go build -a -tags strictfipsruntime -o /tmp/mongocli ./cmd/mongocli/
23+
EOF
2124

2225
####################
2326
# rocm-base #
@@ -47,7 +50,12 @@ EOF
4750
# upgrade first to avoid fixable vulnerabilities end
4851

4952
# Install useful OS packages
50-
RUN dnf install -y perl mesa-libGL skopeo && dnf clean all && rm -rf /var/cache/yum
53+
RUN /bin/bash <<'EOF'
54+
set -Eeuxo pipefail
55+
dnf install -y perl mesa-libGL skopeo
56+
dnf clean all
57+
rm -rf /var/cache/yum
58+
EOF
5159

5260
# Other apps and tools installed as default user
5361
USER 1001
@@ -108,7 +116,12 @@ WORKDIR /opt/app-root/bin
108116
USER root
109117

110118
# Install useful OS packages
111-
RUN dnf install -y jq unixODBC postgresql git-lfs libsndfile libxcrypt-compat && dnf clean all && rm -rf /var/cache/yum
119+
RUN /bin/bash <<'EOF'
120+
set -Eeuxo pipefail
121+
dnf install -y jq unixODBC postgresql git-lfs libsndfile libxcrypt-compat
122+
dnf clean all
123+
rm -rf /var/cache/yum
124+
EOF
112125

113126
# Copy dynamically-linked mongocli built in earlier build stage
114127
COPY --from=mongocli-builder /tmp/mongocli /opt/app-root/bin/
@@ -143,27 +156,30 @@ LABEL name="odh-notebook-jupyter-rocm-pytorch-ubi9-python-3.12" \
143156

144157
COPY ${PYTORCH_SOURCE_CODE}/pylock.toml ${PYTORCH_SOURCE_CODE}/de-vendor-torch.sh ./
145158

146-
RUN echo "Installing softwares and packages" && \
147-
# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`,
148-
# we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common.
149-
uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./pylock.toml && \
150-
# setup path for runtime configuration
151-
mkdir /opt/app-root/runtimes && \
152-
# Remove default Elyra runtime-images \
153-
rm /opt/app-root/share/jupyter/metadata/runtime-images/*.json && \
154-
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y \
155-
sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json && \
156-
# copy jupyter configuration
157-
cp /opt/app-root/bin/utils/jupyter_server_config.py /opt/app-root/etc/jupyter && \
158-
# Disable announcement plugin of jupyterlab \
159-
jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \
160-
# Apply JupyterLab addons \
161-
/opt/app-root/bin/utils/addons/apply.sh && \
162-
# De-vendor the ROCm libs that are embedded in Pytorch \
163-
./de-vendor-torch.sh && \
164-
rm ./de-vendor-torch.sh && \
165-
# Fix permissions to support pip in Openshift environments \
166-
chmod -R g+w /opt/app-root/lib/python3.12/site-packages && \
167-
fix-permissions /opt/app-root -P
159+
RUN /bin/bash <<'EOF'
160+
set -Eeuxo pipefail
161+
echo "Installing softwares and packages"
162+
# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`,
163+
# we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common.
164+
uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./pylock.toml
165+
# setup path for runtime configuration
166+
mkdir /opt/app-root/runtimes
167+
# Remove default Elyra runtime-images
168+
rm /opt/app-root/share/jupyter/metadata/runtime-images/*.json
169+
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y
170+
sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json
171+
# copy jupyter configuration
172+
cp /opt/app-root/bin/utils/jupyter_server_config.py /opt/app-root/etc/jupyter
173+
# Disable announcement plugin of jupyterlab
174+
jupyter labextension disable "@jupyterlab/apputils-extension:announcements"
175+
# Apply JupyterLab addons
176+
/opt/app-root/bin/utils/addons/apply.sh
177+
# De-vendor the ROCm libs that are embedded in Pytorch
178+
./de-vendor-torch.sh
179+
rm ./de-vendor-torch.sh
180+
# Fix permissions to support pip in Openshift environments
181+
chmod -R g+w /opt/app-root/lib/python3.12/site-packages
182+
fix-permissions /opt/app-root -P
183+
EOF
168184

169185
WORKDIR /opt/app-root/src

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

Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@ FROM registry.access.redhat.com/ubi9/go-toolset:latest AS mongocli-builder
1414
ARG MONGOCLI_VERSION=2.0.4
1515

1616
WORKDIR /tmp/
17-
RUN curl -Lo mongodb-cli-mongocli-v${MONGOCLI_VERSION}.zip https://github.com/mongodb/mongodb-cli/archive/refs/tags/mongocli/v${MONGOCLI_VERSION}.zip
18-
RUN unzip ./mongodb-cli-mongocli-v${MONGOCLI_VERSION}.zip
19-
RUN cd ./mongodb-cli-mongocli-v${MONGOCLI_VERSION}/ && \
20-
CGO_ENABLED=1 GOOS=linux go build -a -tags strictfipsruntime -o /tmp/mongocli ./cmd/mongocli/
17+
RUN /bin/bash <<'EOF'
18+
set -Eeuxo pipefail
19+
curl -Lo mongodb-cli-mongocli-v${MONGOCLI_VERSION}.zip https://github.com/mongodb/mongodb-cli/archive/refs/tags/mongocli/v${MONGOCLI_VERSION}.zip
20+
unzip ./mongodb-cli-mongocli-v${MONGOCLI_VERSION}.zip
21+
cd ./mongodb-cli-mongocli-v${MONGOCLI_VERSION}/
22+
CGO_ENABLED=1 GOOS=linux go build -a -tags strictfipsruntime -o /tmp/mongocli ./cmd/mongocli/
23+
EOF
2124

2225
####################
2326
# rocm-base #
@@ -47,7 +50,12 @@ EOF
4750
# upgrade first to avoid fixable vulnerabilities end
4851

4952
# Install useful OS packages
50-
RUN dnf install -y perl mesa-libGL skopeo && dnf clean all && rm -rf /var/cache/yum
53+
RUN /bin/bash <<'EOF'
54+
set -Eeuxo pipefail
55+
dnf install -y perl mesa-libGL skopeo
56+
dnf clean all
57+
rm -rf /var/cache/yum
58+
EOF
5159

5260
# Other apps and tools installed as default user
5361
USER 1001
@@ -108,7 +116,12 @@ WORKDIR /opt/app-root/bin
108116
USER root
109117

110118
# Install useful OS packages
111-
RUN dnf install -y jq unixODBC postgresql git-lfs libsndfile && dnf clean all && rm -rf /var/cache/yum
119+
RUN /bin/bash <<'EOF'
120+
set -Eeuxo pipefail
121+
dnf install -y jq unixODBC postgresql git-lfs libsndfile
122+
dnf clean all
123+
rm -rf /var/cache/yum
124+
EOF
112125

113126
# Copy dynamically-linked mongocli built in earlier build stage
114127
COPY --from=mongocli-builder /tmp/mongocli /opt/app-root/bin/
@@ -144,26 +157,29 @@ LABEL name="odh-notebook-jupyter-rocm-tensorflow-ubi9-python-3.12" \
144157

145158
COPY ${TENSORFLOW_SOURCE_CODE}/pylock.toml ./
146159

147-
RUN echo "Installing softwares and packages" && \
148-
# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`,
149-
# we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common.
150-
# 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/
151-
uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./pylock.toml && \
152-
# setup path for runtime configuration
153-
mkdir /opt/app-root/runtimes && \
154-
# Remove default Elyra runtime-images \
155-
rm /opt/app-root/share/jupyter/metadata/runtime-images/*.json && \
156-
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y \
157-
sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json && \
158-
# copy jupyter configuration
159-
cp /opt/app-root/bin/utils/jupyter_server_config.py /opt/app-root/etc/jupyter && \
160-
# Disable announcement plugin of jupyterlab \
161-
jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \
162-
# Apply JupyterLab addons \
163-
/opt/app-root/bin/utils/addons/apply.sh && \
164-
# Fix permissions to support pip in Openshift environments \
165-
chmod -R g+w /opt/app-root/lib/python3.12/site-packages && \
166-
fix-permissions /opt/app-root -P
160+
RUN /bin/bash <<'EOF'
161+
set -Eeuxo pipefail
162+
echo "Installing softwares and packages"
163+
# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`,
164+
# we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common.
165+
# 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/
166+
uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./pylock.toml
167+
# setup path for runtime configuration
168+
mkdir /opt/app-root/runtimes
169+
# Remove default Elyra runtime-images
170+
rm /opt/app-root/share/jupyter/metadata/runtime-images/*.json
171+
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y
172+
sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json
173+
# copy jupyter configuration
174+
cp /opt/app-root/bin/utils/jupyter_server_config.py /opt/app-root/etc/jupyter
175+
# Disable announcement plugin of jupyterlab
176+
jupyter labextension disable "@jupyterlab/apputils-extension:announcements"
177+
# Apply JupyterLab addons
178+
/opt/app-root/bin/utils/addons/apply.sh
179+
# Fix permissions to support pip in Openshift environments
180+
chmod -R g+w /opt/app-root/lib/python3.12/site-packages
181+
fix-permissions /opt/app-root -P
182+
EOF
167183

168184
COPY ${JUPYTER_REUSABLE_UTILS}/usercustomize.pth ${JUPYTER_REUSABLE_UTILS}/monkey_patch_protobuf_6x.py /opt/app-root/lib/python3.12/site-packages/
169185

0 commit comments

Comments
 (0)