Skip to content

Commit 24fa05f

Browse files
authored
Merge pull request #422 from sharvil10/intel_tensorflow_2024.0
Intel® TensorFlow notebook container
2 parents da31add + de174d5 commit 24fa05f

28 files changed

+20732
-0
lines changed

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,16 @@ codeserver-ubi9-python-3.9: base-ubi9-python-3.9
192192
intel-base-gpu-ubi9-python-3.9: base-ubi9-python-3.9
193193
$(call image,$@,intel/base/gpu/ubi9-python-3.9,$<)
194194

195+
# Build and push intel-runtime-tensorflow-ubi9-python-3.9 image to the registry
196+
.PHONY: intel-runtime-tensorflow-ubi9-python-3.9
197+
intel-runtime-tensorflow-ubi9-python-3.9: intel-base-gpu-ubi9-python-3.9
198+
$(call image,$@,intel/runtimes/tensorflow/ubi9-python-3.9,$<)
199+
200+
# Build and push jupyter-intel-tensorflow-ubi9-python-3.9 image to the registry
201+
.PHONY: jupyter-intel-tensorflow-ubi9-python-3.9
202+
jupyter-intel-tensorflow-ubi9-python-3.9: intel-runtime-tensorflow-ubi9-python-3.9
203+
$(call image,$@,jupyter/intel/tensorflow/ubi9-python-3.9,$<)
204+
195205
# Build and push intel-runtime-pytorch-ubi9-python-3.9 image to the registry
196206
.PHONY: intel-runtime-pytorch-ubi9-python-3.9
197207
intel-runtime-pytorch-ubi9-python-3.9: intel-base-gpu-ubi9-python-3.9
@@ -350,6 +360,8 @@ test-%: bin/kubectl
350360
# Tests notebook's functionalities
351361
if echo "$(FULL_NOTEBOOK_NAME)" | grep -q "minimal-ubi9"; then \
352362
$(call test_with_papermill,minimal,ubi9,python-3.9) \
363+
elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "intel-tensorflow-ubi9"; then \
364+
$(call test_with_papermill,intel/tensorflow,ubi9,python-3.9) \
353365
elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "intel-pytorch-ubi9"; then \
354366
$(call test_with_papermill,intel/pytorch,ubi9,python-3.9) \
355367
elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "datascience-ubi9"; then \
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
ARG BASE_IMAGE
2+
FROM ${BASE_IMAGE}
3+
4+
LABEL name="odh-notebook-intel-runtime-tensorflow-ubi9-python-3.9" \
5+
summary="Runtime Intel® optimized TensorFlow notebook image for ODH notebooks" \
6+
description="Runtime Intel® optimized TesorFlow notebook image with base Python 3.9 builder image based on UBI9 for ODH notebooks" \
7+
io.k8s.display-name="Runtime Intel® optimized TensorFlow notebook image for ODH notebooks" \
8+
io.k8s.description="Runtime Intel® optimized TensorFlow notebook image with base Python 3.9 builder image based on UBI9 for ODH notebooks" \
9+
authoritative-source-url="https://github.com/opendatahub-io/notebooks" \
10+
io.openshift.build.commit.ref="main" \
11+
io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/intel/runtimes/tensorflow/ubi9-python-3.9" \
12+
io.openshift.build.image="quay.io/opendatahub/workbench-images:intel-runtime-tensorflow-ubi9-python-3.9"
13+
14+
USER root
15+
16+
ARG ONEAPI_VERSION=2024.0
17+
COPY oneAPI.repo /etc/yum.repos.d/oneAPI.repo
18+
19+
RUN dnf update -y && \
20+
dnf install -y intel-oneapi-dpcpp-cpp-${ONEAPI_VERSION} \
21+
intel-oneapi-mkl-${ONEAPI_VERSION} && \
22+
dnf clean all -y && \
23+
rm -rf /var/cache/dnf/* && \
24+
rm /etc/yum.repos.d/oneAPI.repo
25+
26+
USER 1001
27+
28+
WORKDIR /opt/app-root/bin
29+
30+
# Install Python packages from Pipfile.lock
31+
COPY Pipfile.lock.gpu Pipfile.lock
32+
33+
# Copy Elyra dependencies for air-gapped enviroment
34+
COPY utils utils
35+
36+
#Virtualenv creates a symlink of lib to lib64. That causes issues with importing ITEX since both locations will have ITEX library and it will conflict.
37+
RUN unlink /opt/app-root/lib64 && \
38+
cp -r /opt/app-root/lib /opt/app-root/lib64 && \
39+
echo "Installing softwares and packages" && \
40+
micropipenv install && \
41+
rm -f ./Pipfile.lock && \
42+
# Fix permissions to support pip in Openshift environments \
43+
chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
44+
fix-permissions /opt/app-root -P
45+
46+
ENV CPU_ENV=/opt/app-root-cpu
47+
COPY --chown=1001:0 Pipfile.lock.cpu ${CPU_ENV}/Pipfile.lock
48+
49+
#CPU env
50+
RUN cd ${CPU_ENV} && \
51+
python3.9 -m venv ${CPU_ENV} && \
52+
chown -R 1001:0 ${CPU_ENV} && \
53+
fix-permissions ${CPU_ENV} -P && \
54+
unlink ${CPU_ENV}/lib64 && \
55+
cp -r ${CPU_ENV}/lib ${CPU_ENV}/lib64 && \
56+
source ${CPU_ENV}/bin/activate && \
57+
pip install -U "micropipenv[toml]" && \
58+
micropipenv install && \
59+
rm -f ./Pipfile.lock && \
60+
# Fix permissions to support pip in Openshift environments \
61+
chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
62+
fix-permissions /opt/app-root -P
63+
64+
WORKDIR /opt/app-root/src
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
# TensorFlow packages
8+
tensorflow = {version="==2.14"}
9+
"intel-extension-for-tensorflow[cpu]" = {version="==2.14"}
10+
neural-compressor = {version="2.4.1"}
11+
tensorboard = {version="*"}
12+
tensorflow_hub = {version="*"}
13+
tf2onnx = {version="*"}
14+
15+
# LLM Packages
16+
datasets = {version="*"}
17+
transformers = {version="*"}
18+
evaluate = {version="*"}
19+
20+
# Datascience and useful extensions
21+
cloud-data-connector = {version="*"}
22+
kafka-python = "~=2.0.2"
23+
matplotlib = "~=3.6.3"
24+
pandas = "~=1.5.3"
25+
plotly = "~=5.16.1"
26+
scikit-learn = "*"
27+
scipy = "~=1.11.2"
28+
skl2onnx = "~=1.15.0"
29+
codeflare-sdk = "~=0.13.0"
30+
31+
# DB connectors
32+
pymongo = "~=4.5.0"
33+
psycopg = "~=3.1.10"
34+
pyodbc = "~=4.0.39"
35+
mysql-connector-python = "~=8.0.33"
36+
37+
# This is a comprehensive list of python dependencies that Elyra requires to execute Jupyter notebooks.
38+
ipykernel = "==6.13.0"
39+
ipython = "==8.10.0"
40+
ipython-genutils = "==0.2.0"
41+
jinja2 = "==3.0.3"
42+
jupyter-client = "==7.3.1"
43+
jupyter-core = "==4.11.2"
44+
MarkupSafe = "==2.1.1"
45+
minio = "==7.1.15"
46+
nbclient = "==0.6.3"
47+
nbconvert = "==6.5.1"
48+
nbformat = "==5.4.0"
49+
papermill = "==2.3.4"
50+
pyzmq = "==24.0.1"
51+
prompt-toolkit = "==3.0.30"
52+
requests = "==2.31.0"
53+
tornado = "==6.3.3"
54+
traitlets = "==5.1.1"
55+
urllib3 = "==1.26.9"
56+
57+
[requires]
58+
python_version = "3.9"
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
# TensorFlow packages
8+
tensorflow = {version="==2.14"}
9+
"intel-extension-for-tensorflow[xpu]" = {version="==2.14"}
10+
neural-compressor = {version="2.4.1"}
11+
tensorboard = {version="*"}
12+
tensorflow_hub = {version="*"}
13+
tf2onnx = {version="*"}
14+
15+
# LLM Packages
16+
datasets = {version="*"}
17+
transformers = {version="*"}
18+
evaluate = {version="*"}
19+
20+
# Datascience and useful extensions
21+
cloud-data-connector = {version="*"}
22+
kafka-python = "~=2.0.2"
23+
matplotlib = "~=3.6.3"
24+
pandas = "~=1.5.3"
25+
plotly = "~=5.16.1"
26+
scikit-learn = "*"
27+
scipy = "~=1.11.2"
28+
skl2onnx = "~=1.15.0"
29+
codeflare-sdk = "~=0.13.0"
30+
31+
# DB connectors
32+
pymongo = "~=4.5.0"
33+
psycopg = "~=3.1.10"
34+
pyodbc = "~=4.0.39"
35+
mysql-connector-python = "~=8.0.33"
36+
37+
# This is a comprehensive list of python dependencies that Elyra requires to execute Jupyter notebooks.
38+
ipykernel = "==6.13.0"
39+
ipython = "==8.10.0"
40+
ipython-genutils = "==0.2.0"
41+
jinja2 = "==3.0.3"
42+
jupyter-client = "==7.3.1"
43+
jupyter-core = "==4.11.2"
44+
MarkupSafe = "==2.1.1"
45+
minio = "==7.1.15"
46+
nbclient = "==0.6.3"
47+
nbconvert = "==6.5.1"
48+
nbformat = "==5.4.0"
49+
papermill = "==2.3.4"
50+
pyzmq = "==24.0.1"
51+
prompt-toolkit = "==3.0.30"
52+
requests = "==2.31.0"
53+
tornado = "==6.3.3"
54+
traitlets = "==5.1.1"
55+
urllib3 = "==1.26.9"
56+
57+
[requires]
58+
python_version = "3.9"

0 commit comments

Comments
 (0)