-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add structure for Habana 1.17.1 image - Fix reference to Python 3.10 - Add Habana 1.17.1 Python 3.11 base image to Makefile - Fix references in README files from older Habana images - Fix references to Habana official documentation - Fix README for Habana 1.17.1 - Fix Habana Vault container image reference - Fix Habana 1.17.1's Pipfile and Pipfile.lock files - Add Habana 1.17.1 to Makefile's refresh-pipfilelock-files function - Change entrypoint's chmod for Habana 1.17.1 - Fix Makefile call for Habana 1.17.1 - Add missing newline at end of Dockerfile - Add Habana 1.17.1 images to Github Actions matrix jobs - Add instructions to run the build and push commands for Habana 1.17.1
- Loading branch information
1 parent
7cdd43b
commit 3856c94
Showing
19 changed files
with
2,415 additions
and
30 deletions.
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
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,82 @@ | ||
# Reference: | ||
# - https://vault.habana.ai/ui/repos/tree/General/gaudi-docker/1.17.1/rhel9.4/habanalabs/pytorch-installer-2.3.1/1.17.1-40 | ||
FROM vault.habana.ai/gaudi-docker/1.17.1/rhel9.4/habanalabs/pytorch-installer-2.3.1:1.17.1-40 as base | ||
|
||
LABEL name="odh-notebook-habana-jupyter-1.17.1-ubi9-python-3.11" \ | ||
summary="Jupyter HabanaAI 1.17.1 notebook image for ODH notebooks" \ | ||
description="Jupyter HabanaAI 1.17.1 notebook image with base Python 3.11 builder image based on ubi9 for ODH notebooks" \ | ||
io.k8s.display-name="Jupyter HabanaAI 1.17.1 notebook image for ODH notebooks" \ | ||
io.k8s.description="Jupyter HabanaAI 1.17.1 notebook image with base Python 3.11 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.17.1/ubi9-python-3.11" \ | ||
io.openshift.build.image="quay.io/opendatahub/workbench-images:habana-jupyter-1.17.1-ubi9-python-3.11" | ||
|
||
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.11 \ | ||
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.11 -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" | ||
|
||
# Apparently the following is needed due to training options. | ||
# More information can be seen in the official documentation: | ||
# - https://instructlab.readthedocs.io/latest/habana-gaudi.html#install-and-run-instructlab-with-intel-gaudi | ||
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]" && \ | ||
chmod -R g+w /opt/app-root/lib/python3.11/site-packages && \ | ||
fix-permissions /opt/app-root -P | ||
|
||
# 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 | ||
|
||
# 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.11" |
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
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
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,47 @@ | ||
|
||
# Copyright (c) 2024 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.17.1-ubi9-python-3.11" \ | ||
summary="Jupyter HabanaAI 1.17.1 notebook image for ODH notebooks" \ | ||
description="Jupyter HabanaAI 1.17.1 notebook image with base Python 3.11 builder image based on ubi9 for ODH notebooks" \ | ||
io.k8s.display-name="Jupyter HabanaAI 1.17.1 notebook image for ODH notebooks" \ | ||
io.k8s.description="Jupyter HabanaAI 1.17.1 notebook image with base Python 3.11 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.17.1/ubi9-python-3.11" \ | ||
io.openshift.build.image="quay.io/opendatahub/workbench-images:habana-jupyter-1.17.1-ubi9-python-3.11" | ||
|
||
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.11/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,23 @@ | ||
[[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.11" |
Oops, something went wrong.