Skip to content

Commit

Permalink
Merge pull request opendatahub-io#634 from caponetto/rocm-combine-run
Browse files Browse the repository at this point in the history
Combine `RUN` commands to reduce rocm image size
  • Loading branch information
openshift-merge-bot[bot] committed Jul 24, 2024
2 parents dbeac5b + 7a6d8e2 commit ed46263
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 21 deletions.
16 changes: 6 additions & 10 deletions jupyter/rocm/pytorch/ubi9-python-3.9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,10 @@ LABEL name="odh-notebook-jupyter-rocm-pytorch-ubi9-python-3.9" \
# 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 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
RUN chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
fix-permissions /opt/app-root -P
# 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
18 changes: 7 additions & 11 deletions jupyter/rocm/tensorflow/ubi9-python-3.9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,10 @@ LABEL name="odh-notebook-jupyter-rocm-tensorflow-ubi9-python-3.9" \
# 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.9/site-packages && \
fix-permissions /opt/app-root -P
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 ed46263

Please sign in to comment.