Skip to content

Commit 66050e6

Browse files
Merge pull request #544 from sharvil10/sharvils/intel-ai-tools-rebase
Intel AI Tools Images rebased
2 parents dbd4c21 + bf0b553 commit 66050e6

File tree

9 files changed

+80
-8
lines changed

9 files changed

+80
-8
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ intel-runtime-tensorflow-ubi9-python-3.9: intel-base-gpu-ubi9-python-3.9
222222

223223
# Build and push jupyter-intel-tensorflow-ubi9-python-3.9 image to the registry
224224
.PHONY: jupyter-intel-tensorflow-ubi9-python-3.9
225-
jupyter-intel-tensorflow-ubi9-python-3.9: intel-runtime-tensorflow-ubi9-python-3.9
225+
jupyter-intel-tensorflow-ubi9-python-3.9: intel-base-gpu-ubi9-python-3.9
226226
$(call image,$@,jupyter/intel/tensorflow/ubi9-python-3.9,$<)
227227

228228
# Build and push intel-runtime-pytorch-ubi9-python-3.9 image to the registry
@@ -232,7 +232,7 @@ intel-runtime-pytorch-ubi9-python-3.9: intel-base-gpu-ubi9-python-3.9
232232

233233
# Build and push jupyter-intel-pytorch-ubi9-python-3.9 image to the registry
234234
.PHONY: jupyter-intel-pytorch-ubi9-python-3.9
235-
jupyter-intel-pytorch-ubi9-python-3.9: intel-runtime-pytorch-ubi9-python-3.9
235+
jupyter-intel-pytorch-ubi9-python-3.9: intel-base-gpu-ubi9-python-3.9
236236
$(call image,$@,jupyter/intel/pytorch/ubi9-python-3.9,$<)
237237

238238
# Build and push intel-runtime-ml-ubi9-python-3.9 image to the registry
@@ -242,7 +242,7 @@ intel-runtime-ml-ubi9-python-3.9: base-ubi9-python-3.9
242242

243243
# Build and push jupyter-intel-ml-ubi9-python-3.9 image to the registry
244244
.PHONY: jupyter-intel-ml-ubi9-python-3.9
245-
jupyter-intel-ml-ubi9-python-3.9: intel-runtime-ml-ubi9-python-3.9
245+
jupyter-intel-ml-ubi9-python-3.9: base-ubi9-python-3.9
246246
$(call image,$@,jupyter/intel/ml/ubi9-python-3.9,$<)
247247

248248
####################################### Buildchain for Python 3.9 using C9S #######################################

intel/runtimes/pytorch/ubi9-python-3.9/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ ARG ONEAPI_VERSION=2024.0
1717
COPY oneAPI.repo /etc/yum.repos.d/oneAPI.repo
1818

