Skip to content

Commit bf759a3

Browse files
committed
Add Habana 1.13 notebook
1 parent 0133259 commit bf759a3

File tree

8 files changed

+4065
-0
lines changed

8 files changed

+4065
-0
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ habana-jupyter-1.10.0-ubi8-python-3.8: jupyter-datascience-ubi8-python-3.8
9696
habana-jupyter-1.11.0-ubi8-python-3.8: jupyter-datascience-ubi8-python-3.8
9797
$(call image,$@,habana/1.11.0/ubi8-python-3.8,$<)
9898

99+
# Build and push habana-jupyter-1.13.0-ubi8-python-3.8 image to the registry
100+
.PHONY: habana-jupyter-1.13.0-ubi8-python-3.8
101+
habana-jupyter-1.13.0-ubi8-python-3.8: jupyter-datascience-ubi8-python-3.8
102+
$(call image,$@,habana/1.13.0/ubi8-python-3.8,$<)
103+
99104
# Build and push runtime-minimal-ubi8-python-3.8 image to the registry
100105
.PHONY: runtime-minimal-ubi8-python-3.8
101106
runtime-minimal-ubi8-python-3.8: base-ubi8-python-3.8
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
# Copyright (c) 2022 Habana Labs, Ltd.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# HabanaLabs Dockerfile base installer layer for RedHat 8.6
6+
# Reference: https://github.com/HabanaAI/Setup_and_Install/blob/1.13.0/dockerfiles/base/Dockerfile.rhel8.6
7+
ARG BASE_IMAGE
8+
FROM ${BASE_IMAGE}
9+
10+
ARG ARTIFACTORY_URL="vault.habana.ai"
11+
ARG VERSION="1.13.0"
12+
ARG REVISION="463"
13+
ARG PT_VERSION="2.1.0"
14+
15+
USER root
16+
17+
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && \
18+
dnf clean all && rm -rf /var/cache/yum
19+
20+
RUN echo "[appstream]" > /etc/yum.repos.d/CentOS-Linux-AppStream.repo && \
21+
echo "name=CentOS Linux 8 - AppStream" >> /etc/yum.repos.d/CentOS-Linux-AppStream.repo && \
22+
echo "mirrorlist=http://mirrorlist.centos.org/?release=\$releasever-stream&arch=\$basearch&repo=AppStream&infra=\$infra" >> /etc/yum.repos.d/CentOS-Linux-AppStream.repo && \
23+
echo "gpgcheck=0" >> /etc/yum.repos.d/CentOS-Linux-AppStream.repo
24+
25+
26+
RUN echo "[BaseOS]" > /etc/yum.repos.d/CentOS-Linux-BaseOS.repo && \
27+
echo "name=CentOS Linux 8 - BaseOS" >> /etc/yum.repos.d/CentOS-Linux-BaseOS.repo && \
28+
echo "mirrorlist=http://mirrorlist.centos.org/?release=\$releasever-stream&arch=\$basearch&repo=BaseOS&infra=\$infra" >> /etc/yum.repos.d/CentOS-Linux-BaseOS.repo && \
29+
echo "gpgcheck=0" >> /etc/yum.repos.d/CentOS-Linux-BaseOS.repo
30+
31+
RUN dnf install -y \
32+
clang \
33+
cmake3 \
34+
cpp \
35+
gcc \
36+
gcc-c++ \
37+
glibc \
38+
glibc-headers \
39+
glibc-devel \
40+
jemalloc \
41+
libarchive \
42+
libksba \
43+
unzip \
44+
llvm \
45+
lsof \
46+
python38-devel \
47+
openssh-clients \
48+
libjpeg-devel \
49+
openssh-server \
50+
redhat-lsb-core \
51+
wget \
52+
git \
53+
mesa-libGL \
54+
python3-dnf-plugin-versionlock && \
55+
# update pkgs (except OS version) for resolving potentials CVEs
56+
dnf versionlock add redhat-release* && \
57+
dnf update -y && \
58+
dnf clean all && rm -rf /var/cache/yum
59+
60+
ENV LD_LIBRARY_PATH=/usr/lib/habanalabs:$LD_LIBRARY_PATH
61+
ENV RDMAV_FORK_SAFE=1
62+
63+
RUN echo "[habanalabs]" > /etc/yum.repos.d/habanalabs.repo && \
64+
echo "name=Habana RH8 Linux repo" >> /etc/yum.repos.d/habanalabs.repo && \
65+
echo "baseurl=https://${ARTIFACTORY_URL}/artifactory/rhel/8/8.6" >> /etc/yum.repos.d/habanalabs.repo && \
66+
echo "gpgkey=https://${ARTIFACTORY_URL}/artifactory/rhel/8/8.6/repodata/repomd.xml.key" >> /etc/yum.repos.d/habanalabs.repo
67+
68+
RUN echo "[powertools]" > /etc/yum.repos.d/powertools.repo && \
69+
echo "name=powertools" >> /etc/yum.repos.d/powertools.repo && \
70+
echo "baseurl=http://mirror.centos.org/centos/8-stream/PowerTools/x86_64/os/" >> /etc/yum.repos.d/powertools.repo && \
71+
echo "gpgcheck=0" >> /etc/yum.repos.d/powertools.repo
72+
73+
RUN dnf install -y habanalabs-rdma-core-"$VERSION"-"$REVISION".el8 \
74+
habanalabs-thunk-"$VERSION"-"$REVISION".el8 \
75+
habanalabs-firmware-tools-"$VERSION"-"$REVISION".el8 \
76+
habanalabs-graph-"$VERSION"-"$REVISION".el8 && \
77+
rm -f /etc/yum.repos.d/habanalabs.repo && rm -rf /tmp/* && \
78+
dnf clean all && rm -rf /var/cache/yum
79+
80+
RUN rpm -V habanalabs-rdma-core && rpm -V habanalabs-thunk && rpm -V habanalabs-firmware-tools && rpm -V habanalabs-graph
81+
82+
# There is no need to store pip installation files inside docker image
83+
ENV PIP_NO_CACHE_DIR=on
84+
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
85+
ENV RDMA_CORE_ROOT=/opt/habanalabs/rdma-core/src
86+
ENV RDMA_CORE_LIB=${RDMA_CORE_ROOT}/build/lib
87+
88+
# Install python packages
89+
# RUN python3.8 -m pip install hpu_media_loader=="${VERSION}"."${REVISION}"
90+
# Install Python packages and Jupyterlab extensions from Pipfile.lock
91+
COPY Pipfile.lock ./
92+
93+
RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./Pipfile.lock
94+
95+
RUN echo "export LANG=en_US.UTF-8" >> /root/.bashrc
96+
RUN export LANG=en_US.UTF-8
97+
ENV GC_KERNEL_PATH=/usr/lib/habanalabs/libtpc_kernels.so
98+
ENV HABANA_LOGS=/var/log/habana_logs/
99+
ENV HABANA_SCAL_BIN_PATH=/opt/habanalabs/engines_fw
100+
ENV HABANA_PLUGINS_LIB_PATH=/opt/habanalabs/habana_plugins
101+
102+
## Install habana tensorflow
103+
# Reference: https://github.com/HabanaAI/Setup_and_Install/blob/1.13.0/dockerfiles/tensorflow/Dockerfile.rhel8.6
104+
# For AML/CentOS/RHEL OS'es TFIO_DATAPATH have to be specified to import tensorflow_io lib correctly
105+
ENV TFIO_DATAPATH=/opt/app-root/src/python3.8/site-packages/
106+
107+
# For AML/CentOS/RHEL ca-cert file is expected exactly under /etc/ssl/certs/ca-certificates.crt
108+
# otherwise curl will fail during access to S3 AWS storage
109+
RUN ln -s /etc/ssl/certs/ca-bundle.crt /etc/ssl/certs/ca-certificates.crt
110+
111+
## Install habana pytorch
112+
# Reference: https://github.com/HabanaAI/Setup_and_Install/blob/1.13.0/dockerfiles/pytorch/Dockerfile.rhel8.6
113+
ENV LANG=en_US.UTF-8
114+
ENV PYTHONPATH=/root:/usr/lib/habanalabs/
115+
116+
RUN dnf install -y \
117+
curl \
118+
cairo-devel \
119+
numactl-devel \
120+
iproute \
121+
which \
122+
zlib-devel \
123+
lapack-devel \
124+
openblas-devel \
125+
numactl \
126+
gperftools-devel && \
127+
dnf clean all && rm -rf /var/cache/yum
128+
129+
RUN wget --no-verbose https://"${ARTIFACTORY_URL}"/artifactory/gaudi-pt-modules/"${VERSION}"/"${REVISION}"\
130+
/pytorch/rhel86/pytorch_modules-v"${PT_VERSION}"_"${VERSION}"_"${REVISION}".tgz && \
131+
mkdir /root/habanalabs /root/habanalabs/pytorch_temp && \
132+
tar -xf pytorch_modules-v"${PT_VERSION}"_"${VERSION}"_"${REVISION}".tgz -C /root/habanalabs/pytorch_temp/. && \
133+
pip3 install /root/habanalabs/pytorch_temp/*.whl && \
134+
pip3 install $(grep "lightning" /root/habanalabs/pytorch_temp/requirements-pytorch.txt) && \
135+
pip3 install tensorboard~=2.12.2 protobuf==3.20.3 && \
136+
pip3 uninstall -y pillow && \
137+
pip3 uninstall -y pillow-simd && \
138+
pip3 install pillow-simd==7.0.0.post3 && \
139+
rm -rf /root/habanalabs/pytorch_temp/ && \
140+
rm -rf pytorch_modules-v"${PT_VERSION}"_"${VERSION}"_"${REVISION}".tgz &&\
141+
echo "source /etc/profile.d/habanalabs.sh" >> ~/.bashrc
142+
143+
ENV LD_PRELOAD=/lib64/libtcmalloc.so.4
144+
ENV TCMALLOC_LARGE_ALLOC_REPORT_THRESHOLD=7516192768
145+
146+
RUN dnf clean all && rm -rf /var/cache/dnf && rm -rf /tmp/*
147+
148+
## Label the image with details required by ODH
149+
LABEL name="odh-notebook-habana-jupyter-1.3.0-ubi8-python-3.8" \
150+
summary="Jupyter HabanaAI 1.13.0 notebook image for ODH notebooks" \
151+
description="Jupyter HabanaAI 1.13.0 notebook image with base Python 3.8 builder image based on ubi8 for ODH notebooks" \
152+
io.k8s.display-name="Jupyter HabanaAI 1.13.0 notebook image for ODH notebooks" \
153+
io.k8s.description="Jupyter HabanaAI 1.13.0 notebook image with base Python 3.8 builder image based on ubi8 for ODH notebooks" \
154+
authoritative-source-url="https://github.com/opendatahub-io/notebooks" \
155+
io.openshift.build.commit.ref="main" \
156+
io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/habana/1.13.0/ubi8-python-3.8" \
157+
io.openshift.build.image="quay.io/opendatahub/workbench-images:habana-jupyter-1.13.0-ubi8-python-3.8"
158+
159+
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x
160+
RUN sed -i -e "s/Python.*/$(python --version| cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json && \
161+
# Fix permissions to support pip in Openshift environments \
162+
chmod -R g+w /opt/app-root/lib/python3.8/site-packages && \
163+
fix-permissions /opt/app-root -P
164+
165+
USER 1001
166+
167+
WORKDIR /opt/app-root/src

habana/1.13.0/ubi8-python-3.8/Pipfile

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[dev-packages]
7+
8+
[packages]
9+
# Habana requirements
10+
habana_media_loader = "==1.13.0.463"
11+
12+
# TensorFlow and useful extensions
13+
habana-tensorflow = "==1.13.0.463"
14+
tensorflow-cpu = "==2.12.1"
15+
tensorflow-io = "==0.32.0"
16+
tensorboard = "~=2.12.2"
17+
tf2onnx = "~= 1.13.0"
18+
19+
# Pytorch and useful extension
20+
habana-pyhlml = "==1.13.0.463"
21+
22+
# Below pkgs are required for pytorch-fork
23+
cffi = "==1.15.1"
24+
typing-extensions = ">=4.5.0"
25+
numpy = "==1.23.5"
26+
ninja = ">=1.11.1"
27+
pyyaml = "==6.0"
28+
pybind11 = "==2.10.4"
29+
mkl = "==2023.1"
30+
mkl-include = "==2023.1"
31+
32+
# Parent image requirements to maintain cohesion
33+
elyra-pipeline-editor-extension = "~=3.15.0"
34+
elyra-python-editor-extension = "~=3.15.0"
35+
elyra-code-snippet-extension = "~=3.15.0"
36+
kfp-tekton = "<1.6.0"
37+
boto3 = "~=1.26.69"
38+
jupyter-bokeh = "~=3.0.5"
39+
kafka-python = "~=2.0.2"
40+
matplotlib = "~=3.6.3"
41+
pandas = "~=1.5.3"
42+
plotly = "~=5.13.0"
43+
scikit-learn = "~=1.2.1"
44+
scipy = "~=1.10.0"
45+
jupyterlab-lsp = "~=3.10.2"
46+
jupyterlab-widgets = "~=3.0.5"
47+
jupyter-resource-usage = "~=0.6.0"
48+
49+
# Parent image requirements to maintain cohesion
50+
jupyterlab = "~=3.5.3"
51+
jupyter-server = "~=2.1.0"
52+
jupyter-server-proxy = "~=3.2.2"
53+
jupyter-server-terminals = "~=0.4.4"
54+
jupyterlab-git = "~=0.41.0"
55+
nbdime = "~=3.1.1"
56+
nbgitpuller = "~=1.1.1"
57+
# ---
58+
wheel = "~=0.38.4"
59+
60+
[requires]
61+
python_version = "3.8"

0 commit comments

Comments
 (0)