Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split Intel AI Tools CPU and GPU images. #521

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 47 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -215,25 +215,45 @@ codeserver-ubi9-python-3.9: base-ubi9-python-3.9
intel-base-gpu-ubi9-python-3.9: base-ubi9-python-3.9
$(call image,$@,intel/base/gpu/ubi9-python-3.9,$<)

# Build and push intel-runtime-tensorflow-ubi9-python-3.9 image to the registry
.PHONY: intel-runtime-tensorflow-ubi9-python-3.9
intel-runtime-tensorflow-ubi9-python-3.9: intel-base-gpu-ubi9-python-3.9
$(call image,$@,intel/runtimes/tensorflow/ubi9-python-3.9,$<)

# Build and push jupyter-intel-tensorflow-ubi9-python-3.9 image to the registry
.PHONY: jupyter-intel-tensorflow-ubi9-python-3.9
jupyter-intel-tensorflow-ubi9-python-3.9: intel-runtime-tensorflow-ubi9-python-3.9
$(call image,$@,jupyter/intel/tensorflow/ubi9-python-3.9,$<)

# Build and push intel-runtime-pytorch-ubi9-python-3.9 image to the registry
.PHONY: intel-runtime-pytorch-ubi9-python-3.9
intel-runtime-pytorch-ubi9-python-3.9: intel-base-gpu-ubi9-python-3.9
$(call image,$@,intel/runtimes/pytorch/ubi9-python-3.9,$<)

# Build and push jupyter-intel-pytorch-ubi9-python-3.9 image to the registry
.PHONY: jupyter-intel-pytorch-ubi9-python-3.9
jupyter-intel-pytorch-ubi9-python-3.9: intel-runtime-pytorch-ubi9-python-3.9
$(call image,$@,jupyter/intel/pytorch/ubi9-python-3.9,$<)
# Build and push intel-runtime-tensorflow-cpu-ubi9-python-3.9 image to the registry
.PHONY: intel-runtime-tensorflow-cpu-ubi9-python-3.9
intel-runtime-tensorflow-cpu-ubi9-python-3.9: base-ubi9-python-3.9
$(call image,$@,intel/runtimes/tensorflow/cpu/ubi9-python-3.9,$<)

# Build and push jupyter-intel-tensorflow-cpu-ubi9-python-3.9 image to the registry
.PHONY: jupyter-intel-tensorflow-cpu-ubi9-python-3.9
jupyter-intel-tensorflow-cpu-ubi9-python-3.9: base-ubi9-python-3.9
$(call image,$@,jupyter/intel/tensorflow/cpu/ubi9-python-3.9,$<)

# Build and push intel-runtime-tensorflow-xpu-ubi9-python-3.9 image to the registry
.PHONY: intel-runtime-tensorflow-xpu-ubi9-python-3.9
intel-runtime-tensorflow-xpu-ubi9-python-3.9: intel-base-gpu-ubi9-python-3.9
$(call image,$@,intel/runtimes/tensorflow/xpu/ubi9-python-3.9,$<)

# Build and push jupyter-intel-tensorflow-xpu-ubi9-python-3.9 image to the registry
.PHONY: jupyter-intel-tensorflow-xpu-ubi9-python-3.9
jupyter-intel-tensorflow-xpu-ubi9-python-3.9: intel-base-gpu-ubi9-python-3.9
$(call image,$@,jupyter/intel/tensorflow/xpu/ubi9-python-3.9,$<)

# Build and push intel-runtime-pytorch-cpu-ubi9-python-3.9 image to the registry
.PHONY: intel-runtime-pytorch-cpu-ubi9-python-3.9
intel-runtime-pytorch-cpu-ubi9-python-3.9: base-ubi9-python-3.9
$(call image,$@,intel/runtimes/pytorch/cpu/ubi9-python-3.9,$<)

# Build and push jupyter-intel-pytorch-cpu-ubi9-python-3.9 image to the registry
.PHONY: jupyter-intel-pytorch-cpu-ubi9-python-3.9
jupyter-intel-pytorch-cpu-ubi9-python-3.9: base-ubi9-python-3.9
$(call image,$@,jupyter/intel/pytorch/cpu/ubi9-python-3.9,$<)

# Build and push intel-runtime-pytorch-xpu-ubi9-python-3.9 image to the registry
.PHONY: intel-runtime-pytorch-xpu-ubi9-python-3.9
intel-runtime-pytorch-xpu-ubi9-python-3.9: intel-base-gpu-ubi9-python-3.9
$(call image,$@,intel/runtimes/pytorch/xpu/ubi9-python-3.9,$<)

# Build and push jupyter-intel-pytorch-xpu-ubi9-python-3.9 image to the registry
.PHONY: jupyter-intel-pytorch-xpu-ubi9-python-3.9
jupyter-intel-pytorch-xpu-ubi9-python-3.9: intel-base-gpu-ubi9-python-3.9
$(call image,$@,jupyter/intel/pytorch/xpu/ubi9-python-3.9,$<)