1919
RUN dnf update -y && \
20-
dnf install -y intel-basekit-${ONEAPI_VERSION} && \
20+
dnf install -y intel-oneapi-compiler-dpcpp-cpp-runtime-${ONEAPI_VERSION} \
21+
intel-oneapi-mkl-${ONEAPI_VERSION} \
22+
intel-oneapi-dnnl-${ONEAPI_VERSION} && \
2123
dnf clean all -y && \
2224
rm -rf /var/cache/dnf/* && \
2325
rm /etc/yum.repos.d/oneAPI.repo

intel/runtimes/tensorflow/ubi9-python-3.9/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ ARG ONEAPI_VERSION=2024.0
1717
COPY oneAPI.repo /etc/yum.repos.d/oneAPI.repo
1818

1919
RUN dnf update -y && \
20-
dnf install -y intel-basekit-${ONEAPI_VERSION} && \
20+
dnf install -y intel-oneapi-compiler-dpcpp-cpp-runtime-${ONEAPI_VERSION} \
21+
intel-oneapi-mkl-${ONEAPI_VERSION} \
22+
intel-oneapi-dnnl-${ONEAPI_VERSION} && \
2123
dnf clean all -y && \
2224
rm -rf /var/cache/dnf/* && \
2325
rm /etc/yum.repos.d/oneAPI.repo
@@ -43,6 +45,7 @@ RUN unlink /opt/app-root/lib64 && \
4345
fix-permissions /opt/app-root -P
4446

4547
ENV CPU_ENV=/opt/app-root-cpu
48+
ENV GPU_ENV=/opt/app-root
4649
COPY --chown=1001:0 Pipfile.lock.cpu ${CPU_ENV}/Pipfile.lock
4750

4851
#CPU env
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()")

jupyter/intel/ml/ubi9-python-3.9/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ WORKDIR /opt/app-root/bin
1616
# Install Python packages and Jupyterlab extensions from Pipfile.lock
1717
COPY Pipfile.lock Pipfile.lock
1818

19+
COPY --chown=1001:0 .patch_sklearn.py /opt/app-root/bin/.patch_sklearn.py
20+
ENV PYTHONSTARTUP="/opt/app-root/bin/.patch_sklearn.py"
21+
1922
RUN echo "Installing softwares and packages" && \
2023
micropipenv install && \
2124
rm -f ./Pipfile.lock && \

jupyter/intel/pytorch/ubi9-python-3.9/Dockerfile

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,21 @@ LABEL name="odh-notebook-jupyter-intel-pytorch-ubi9-python-3.9" \
1111
io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/jupyter/intel/pytorch/ubi9-python-3.9" \
1212
io.openshift.build.image="quay.io/opendatahub/workbench-images:jupyter-intel-pytorch-ubi9-python-3.9"
1313

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-compiler-dpcpp-cpp-runtime-${ONEAPI_VERSION} \
21+
intel-oneapi-mkl-${ONEAPI_VERSION} \
22+
intel-oneapi-dnnl-${ONEAPI_VERSION} && \
23+
dnf clean all -y && \
24+
rm -rf /var/cache/dnf/* && \
25+
rm /etc/yum.repos.d/oneAPI.repo
26+
27+
USER 1001
28+
1429
WORKDIR /opt/app-root/bin
1530

1631
# Install Python packages and Jupyterlab extensions from Pipfile.lock
@@ -33,10 +48,16 @@ COPY --chown=1001:0 builder /opt/app-root/builder
3348
COPY --chown=1001:0 utils /opt/app-root/bin/utils
3449

3550
#CPU env
51+
ENV CPU_ENV=/opt/app-root-cpu
52+
ENV GPU_ENV=/opt/app-root
3653
COPY --chown=1001:0 Pipfile.lock.cpu ${CPU_ENV}/Pipfile.lock
3754

3855
WORKDIR ${CPU_ENV}
39-
RUN source ${CPU_ENV}/bin/activate && \
56+
RUN python3.9 -m venv ${CPU_ENV} && \
57+
chown -R 1001:0 ${CPU_ENV} && \
58+
fix-permissions ${CPU_ENV} -P && \
59+
source ${CPU_ENV}/bin/activate && \
60+
pip install --no-cache-dir -U "micropipenv[toml]" && \
4061
micropipenv install && \
4162
rm -f ./Pipfile.lock && \
4263
python -m ipykernel install --prefix=/opt/app-root --name 'pytorch-cpu' --display-name='pytorch-cpu' && \
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[oneAPI]
2+
name=Intel® oneAPI repository
3+
baseurl=https://yum.repos.intel.com/oneapi
4+
enabled=1
5+
gpgcheck=1
6+
repo_gpgcheck=1
7+
gpgkey=https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB

jupyter/intel/tensorflow/ubi9-python-3.9/Dockerfile

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,29 @@ LABEL name="odh-notebook-jupyter-intel-tensorflow-ubi9-python-3.9" \
1111
io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/jupyter/intel/tensorflow/ubi9-python-3.9" \
1212
io.openshift.build.image="quay.io/opendatahub/workbench-images:jupyter-intel-tensorflow-ubi9-python-3.9"
1313

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-compiler-dpcpp-cpp-runtime-${ONEAPI_VERSION} \
21+
intel-oneapi-mkl-${ONEAPI_VERSION} \
22+
intel-oneapi-dnnl-${ONEAPI_VERSION} && \
23+
dnf clean all -y && \
24+
rm -rf /var/cache/dnf/* && \
25+
rm /etc/yum.repos.d/oneAPI.repo
26+
27+
USER 1001
28+
1429
WORKDIR /opt/app-root/bin
1530

1631
# Install Python packages and Jupyterlab extensions from Pipfile.lock
1732
COPY Pipfile.lock.gpu Pipfile.lock
1833

19-
RUN echo "Installing softwares and packages" && \
34+
RUN unlink /opt/app-root/lib64 && \
35+
cp -r /opt/app-root/lib /opt/app-root/lib64 && \
36+
echo "Installing softwares and packages" && \
2037
micropipenv install && \
2138
rm -f ./Pipfile.lock && \
2239
# Disable announcement plugin of jupyterlab \
@@ -32,11 +49,19 @@ COPY --chown=1001:0 builder /opt/app-root/builder
3249
COPY --chown=1001:0 utils /opt/app-root/bin/utils
3350

3451
#CPU env
52+
ENV CPU_ENV=/opt/app-root-cpu
53+
ENV GPU_ENV=/opt/app-root
3554
COPY --chown=1001:0 Pipfile.lock.cpu ${CPU_ENV}/Pipfile.lock
3655

3756
WORKDIR ${CPU_ENV}
3857

39-
RUN source ${CPU_ENV}/bin/activate && \
58+
RUN python3.9 -m venv ${CPU_ENV} && \
59+
chown -R 1001:0 ${CPU_ENV} && \
60+
fix-permissions ${CPU_ENV} -P && \
61+
unlink ${CPU_ENV}/lib64 && \
62+
cp -r ${CPU_ENV}/lib ${CPU_ENV}/lib64 && \
63+
source ${CPU_ENV}/bin/activate && \
64+
pip install --no-cache-dir -U "micropipenv[toml]" && \
4065
micropipenv install && \
4166
rm -f ./Pipfile.lock && \
4267
python -m ipykernel install --prefix=/opt/app-root --name 'tensorflow-cpu' --display-name='tensorflow-cpu' && \
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[oneAPI]
2+
name=Intel® oneAPI repository
3+
baseurl=https://yum.repos.intel.com/oneapi
4+
enabled=1
5+
gpgcheck=1
6+
repo_gpgcheck=1
7+
gpgkey=https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB

0 commit comments

Comments
 (0)