Skip to content

Commit

Permalink
Apply opendatahub-io#635 to Python 3.11 images
Browse files Browse the repository at this point in the history
  • Loading branch information
caponetto committed Aug 7, 2024
1 parent 7d35028 commit d91fb43
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 39 deletions.
5 changes: 4 additions & 1 deletion jupyter/datascience/ubi9-python-3.11/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/

Expand Down
14 changes: 6 additions & 8 deletions jupyter/minimal/ubi9-python-3.11/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 3 additions & 4 deletions jupyter/pytorch/ubi9-python-3.11/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions jupyter/rocm/pytorch/ubi9-python-3.11/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions jupyter/rocm/tensorflow/ubi9-python-3.11/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 7 additions & 10 deletions jupyter/tensorflow/ubi9-python-3.11/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 7 additions & 10 deletions jupyter/trustyai/ubi9-python-3.11/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d91fb43

Please sign in to comment.