Skip to content

Commit 9ed174f

Browse files
authored
RHOAIENG-10783: fix(Dockerfiles): combine fix-permissions RUN with the preceding RUN when possible (#635)
* RHOAIENG-9853: fix(Dockerfiles): combine fix-permissions RUN with the preceding RUN when possible * fixup, be more aggressive on the rocm buildchain * fixup, forgotten RUN * fixup, unify slashes * fixup, unify indent
1 parent ed363c7 commit 9ed174f

File tree

8 files changed

+38
-46
lines changed

8 files changed

+38
-46
lines changed

jupyter/datascience/ubi9-python-3.9/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ COPY setup-elyra.sh ./utils/
2020

2121
RUN echo "Installing softwares and packages" && \
2222
micropipenv install && \
23-
rm -f ./Pipfile.lock
23+
rm -f ./Pipfile.lock && \
24+
# Fix permissions to support pip in Openshift environments \
25+
chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
26+
fix-permissions /opt/app-root -P
2427

2528
COPY utils ./utils/
2629

jupyter/minimal/ubi8-python-3.8/Dockerfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@ COPY utils utils/
1818
COPY Pipfile.lock start-notebook.sh ./
1919

2020
# Install Python dependencies from Pipfile.lock file
21-
RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./Pipfile.lock
22-
23-
# Disable announcement plugin of jupyterlab
24-
RUN jupyter labextension disable "@jupyterlab/apputils-extension:announcements"
25-
26-
# Fix permissions to support pip in Openshift environments
27-
RUN chmod -R g+w /opt/app-root/lib/python3.8/site-packages && \
28-
fix-permissions /opt/app-root -P
21+
RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./Pipfile.lock && \
22+
# Disable announcement plugin of jupyterlab \
23+
jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \
24+
# Fix permissions to support pip in Openshift environments \
25+
chmod -R g+w /opt/app-root/lib/python3.8/site-packages && \
26+
fix-permissions /opt/app-root -P
2927

3028
WORKDIR /opt/app-root/src
3129

jupyter/minimal/ubi9-python-3.9/Dockerfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@ COPY utils utils/
1818
COPY Pipfile.lock start-notebook.sh ./
1919

2020
# Install Python dependencies from Pipfile.lock file
21-
RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./Pipfile.lock
22-
23-
# Disable announcement plugin of jupyterlab
24-
RUN jupyter labextension disable "@jupyterlab/apputils-extension:announcements"
25-
26-
# Fix permissions to support pip in Openshift environments
27-
RUN chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
28-
fix-permissions /opt/app-root -P
21+
RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./Pipfile.lock && \
22+
# Disable announcement plugin of jupyterlab \
23+
jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \
24+
# Fix permissions to support pip in Openshift environments \
25+
chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
26+
fix-permissions /opt/app-root -P
2927

3028
WORKDIR /opt/app-root/src
3129

jupyter/pytorch/ubi9-python-3.9/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ RUN echo "Installing softwares and packages" && \
2020
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y \
2121
sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json && \
2222
# Disable announcement plugin of jupyterlab \
23-
jupyter labextension disable "@jupyterlab/apputils-extension:announcements"
24-
25-
# Fix permissions to support pip in Openshift environments
26-
RUN chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
23+
jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \
24+
# Fix permissions to support pip in Openshift environments \
25+
chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
2726
fix-permissions /opt/app-root -P

jupyter/rocm/pytorch/ubi9-python-3.9/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./P
2222
rm ./de-vendor-torch.sh && \
2323
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y
2424
sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json && \
25-
# Disable announcement plugin of jupyterlab
25+
# Disable announcement plugin of jupyterlab \
2626
jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \
27-
# Fix permissions to support pip in Openshift environments
27+
# Fix permissions to support pip in Openshift environments \
2828
chmod -R g+w /opt/app-root/lib/python3.9/site-packages && fix-permissions /opt/app-root -P

jupyter/rocm/tensorflow/ubi9-python-3.9/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ LABEL name="odh-notebook-jupyter-rocm-tensorflow-ubi9-python-3.9" \
1515
COPY Pipfile.lock ./
1616

1717
RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./Pipfile.lock && \
18-
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y
18+
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y \
1919
sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json && \
20-
# Disable announcement plugin of jupyterlab
20+
# Disable announcement plugin of jupyterlab \
2121
jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \
22-
# Fix permissions to support pip in Openshift environments
22+
# Fix permissions to support pip in Openshift environments \
2323
chmod -R g+w /opt/app-root/lib/python3.9/site-packages && fix-permissions /opt/app-root -P

jupyter/tensorflow/ubi9-python-3.9/Dockerfile

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,11 @@ RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./P
1919

2020
# Temporary:Workaround for fixing the kfp-kubernetes 1.0.0 for elyra pipeline execution
2121
# TODO: Remove this patch once the issue is fixed with kfp-kubernetes upgrade.
22-
RUN patch /opt/app-root/lib/python3.9/site-packages/elyra/templates/kubeflow/v2/python_dsl_template.jinja2 -i utils/python_dsl_template.patch
23-
24-
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y
25-
RUN sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json
26-
27-
# Disable announcement plugin of jupyterlab
28-
RUN jupyter labextension disable "@jupyterlab/apputils-extension:announcements"
29-
30-
# Fix permissions to support pip in Openshift environments
31-
RUN chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
22+
RUN patch /opt/app-root/lib/python3.9/site-packages/elyra/templates/kubeflow/v2/python_dsl_template.jinja2 -i utils/python_dsl_template.patch && \
23+
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y \
24+
sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json && \
25+
# Disable announcement plugin of jupyterlab \
26+
jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \
27+
# Fix permissions to support pip in Openshift environments \
28+
chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
3229
fix-permissions /opt/app-root -P

jupyter/trustyai/ubi9-python-3.9/Dockerfile

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,11 @@ USER 1001
2323
# Install Python packages and Jupyterlab extensions from Pipfile.lock
2424
COPY Pipfile.lock ./
2525

26-
RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./Pipfile.lock
27-
28-
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y
29-
RUN sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json
30-
31-
# Disable announcement plugin of jupyterlab
32-
RUN jupyter labextension disable "@jupyterlab/apputils-extension:announcements"
33-
34-
# Fix permissions to support pip in Openshift environments
35-
RUN chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
26+
RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./Pipfile.lock && \
27+
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y \
28+
sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json && \
29+
# Disable announcement plugin of jupyterlab \
30+
jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \
31+
# Fix permissions to support pip in Openshift environments \
32+
chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
3633
fix-permissions /opt/app-root -P

0 commit comments

Comments
 (0)