-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update of Habana SynapseAI notebook to 1.15.1 #533
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
FROM vault.habana.ai/gaudi-docker/1.15.1/rhel9.2/habanalabs/pytorch-installer-2.2.0:1.15.1-15 as base | ||
|
||
LABEL name="odh-notebook-habana-jupyter-1.15.1-ubi9-python-3.10" \ | ||
summary="Jupyter HabanaAI 1.15.1 notebook image for ODH notebooks" \ | ||
description="Jupyter HabanaAI 1.15.1 notebook image with base Python 3.10 builder image based on ubi9 for ODH notebooks" \ | ||
io.k8s.display-name="Jupyter HabanaAI 1.15.1 notebook image for ODH notebooks" \ | ||
io.k8s.description="Jupyter HabanaAI 1.15.1 notebook image with base Python 3.10 builder image based on ubi9 for ODH notebooks" \ | ||
authoritative-source-url="https://github.com/opendatahub-io/notebooks" \ | ||
io.openshift.build.commit.ref="main" \ | ||
io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/habana/1.15.1/ubi9-python-3.10" \ | ||
io.openshift.build.image="quay.io/opendatahub/workbench-images:habana-jupyter-1.15.1-ubi9-python-3.10" | ||
|
||
COPY --from=registry.access.redhat.com/ubi9/python-39:latest /usr/bin/fix-permissions /usr/bin | ||
COPY --from=registry.access.redhat.com/ubi9/python-39:latest /usr/bin/rpm-file-permissions /usr/bin | ||
|
||
ENV PATH=/opt/app-root/src/bin:/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ | ||
APP_ROOT="/opt/app-root" | ||
|
||
ENV HOME="${APP_ROOT}/src" | ||
|
||
WORKDIR ${HOME} | ||
|
||
RUN mkdir -p ${APP_ROOT}/src && \ | ||
rpm-file-permissions && \ | ||
useradd -u 1001 -r -g 0 -d ${HOME} -c "Default Application User" default && \ | ||
chown -R 1001:0 ${APP_ROOT} | ||
|
||
FROM base as notebook-base | ||
|
||
ENV PYTHON_VERSION=3.10 \ | ||
PATH=$HOME/.local/bin/:$PATH \ | ||
PYTHONUNBUFFERED=1 \ | ||
PYTHONIOENCODING=UTF-8 \ | ||
LC_ALL=en_US.UTF-8 \ | ||
LANG=en_US.UTF-8 \ | ||
PIP_NO_CACHE_DIR=off | ||
|
||
RUN python3.10 -m venv --system-site-packages ${APP_ROOT} && \ | ||
chown -R 1001:0 ${APP_ROOT} && \ | ||
fix-permissions ${APP_ROOT} -P && \ | ||
rpm-file-permissions && \ | ||
echo "unset BASH_ENV PROMPT_COMMAND ENV" >> ${APP_ROOT}/bin/activate | ||
|
||
ENV BASH_ENV="${APP_ROOT}/bin/activate" \ | ||
ENV="${APP_ROOT}/bin/activate" \ | ||
PROMPT_COMMAND=". ${APP_ROOT}/bin/activate" | ||
|
||
# Squash a warning from the Habana runtime | ||
ENV TSAN_OPTIONS='ignore_noninstrumented_modules=1' | ||
|
||
WORKDIR /opt/app-root/bin | ||
|
||
# Install micropipenv to deploy packages from Pipfile.lock | ||
RUN pip install --no-cache-dir -U "micropipenv[toml]" | ||
|
||
# Install Python dependencies from Pipfile.lock file | ||
COPY Pipfile.lock ./ | ||
|
||
RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./Pipfile.lock | ||
|
||
# OS Packages needs to be installed as root | ||
USER root | ||
|
||
# Install usefull OS packages | ||
RUN dnf install -y mesa-libGL && dnf clean all && rm -rf /var/cache/yum | ||
|
||
# Install the oc client | ||
RUN curl -L https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/ocp/stable/openshift-client-linux.tar.gz \ | ||
-o /tmp/openshift-client-linux.tar.gz && \ | ||
tar -xzvf /tmp/openshift-client-linux.tar.gz oc && \ | ||
rm -f /tmp/openshift-client-linux.tar.gz | ||
|
||
# Fix permissions to support pip in Openshift environments | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be done in the same RUN as the micropipenv install that created these files |
||
RUN chmod -R g+w /opt/app-root/lib/python3.10/site-packages && \ | ||
fix-permissions /opt/app-root -P | ||
|
||
# Other apps and tools installed as default user | ||
USER 1001 | ||
|
||
WORKDIR /opt/app-root/src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[[source]] | ||
name = "pypi" | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
|
||
[dev-packages] | ||
|
||
[packages] | ||
# Base packages | ||
wheel = "~=0.43.0" | ||
setuptools = "~=69.2.0" | ||
|
||
[requires] | ||
python_version = "3.10" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Copyright (c) 2022 Habana Labs, Ltd. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
ARG BASE_IMAGE | ||
FROM ${BASE_IMAGE} | ||
|
||
USER root | ||
|
||
## Label the image with details required by ODH | ||
LABEL name="odh-notebook-habana-jupyter-1.15.1-ubi9-python-3.10" \ | ||
summary="Jupyter HabanaAI 1.15.1 notebook image for ODH notebooks" \ | ||
description="Jupyter HabanaAI 1.15.1 notebook image with base Python 3.10 builder image based on ubi9 for ODH notebooks" \ | ||
io.k8s.display-name="Jupyter HabanaAI 1.15.1 notebook image for ODH notebooks" \ | ||
io.k8s.description="Jupyter HabanaAI 1.15.1 notebook image with base Python 3.10 builder image based on ubi9 for ODH notebooks" \ | ||
authoritative-source-url="https://github.com/opendatahub-io/notebooks" \ | ||
io.openshift.build.commit.ref="main" \ | ||
io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/habana/1.15.1/ubi9-python-3.10" \ | ||
io.openshift.build.image="quay.io/opendatahub/workbench-images:habana-jupyter-1.15.1-ubi9-python-3.10" | ||
|
||
WORKDIR /opt/app-root/bin | ||
|
||
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.10/site-packages && \ | ||
fix-permissions /opt/app-root -P | ||
|
||
WORKDIR /opt/app-root/src | ||
|
||
# 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 | ||
|
||
USER 1001 | ||
|
||
ENTRYPOINT ["start-notebook.sh"] | ||
|
||
WORKDIR /opt/app-root/src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
[[source]] | ||
name = "pypi" | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
|
||
[dev-packages] | ||
|
||
[packages] | ||
# JupyterLab packages | ||
jupyterlab = "~=3.6.7" # Wait on upgrade till plugins are ready | ||
jupyter-server = "~=2.13.0" | ||
jupyter-server-proxy = "~=4.0.0" # Upgrade would bring in jupyterlab 4 | ||
jupyter-server-terminals = "~=0.5.3" | ||
jupyterlab-git = "~=0.44.0" | ||
nbdime = "~=3.2.1" | ||
nbgitpuller = "~=1.2.0" | ||
|
||
# Base packages | ||
wheel = "~=0.43.0" | ||
setuptools = "~=69.2.0" | ||
|
||
[requires] | ||
python_version = "3.10" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we really compiling something with thread sanitizer enabled? this gives you 3 to 10x more memory consumption and about the same amount of performance degradation; tsan is intended for debug builds only