Skip to content

Commit

Permalink
Incorporate rocm-pytorch and rocm-tensorflow runtime images
Browse files Browse the repository at this point in the history
  • Loading branch information
atheo89 committed Jul 19, 2024
1 parent cdbf086 commit 419b71d
Show file tree
Hide file tree
Showing 19 changed files with 8,032 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,16 @@ amd-jupyter-tensorflow-c9s-python-3.9: amd-jupyter-datascience-c9s-python-3.9
amd-jupyter-pytorch-c9s-python-3.9: amd-jupyter-datascience-c9s-python-3.9
$(call image,$@,jupyter/amd/pytorch/ubi9-python-3.9,$<)

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

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

####################################### Buildchain for Anaconda Python #######################################

# Build and push base-anaconda-python-3.8 image to the registry
Expand Down Expand Up @@ -567,6 +577,10 @@ refresh-pipfilelock-files:
cd runtimes/pytorch/ubi8-python-3.8 && pipenv lock
cd runtimes/tensorflow/ubi8-python-3.8 && pipenv lock
cd runtimes/tensorflow/ubi9-python-3.9 && pipenv lock
cd runtimes/rocm-tensorflow/ubi9-python-3.9 && pipenv lock
cd runtimes/rocm-pytorch/ubi9-python-3.9 && pipenv lock



# This is only for the workflow action
# For running manually, set the required environment variables
Expand Down
28 changes: 28 additions & 0 deletions runtimes/rocm-pytorch/ubi9-python-3.9/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

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

WORKDIR /opt/app-root/bin

# Install Python packages from Pipfile.lock
COPY 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
60 changes: 60 additions & 0 deletions runtimes/rocm-pytorch/ubi9-python-3.9/Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[[source]]
url = "https://download.pytorch.org/whl/rocm6.0/"
verify_ssl = true
name = "pytorch"

[dev-packages]

[packages]
# PyTorch packages
tensorboard = "~=2.16.2"
torch = {version = "~=2.3.1", index = "pytorch"}
torchvision = {version = "~=0.18.1", index = "pytorch"} # https://pytorch.org/get-started/previous-versions/#linux-and-windows-1

# Datascience and useful extensions
boto3 = "~=1.34.50"
kafka-python = "~=2.0.2"
matplotlib = "~=3.8.3"
numpy = "~=1.26.4"
pandas = "~=2.2.0"
plotly = "~=5.20.0"
scikit-learn = "~=1.4.0"
scipy = "~=1.12.0"
skl2onnx = "~=1.16.0"
onnxconverter-common = "~=1.13.0" # Required for skl2onnx, as upgraded version is not compatible with protobuf
codeflare-sdk = "~=0.16.4"
memray = "~=1.10.0" # any version above this would cause issue with rich package

# DB connectors
pymongo = "~=4.6.2"
psycopg = "~=3.1.18"
pyodbc = "~=5.1.0"
mysql-connector-python = "~=8.3.0"

# This is a comprehensive list of python dependencies that Elyra requires to execute Jupyter notebooks.
ipykernel = "==6.13.0"
ipython = "==8.10.0"
ipython-genutils = "==0.2.0"
jinja2 = "==3.1.4"
jupyter-client = "==7.3.1"
jupyter-core = "==4.11.2"
MarkupSafe = "==2.1.1"
minio = "==7.1.15"
nbclient = "==0.6.3"
nbconvert = "==7.1.0"
nbformat = "==5.4.0"
papermill = "==2.3.4"
pyzmq = "==24.0.1"
prompt-toolkit = "==3.0.30"
requests = "==2.31.0"
tornado = "==6.3.3"
traitlets = "==5.1.1"
urllib3 = "==1.26.18"

[requires]
python_version = "3.9"
2,946 changes: 2,946 additions & 0 deletions runtimes/rocm-pytorch/ubi9-python-3.9/Pipfile.lock

Large diffs are not rendered by default.

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: runtime-amd-pytorch-ubi9-python-3.9
configMapGenerator:
- name: req-config
files:
- requirements-elyra.txt
29 changes: 29 additions & 0 deletions runtimes/rocm-pytorch/ubi9-python-3.9/kustomize/base/pod.yaml
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.1.4
jupyter-client==7.3.1
jupyter-core==4.11.2
MarkupSafe==2.1.1
minio==7.1.15
nbclient==0.6.3
nbconvert==7.1.0
nbformat==5.4.0
papermill==2.3.4
pyzmq==24.0.1
prompt-toolkit==3.0.30
requests==2.31.0
tornado==6.3.3
traitlets==5.1.1
urllib3==1.26.18
Loading

0 comments on commit 419b71d

Please sign in to comment.