Skip to content

Commit 9f0a837

Browse files
dibryantatheo89harshad16
authored
Setup build images for Pytorch & Tensorflow with base ROCm image (#557)
* Setup build images for AMD Pytorch & Tensorflow with base ROCm image * Commit piplock for amd pytorch * Update the pipfile.lock with AMD supported torch and tf * Update the Makefile to have AMD structure corrected --------- Signed-off-by: Diamond Bryant <[email protected]> Co-authored-by: atheo89 <[email protected]> Co-authored-by: Harshad Reddy Nalla <[email protected]>
1 parent bbba58c commit 9f0a837

File tree

15 files changed

+9095
-0
lines changed

15 files changed

+9095
-0
lines changed

Makefile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,32 @@ rstudio-c9s-python-3.9: base-c9s-python-3.9
267267
cuda-rstudio-c9s-python-3.9: cuda-c9s-python-3.9
268268
$(call image,$@,rstudio/c9s-python-3.9,$<)
269269

270+
####################################### Buildchain for AMD Python 3.9 using C9S #######################################
271+
.PHONY: amd-c9s-python-3.9
272+
amd-c9s-python-3.9: base-c9s-python-3.9
273+
$(call image,$@,amd/c9s-python-3.9,$<)
274+
275+
# We are only using c9s base image here onwards,
276+
# DON'T confuse due to the ubi9 mention, it just directory name.
277+
.PHONY: amd-minimal-c9s-python-3.9
278+
amd-minimal-c9s-python-3.9: amd-c9s-python-3.9
279+
$(call image,$@,jupyter/minimal/ubi9-python-3.9,$<)
280+
281+
# Build and push cuda-jupyter-datascience-ubi9-python-3.9 image to the registry
282+
.PHONY: amd-jupyter-datascience-c9s-python-3.9
283+
amd-jupyter-datascience-c9s-python-3.9: amd-jupyter-minimal-ubi9-python-3.9
284+
$(call image,$@,jupyter/datascience/ubi9-python-3.9,$<)
285+
286+
# Build and push cuda-jupyter-tensorflow-ubi9-python-3.9 image to the registry
287+
.PHONY: amd-jupyter-tensorflow-c9s-python-3.9
288+
amd-jupyter-tensorflow-c9s-python-3.9: amd-jupyter-datascience-c9s-python-3.9
289+
$(call image,$@,jupyter/amd/tensorflow/ubi9-python-3.9,$<)
290+
291+
# Build and push jupyter-pytorch-ubi9-python-3.9 image to the registry
292+
.PHONY: amd-jupyter-pytorch-c9s-python-3.9
293+
amd-jupyter-pytorch-c9s-python-3.9: amd-jupyter-datascience-c9s-python-3.9
294+
$(call image,$@,jupyter/amd/pytorch/ubi9-python-3.9,$<)
295+
270296
####################################### Buildchain for Anaconda Python #######################################
271297

272298
# Build and push base-anaconda-python-3.8 image to the registry
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
ARG BASE_IMAGE
2+
FROM ${BASE_IMAGE}
3+
4+
LABEL name="odh-notebook-jupyter-amd-pytorch-ubi9-python-3.9" \
5+
summary="Jupyter AMD pytorch notebook image for ODH notebooks" \
6+
description="Jupyter AMD pytorch notebook image with base Python 3.9 builder image based on UBI9 for ODH notebooks" \
7+
io.k8s.display-name="Jupyter AMD pytorch notebook image for ODH notebooks" \
8+
io.k8s.description="Jupyter AMD pytorch 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/jupyter/amd/pytorch/ubi9-python-3.9" \
12+
io.openshift.build.image="quay.io/opendatahub/workbench-images:jupyter-amd-pytorch-ubi9-python-3.9"
13+
14+
# Install Python packages and Jupyterlab extensions from Pipfile.lock
15+
COPY Pipfile.lock ./
16+
17+
RUN echo "Installing softwares and packages" && \
18+
micropipenv install && \
19+
rm -f ./Pipfile.lock && \
20+
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y \
21+
sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json && \
22+
# Disable announcement plugin of jupyterlab \
23+
jupyter labextension disable "@jupyterlab/apputils-extension:announcements"
24+
25+
# Fix permissions to support pip in Openshift environments
26+
RUN chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
27+
fix-permissions /opt/app-root -P
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[[source]]
7+
url = "https://download.pytorch.org/whl/rocm6.0/"
8+
verify_ssl = true
9+
name = "pytorch"
10+
11+
[dev-packages]
12+
13+
[packages]
14+
# PyTorch packages
15+
tensorboard = "~=2.16.2"
16+
torch = {version = "~=2.3.1", index = "pytorch"}
17+
torchvision = {version = "~=0.18.1", index = "pytorch"} # https://pytorch.org/get-started/previous-versions/#linux-and-windows-1
18+
19+
# Datascience and useful extensions
20+
boto3 = "~=1.34.50"
21+
kafka-python = "~=2.0.2"
22+
matplotlib = "~=3.8.3"
23+
numpy = "~=1.26.4"
24+
pandas = "~=2.2.0"
25+
plotly = "~=5.20.0"
26+
scikit-learn = "~=1.4.0"
27+
scipy = "~=1.12.0"
28+
skl2onnx = "~=1.16.0"
29+
onnxconverter-common = "~=1.13.0" # Required for skl2onnx, as upgraded version is not compatible with protobuf
30+
codeflare-sdk = "~=0.15.1"
31+
32+
# DB connectors
33+
pymongo = "~=4.6.2"
34+
psycopg = "~=3.1.18"
35+
pyodbc = "~=5.1.0"
36+
mysql-connector-python = "~=8.3.0"
37+
38+
# JupyterLab packages
39+
odh-elyra = "~=3.16.5"
40+
jupyterlab = "~=3.6.7" # Wait on upgrade till plugins are ready
41+
jupyter-bokeh = "~=3.0.7" # Upgrade would bring in jupyterlab 4
42+
jupyter-server = "~=2.13.0"
43+
jupyter-server-proxy = "~=4.0.0" # Upgrade would bring in jupyterlab 4
44+
jupyter-server-terminals = "~=0.5.3"
45+
jupyterlab-git = "~=0.44.0"
46+
jupyterlab-lsp = "~=4.2.0"
47+
jupyterlab-widgets = "~=3.0.10"
48+
jupyter-resource-usage = "~=0.7.2"
49+
nbdime = "~=3.2.1"
50+
nbgitpuller = "~=1.2.0"
51+
# Base packages
52+
wheel = "~=0.43.0"
53+
setuptools = "~=69.2.0"
54+
55+
# conflict between python-lsp-server and following packages
56+
# due to pycodestyle dependency, pinning this, till we get
57+
# a fix from python-lsp-server
58+
autopep8 = "~=2.0.4"
59+
flake8 = "~=7.0.0"
60+
61+
[requires]
62+
python_version = "3.9"

0 commit comments

Comments
 (0)