# Build and push intel-runtime-ml-ubi9-python-3.9 image to the registry
.PHONY: intel-runtime-ml-ubi9-python-3.9
Expand Down Expand Up @@ -393,10 +413,14 @@ test-%: bin/kubectl
# Tests notebook's functionalities
if echo "$(FULL_NOTEBOOK_NAME)" | grep -q "minimal-ubi9"; then \
$(call test_with_papermill,minimal,ubi9,python-3.9) \
elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "intel-tensorflow-ubi9"; then \
$(call test_with_papermill,intel/tensorflow,ubi9,python-3.9) \
elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "intel-pytorch-ubi9"; then \
$(call test_with_papermill,intel/pytorch,ubi9,python-3.9) \
elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "intel-tf-cpu-ubi9"; then \
$(call test_with_papermill,intel/tensorflow/cpu,ubi9,python-3.9) \
elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "intel-tf-xpu-ubi9"; then \
$(call test_with_papermill,intel/tensorflow/xpu,ubi9,python-3.9) \
elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "intel-pt-cpu-ubi9"; then \
$(call test_with_papermill,intel/pytorch/cpu,ubi9,python-3.9) \
elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "intel-pt-xpu-ubi9"; then \
$(call test_with_papermill,intel/pytorch/xpu,ubi9,python-3.9) \
elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "datascience-ubi9"; then \
$(MAKE) validate-ubi9-datascience -e FULL_NOTEBOOK_NAME=$(FULL_NOTEBOOK_NAME); \
elif echo "$(FULL_NOTEBOOK_NAME)" | grep -q "pytorch-ubi9"; then \
Expand Down
4 changes: 2 additions & 2 deletions intel/base/gpu/ubi9-python-3.9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ LABEL name="odh-notebook-intel-base-gpu-ubi9-python-3.9" \
io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/intel/base/gpu/ubi9-python-3.9" \
io.openshift.build.image="quay.io/opendatahub/workbench-images:intel-base-gpu-ubi9-python-3.9"

USER 0
USER root
WORKDIR /opt/app-root/src

RUN . /etc/os-release && \
dnf install -y 'dnf-command(config-manager)' && \
dnf config-manager --add-repo \
https://repositories.intel.com/gpu/rhel/${VERSION_ID}/lts/2350/unified/intel-gpu-${VERSION_ID}.repo && \
https://repositories.intel.com/gpu/rhel/9.3/lts/2350/unified/intel-gpu-9.3.repo && \
sharvil10 marked this conversation as resolved.
Show resolved Hide resolved
dnf install -y \
intel-opencl \
level-zero intel-level-zero-gpu level-zero-devel \
Expand Down
31 changes: 31 additions & 0 deletions intel/runtimes/pytorch/cpu/ubi9-python-3.9/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

LABEL name="odh-notebook-intel-runtime-pytorch-cpu-ubi9-python-3.9" \
summary="Runtime Intel® optimized PyTorch CPU notebook image for for ODH notebooks" \
description="Runtime Intel® optimized PyTorch CPU notebook image with base Python 3.9 builder image based on UBI9 for ODH notebooks" \
io.k8s.display-name="Runtime Intel® optimized PyTorch CPU notebook image for ODH notebooks" \
io.k8s.description="Runtime Intel® optimized PyTorch CPU notebook image with base Python 3.9 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/intel/runtimes/pytorch/cpu/ubi9-python-3.9" \
io.openshift.build.image="quay.io/opendatahub/workbench-images:intel-runtime-pytorch-cpu-ubi9-python-3.9"

USER 1001

WORKDIR /opt/app-root/bin

# Install Python packages from Pipfile.lock
COPY --chown=1001:0 Pipfile.lock Pipfile.lock

# Copy Elyra dependencies for air-gapped enviroment
COPY utils utils

RUN echo "Installing softwares and packages" && \
micropipenv install && \
rm -f ./Pipfile.lock && \
# Fix permissions to support pip in Openshift environments \
chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
fix-permissions /opt/app-root -P

WORKDIR /opt/app-root/src
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ resources:
images:
- name: runtime-workbench
newName: quay.io/opendatahub/workbench-images
newTag: intel-runtime-pytorch-ubi9-python-3.9
newTag: intel-runtime-pytorch-cpu-ubi9-python-3.9
configMapGenerator:
- name: req-config
files:
Expand Down
60 changes: 0 additions & 60 deletions intel/runtimes/pytorch/ubi9-python-3.9/Dockerfile

This file was deleted.

44 changes: 44 additions & 0 deletions intel/runtimes/pytorch/xpu/ubi9-python-3.9/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

