From d91fb43ced44f73bbb62d632bca0b028ff0d4f89 Mon Sep 17 00:00:00 2001 From: Guilherme Caponetto <638737+caponetto@users.noreply.github.com> Date: Wed, 7 Aug 2024 13:08:42 -0300 Subject: [PATCH] Apply #635 to Python 3.11 images --- jupyter/datascience/ubi9-python-3.11/Dockerfile | 5 ++++- jupyter/minimal/ubi9-python-3.11/Dockerfile | 14 ++++++-------- jupyter/pytorch/ubi9-python-3.11/Dockerfile | 7 +++---- .../rocm/pytorch/ubi9-python-3.11/Dockerfile | 4 ++-- .../rocm/tensorflow/ubi9-python-3.11/Dockerfile | 8 ++++---- jupyter/tensorflow/ubi9-python-3.11/Dockerfile | 17 +++++++---------- jupyter/trustyai/ubi9-python-3.11/Dockerfile | 17 +++++++---------- 7 files changed, 33 insertions(+), 39 deletions(-) diff --git a/jupyter/datascience/ubi9-python-3.11/Dockerfile b/jupyter/datascience/ubi9-python-3.11/Dockerfile index 4d99292e0..e178ecf85 100644 --- a/jupyter/datascience/ubi9-python-3.11/Dockerfile +++ b/jupyter/datascience/ubi9-python-3.11/Dockerfile @@ -20,7 +20,10 @@ COPY setup-elyra.sh ./utils/ RUN echo "Installing softwares and packages" && \ micropipenv install && \ - rm -f ./Pipfile.lock + rm -f ./Pipfile.lock && \ + # Fix permissions to support pip in Openshift environments \ + chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \ + fix-permissions /opt/app-root -P COPY utils ./utils/ diff --git a/jupyter/minimal/ubi9-python-3.11/Dockerfile b/jupyter/minimal/ubi9-python-3.11/Dockerfile index 70de3193c..1e4d90083 100644 --- a/jupyter/minimal/ubi9-python-3.11/Dockerfile +++ b/jupyter/minimal/ubi9-python-3.11/Dockerfile @@ -18,14 +18,12 @@ COPY utils utils/ COPY Pipfile.lock start-notebook.sh ./ # Install Python dependencies from Pipfile.lock file -RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./Pipfile.lock - -# Disable announcement plugin of jupyterlab -RUN jupyter labextension disable "@jupyterlab/apputils-extension:announcements" - -# Fix permissions to support pip in Openshift environments -RUN chmod -R g+w /opt/app-root/lib/python3.11/site-packages && \ - fix-permissions /opt/app-root -P +RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./Pipfile.lock && \ + # Disable announcement plugin of jupyterlab \ + jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \ + # Fix permissions to support pip in Openshift environments \ + chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \ + fix-permissions /opt/app-root -P WORKDIR /opt/app-root/src diff --git a/jupyter/pytorch/ubi9-python-3.11/Dockerfile b/jupyter/pytorch/ubi9-python-3.11/Dockerfile index 0cb3825b3..908d1abf6 100644 --- a/jupyter/pytorch/ubi9-python-3.11/Dockerfile +++ b/jupyter/pytorch/ubi9-python-3.11/Dockerfile @@ -20,8 +20,7 @@ RUN echo "Installing softwares and packages" && \ # Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y \ sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json && \ # Disable announcement plugin of jupyterlab \ - jupyter labextension disable "@jupyterlab/apputils-extension:announcements" - -# Fix permissions to support pip in Openshift environments -RUN chmod -R g+w /opt/app-root/lib/python3.11/site-packages && \ + jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \ + # Fix permissions to support pip in Openshift environments \ + chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \ fix-permissions /opt/app-root -P diff --git a/jupyter/rocm/pytorch/ubi9-python-3.11/Dockerfile b/jupyter/rocm/pytorch/ubi9-python-3.11/Dockerfile index 5c1584c07..e7e89badf 100644 --- a/jupyter/rocm/pytorch/ubi9-python-3.11/Dockerfile +++ b/jupyter/rocm/pytorch/ubi9-python-3.11/Dockerfile @@ -22,7 +22,7 @@ RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./P rm ./de-vendor-torch.sh && \ # Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json && \ - # Disable announcement plugin of jupyterlab + # Disable announcement plugin of jupyterlab \ jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \ - # Fix permissions to support pip in Openshift environments + # Fix permissions to support pip in Openshift environments \ chmod -R g+w /opt/app-root/lib/python3.11/site-packages && fix-permissions /opt/app-root -P diff --git a/jupyter/rocm/tensorflow/ubi9-python-3.11/Dockerfile b/jupyter/rocm/tensorflow/ubi9-python-3.11/Dockerfile index f6409759c..1af7f9fe1 100644 --- a/jupyter/rocm/tensorflow/ubi9-python-3.11/Dockerfile +++ b/jupyter/rocm/tensorflow/ubi9-python-3.11/Dockerfile @@ -15,9 +15,9 @@ LABEL name="odh-notebook-jupyter-rocm-tensorflow-ubi9-python-3.11" \ COPY Pipfile.lock ./ RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./Pipfile.lock && \ - # Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y + # Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y \ sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json && \ - # Disable announcement plugin of jupyterlab + # Disable announcement plugin of jupyterlab \ jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \ - # Fix permissions to support pip in Openshift environments - chmod -R g+w /opt/app-root/lib/python3.11/site-packages && fix-permissions /opt/app-root -P + # Fix permissions to support pip in Openshift environments \ + chmod -R g+w /opt/app-root/lib/python3.9/site-packages && fix-permissions /opt/app-root -P diff --git a/jupyter/tensorflow/ubi9-python-3.11/Dockerfile b/jupyter/tensorflow/ubi9-python-3.11/Dockerfile index efcc6bf81..02fa7423d 100644 --- a/jupyter/tensorflow/ubi9-python-3.11/Dockerfile +++ b/jupyter/tensorflow/ubi9-python-3.11/Dockerfile @@ -19,14 +19,11 @@ RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./P # Temporary:Workaround for fixing the kfp-kubernetes 1.0.0 for elyra pipeline execution # TODO: Remove this patch once the issue is fixed with kfp-kubernetes upgrade. -RUN patch /opt/app-root/lib/python3.11/site-packages/elyra/templates/kubeflow/v2/python_dsl_template.jinja2 -i utils/python_dsl_template.patch - -# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y -RUN sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json - -# Disable announcement plugin of jupyterlab -RUN jupyter labextension disable "@jupyterlab/apputils-extension:announcements" - -# Fix permissions to support pip in Openshift environments -RUN chmod -R g+w /opt/app-root/lib/python3.11/site-packages && \ +RUN patch /opt/app-root/lib/python3.9/site-packages/elyra/templates/kubeflow/v2/python_dsl_template.jinja2 -i utils/python_dsl_template.patch && \ + # Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y \ + sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json && \ + # Disable announcement plugin of jupyterlab \ + jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \ + # Fix permissions to support pip in Openshift environments \ + chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \ fix-permissions /opt/app-root -P diff --git a/jupyter/trustyai/ubi9-python-3.11/Dockerfile b/jupyter/trustyai/ubi9-python-3.11/Dockerfile index 868d028af..42939b981 100644 --- a/jupyter/trustyai/ubi9-python-3.11/Dockerfile +++ b/jupyter/trustyai/ubi9-python-3.11/Dockerfile @@ -23,14 +23,11 @@ USER 1001 # Install Python packages and Jupyterlab extensions from Pipfile.lock COPY Pipfile.lock ./ -RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./Pipfile.lock - -# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y -RUN sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json - -# Disable announcement plugin of jupyterlab -RUN jupyter labextension disable "@jupyterlab/apputils-extension:announcements" - -# Fix permissions to support pip in Openshift environments -RUN chmod -R g+w /opt/app-root/lib/python3.11/site-packages && \ +RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./Pipfile.lock && \ + # Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y \ + sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json && \ + # Disable announcement plugin of jupyterlab \ + jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \ + # Fix permissions to support pip in Openshift environments \ + chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \ fix-permissions /opt/app-root -P