Skip to content

Commit 6695df2

Browse files
committed
Intel optimized ML container added
1 parent 40ab529 commit 6695df2

File tree

21 files changed

+9401
-4
lines changed

21 files changed

+9401
-4
lines changed

Makefile

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,16 @@ codeserver-ubi9-python-3.9: base-ubi9-python-3.9
188188
$(call image,$@,codeserver/ubi9-python-3.9,$<)
189189

190190

191+
# Build and push intel-runtime-ml-ubi9-python-3.9 image to the registry
192+
.PHONY: intel-runtime-ml-ubi9-python-3.9
193+
intel-runtime-ml-ubi9-python-3.9: base-ubi9-python-3.9
194+
$(call image,$@,intel/runtimes/ml/ubi9-python-3.9,$<)
195+
196+
# Build and push jupyter-intel-ml-ubi9-python-3.9 image to the registry
197+
.PHONY: jupyter-intel-ml-ubi9-python-3.9
198+
jupyter-intel-ml-ubi9-python-3.9: intel-runtime-ml-ubi9-python-3.9
199+
$(call image,$@,jupyter/intel/ml/ubi9-python-3.9,$<)
200+
191201
####################################### Buildchain for Python 3.9 using C9S #######################################
192202

193203
# Build and push base-c9s-python-3.9 image to the registry
@@ -308,16 +318,17 @@ undeploy-c9s-%-c9s-python-3.9: bin/kubectl
308318
# ARG 1: UBI flavor
309319
# ARG 1: Python kernel
310320
define test_with_papermill
321+
$(eval PREFIX_NAME := $(subst /,-,$(1)_$(2))) \
311322
$(KUBECTL_BIN) exec $(FULL_NOTEBOOK_NAME) -- /bin/sh -c "python3 -m pip install papermill" ; \
312-
$(KUBECTL_BIN) exec $(FULL_NOTEBOOK_NAME) -- /bin/sh -c "wget ${NOTEBOOK_REPO_BRANCH_BASE}/jupyter/$(1)/$(2)-$(3)/test/test_notebook.ipynb -O test_notebook.ipynb && python3 -m papermill test_notebook.ipynb $(1)_$(2)_output.ipynb --kernel python3 --stderr-file $(1)_$(2)_error.txt" ; \
323+
$(KUBECTL_BIN) exec $(FULL_NOTEBOOK_NAME) -- /bin/sh -c "wget ${NOTEBOOK_REPO_BRANCH_BASE}/jupyter/$(1)/$(2)-$(3)/test/test_notebook.ipynb -O test_notebook.ipynb && python3 -m papermill test_notebook.ipynb $(PREFIX_NAME)_output.ipynb --kernel python3 --stderr-file $(PREFIX_NAME)_error.txt" ; \
313324
if [ $$? -ne 0 ]; then \
314-
echo "ERROR: The $(1) $(2) notebook encountered a failure. To investigate the issue, you can review the logs located in the ocp-ci cluster on 'artifacts/notebooks-e2e-tests/jupyter-$(1)-$(2)-$(3)-test-e2e' directory or run 'cat $(1)_$(2)_error.txt' within your container. The make process has been aborted." ; \
325+
echo "ERROR: The $(1) $(2) notebook encountered a failure. To investigate the issue, you can review the logs located in the ocp-ci cluster on 'artifacts/notebooks-e2e-tests/jupyter-$(1)-$(2)-$(3)-test-e2e' directory or run 'cat $(PREFIX_NAME)_error.txt' within your container. The make process has been aborted." ; \
315326
exit 1 ; \
316327
fi ; \
317-
$(KUBECTL_BIN) exec $(FULL_NOTEBOOK_NAME) -- /bin/sh -c "cat $(1)_$(2)_error.txt | grep --quiet FAILED" ; \
328+
$(KUBECTL_BIN) exec $(FULL_NOTEBOOK_NAME) -- /bin/sh -c "cat $(PREFIX_NAME)_error.txt | grep --quiet FAILED" ; \
318329
if [ $$? -eq 0 ]; then \
319330
echo "ERROR: The $(1) $(2) notebook encountered a failure. The make process has been aborted." ; \
320-
$(KUBECTL_BIN) exec $(FULL_NOTEBOOK_NAME) -- /bin/sh -c "cat $(1)_$(2)_error.txt" ; \
331+
$(KUBECTL_BIN) exec $(FULL_NOTEBOOK_NAME) -- /bin/sh -c "cat $(PREFIX_NAME)_error.txt" ; \
321332
exit 1 ; \
322333
fi
323334
endef
@@ -344,6 +355,8 @@ test-%: bin/kubectl
344355
elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "tensorflow-ubi9"; then \
345356
$(MAKE) validate-ubi9-datascience -e FULL_NOTEBOOK_NAME=$(FULL_NOTEBOOK_NAME); \
346357
$(call test_with_papermill,tensorflow,ubi9,python-3.9) \
358+
elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "intel-ml-ubi9"; then \
359+
$(call test_with_papermill,intel/ml,ubi9,python-3.9) \
347360
elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "trustyai-ubi9"; then \
348361
$(MAKE) validate-ubi9-datascience -e FULL_NOTEBOOK_NAME=$(FULL_NOTEBOOK_NAME); \
349362
$(call test_with_papermill,trustyai,ubi9,python-3.9) \
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from sklearnex import patch_sklearn
2+
from sklearnex import unpatch_sklearn
3+
patch_sklearn()
4+
print("To disable Intel(R) Extension for Scikit-learn*, you can run: unpatch_sklearn()")
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
ARG BASE_IMAGE
2+
FROM ${BASE_IMAGE}
3+
4+
LABEL name="odh-notebook-intel-runtime-ml-ubi9-python-3.9" \
5+
summary="Runtime Intel® optimized ML notebook image for ODH notebooks" \
6+
description="Runtime Intel® optimized ML notebook image with base Python 3.9 builder image based on UBI9 for ODH notebooks" \
7+
io.k8s.display-name="Runtime Intel® optimized ML notebook image for ODH notebooks" \
8+
io.k8s.description="Runtime Intel® optimized ML 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/ml/ubi9-python-3.9" \
12+
io.openshift.build.image="quay.io/opendatahub/workbench-images:intel-runtime-ml-ubi9-python-3.9"
13+
14+
WORKDIR /opt/app-root/bin
15+
16+
# Install Python packages from Pipfile.lock
17+
COPY Pipfile.lock Pipfile.lock
18+
19+
# Copy Elyra dependencies for air-gapped enviroment
20+
COPY utils utils
21+
22+
COPY --chown=1001:0 .patch_sklearn.py /opt/app-root/bin/.patch_sklearn.py
23+
ENV PYTHONSTARTUP="/opt/app-root/bin/.patch_sklearn.py"
24+
25+
#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.
26+
RUN echo "Installing softwares and packages" && \
27+
micropipenv install && \
28+
rm -f ./Pipfile.lock && \
29+
# Fix permissions to support pip in Openshift environments \
30+
chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
31+
fix-permissions /opt/app-root -P
32+
33+
WORKDIR /opt/app-root/src
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
# Classical-ML
8+
daal4py = {version="*"}
9+
"modin[ray]" = {version="==0.24.1"}
10+
scikit-learn-intelex = {version="==2024.0.1"}
11+
threadpoolctl = {version="*"}
12+
xgboost = {version="==1.7.3"}
13+
14+
# Datascience and useful extensions
15+
cloud-data-connector = {version="*"}
16+
kafka-python = "~=2.0.2"
17+
matplotlib = "~=3.6.3"
18+
numpy = "~=1.24.3"
19+
pandas = "~=2.1.4"
20+
plotly = "~=5.16.1"
21+
scipy = "~=1.11.2"
22+
scikit-learn = "~=1.3.1"
23+
skl2onnx = "~=1.15.0"
24+
codeflare-sdk = "~=0.13.0"
25+
26+
# DB connectors
27+
pymongo = "~=4.5.0"
28+
psycopg = "~=3.1.10"
29+
pyodbc = "~=4.0.39"
30+
mysql-connector-python = "~=8.0.33"
31+
32+
# This is a comprehensive list of python dependencies that Elyra requires to execute Jupyter notebooks.
33+
ipykernel = "==6.13.0"
34+
ipython = "==8.10.0"
35+
ipython-genutils = "==0.2.0"
36+
jinja2 = "==3.0.3"
37+
jupyter-client = "==7.3.1"
38+
jupyter-core = "==4.11.2"
39+
MarkupSafe = "==2.1.1"
40+
minio = "==7.1.15"
41+
nbclient = "==0.6.3"
42+
nbconvert = "==6.5.1"
43+
nbformat = "==5.4.0"
44+
papermill = "==2.3.4"
45+
pyzmq = "==24.0.1"
46+
prompt-toolkit = "==3.0.30"
47+
requests = "==2.31.0"
48+
tornado = "==6.3.3"
49+
traitlets = "==5.1.1"
50+
urllib3 = "==1.26.9"
51+
52+
[requires]
53+
python_version = "3.9"

0 commit comments

Comments
 (0)