LABEL name="odh-notebook-intel-runtime-pytorch-xpu-ubi9-python-3.9" \
summary="Runtime Intel® optimized pytorch XPU notebook image for ODH notebooks" \
description="Runtime Intel® optimized pytorch XPU notebook image with base Python 3.9 builder image based on UBI9 for ODH notebooks" \
io.k8s.display-name="Runtime Intel® optimized pytorch XPU notebook image for ODH notebooks" \
io.k8s.description="Runtime Intel® optimized pytorch XPU notebook image with base Python 3.9 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/intel/runtimes/pytorch/xpu/ubi9-python-3.9" \
io.openshift.build.image="quay.io/opendatahub/workbench-images:intel-runtime-pytorch-xpu-ubi9-python-3.9"

USER root

ARG ONEAPI_VERSION=2024.0
COPY oneAPI.repo /etc/yum.repos.d/oneAPI.repo

RUN dnf update -y && \
dnf install -y intel-oneapi-compiler-dpcpp-cpp-runtime-${ONEAPI_VERSION} \
intel-oneapi-mkl-${ONEAPI_VERSION} \
intel-oneapi-dnnl-${ONEAPI_VERSION} && \
dnf clean all -y && \
rm -rf /var/cache/dnf/* && \
rm /etc/yum.repos.d/oneAPI.repo

USER 1001

WORKDIR /opt/app-root/bin

# Install Python packages from Pipfile.lock
COPY Pipfile.lock Pipfile.lock

# Copy Elyra dependencies for air-gapped enviroment
COPY utils utils

RUN echo "Installing softwares and packages" && \
micropipenv install && \
rm -f ./Pipfile.lock && \
# Fix permissions to support pip in Openshift environments \
chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
fix-permissions /opt/app-root -P

WORKDIR /opt/app-root/src
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ resources:
images:
- name: runtime-workbench
newName: quay.io/opendatahub/workbench-images
newTag: intel-runtime-tensorflow-ubi9-python-3.9
newTag: intel-runtime-pytorch-xpu-ubi9-python-3.9
configMapGenerator:
- name: req-config
files:
Expand Down
33 changes: 33 additions & 0 deletions intel/runtimes/tensorflow/cpu/ubi9-python-3.9/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

LABEL name="odh-notebook-intel-runtime-tensorflow-cpu-ubi9-python-3.9" \
summary="Runtime Intel® optimized TensorFlow CPU notebook image for ODH notebooks" \
description="Runtime Intel® optimized TesorFlow CPU notebook image with base Python 3.9 builder image based on UBI9 for ODH notebooks" \
io.k8s.display-name="Runtime Intel® optimized TensorFlow CPU notebook image for ODH notebooks" \
io.k8s.description="Runtime Intel® optimized TensorFlow CPU notebook image with base Python 3.9 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/intel/runtimes/tensorflow/cpu/ubi9-python-3.9" \
io.openshift.build.image="quay.io/opendatahub/workbench-images:intel-runtime-tensorflow-cpu-ubi9-python-3.9"

USER 1001

WORKDIR /opt/app-root/bin

# Install Python packages from Pipfile.lock
COPY --chown=1001:0 Pipfile.lock Pipfile.lock

# Copy Elyra dependencies for air-gapped enviroment
COPY utils utils

RUN unlink /opt/app-root/lib64 && \
cp -r /opt/app-root/lib /opt/app-root/lib64 && \
echo "Installing softwares and packages" && \
micropipenv install && \
rm -f ./Pipfile.lock && \
# Fix permissions to support pip in Openshift environments \
chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
fix-permissions /opt/app-root -P

WORKDIR /opt/app-root/src
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namePrefix: runtime-
resources:
- pod.yaml
images:
- name: runtime-workbench
newName: quay.io/opendatahub/workbench-images
newTag: intel-runtime-tensorflow-cpu-ubi9-python-3.9
configMapGenerator:
- name: req-config
files:
- requirements-elyra.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
apiVersion: v1
kind: Pod
metadata:
name: pod
labels:
app: runtime-image
spec:
containers:
- name: runtime
image: runtime-workbench
command: ["/bin/sh", "-c", "while true ; do date; sleep 1; done;"]
imagePullPolicy: Always
ports:
- containerPort: 8080
resources:
limits:
cpu: 500m
memory: 500Mi
requests:
cpu: 500m
memory: 500Mi
volumeMounts:
- name: config
mountPath: /opt/app-root/elyra
volumes:
- name: config
configMap:
name: req-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This is a comprehensive list of python dependencies that Elyra requires to execute Jupyter notebooks.
# This is copied from elyra directly: https://github.com/elyra-ai/elyra/blob/main/etc/generic/requirements-elyra.txt
ipykernel==6.13.0
ipython==8.10.0
ipython-genutils==0.2.0
jinja2==3.0.3
jupyter-client==7.3.1
jupyter-core==4.11.2
MarkupSafe==2.1.1
minio==7.1.15
nbclient==0.6.3
nbconvert==6.5.1
nbformat==5.4.0
papermill==2.3.4
pyzmq==24.0.1
prompt-toolkit==3.0.30
requests==2.27.1
tornado==6.3.3
traitlets==5.1.1
urllib3==1.26.9
Loading