Skip to content

RHOAIENG-28583: Create Runtime Images for Python 3.12 #1333

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

Merged
merged 7 commits into from
Jul 9, 2025
Merged
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
30 changes: 15 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -416,17 +416,18 @@ else ifeq ($(PYTHON_VERSION), 3.12)
jupyter/datascience/ubi9-python-$(PYTHON_VERSION) \
jupyter/pytorch/ubi9-python-$(PYTHON_VERSION) \
jupyter/tensorflow/ubi9-python-$(PYTHON_VERSION) \
jupyter/trustyai/ubi9-python-$(PYTHON_VERSION) \
jupyter/rocm/pytorch/ubi9-python-$(PYTHON_VERSION) \
codeserver/ubi9-python-$(PYTHON_VERSION) \
jupyter/rocm/pytorch/ubi9-python-$(PYTHON_VERSION) \
jupyter/trustyai/ubi9-python-$(PYTHON_VERSION)
runtimes/minimal/ubi9-python-$(PYTHON_VERSION) \
runtimes/datascience/ubi9-python-$(PYTHON_VERSION) \
runtimes/pytorch/ubi9-python-$(PYTHON_VERSION) \
runtimes/tensorflow/ubi9-python-$(PYTHON_VERSION) \
runtimes/rocm-pytorch/ubi9-python-$(PYTHON_VERSION)
# jupyter/rocm/tensorflow/ubi9-python-$(PYTHON_VERSION)
# runtimes/minimal/ubi9-python-$(PYTHON_VERSION)
# runtimes/datascience/ubi9-python-$(PYTHON_VERSION)
# runtimes/pytorch/ubi9-python-$(PYTHON_VERSION)
# runtimes/tensorflow/ubi9-python-$(PYTHON_VERSION)
# rstudio/rhel9-python-$(PYTHON_VERSION)
# rstudio/c9s-python-$(PYTHON_VERSION)
# runtimes/rocm-tensorflow/ubi9-python-$(PYTHON_VERSION)
# runtimes/rocm-pytorch/ubi9-python-$(PYTHON_VERSION)
else
$(error Invalid Python version $(PYTHON_VERSION))
endif
Expand Down Expand Up @@ -505,21 +506,20 @@ all-images: \
cuda-jupyter-minimal-ubi9-python-$(RELEASE_PYTHON_VERSION) \
cuda-jupyter-tensorflow-ubi9-python-$(RELEASE_PYTHON_VERSION) \
cuda-jupyter-pytorch-ubi9-python-$(RELEASE_PYTHON_VERSION) \
rocm-jupyter-pytorch-ubi9-python-$(RELEASE_PYTHON_VERSION) \
codeserver-ubi9-python-$(RELEASE_PYTHON_VERSION) \
jupyter-trustyai-ubi9-python-$(RELEASE_PYTHON_VERSION) \
runtime-minimal-ubi9-python-$(RELEASE_PYTHON_VERSION) \
runtime-datascience-ubi9-python-$(RELEASE_PYTHON_VERSION) \
runtime-cuda-pytorch-ubi9-python-$(RELEASE_PYTHON_VERSION) \
runtime-cuda-tensorflow-ubi9-python-$(RELEASE_PYTHON_VERSION) \
rocm-jupyter-minimal-ubi9-python-$(RELEASE_PYTHON_VERSION) \
rocm-jupyter-pytorch-ubi9-python-$(RELEASE_PYTHON_VERSION) \
jupyter-trustyai-ubi9-python-$(RELEASE_PYTHON_VERSION)
# runtime-minimal-ubi9-python-$(RELEASE_PYTHON_VERSION)
# runtime-datascience-ubi9-python-$(RELEASE_PYTHON_VERSION)
# runtime-cuda-pytorch-ubi9-python-$(RELEASE_PYTHON_VERSION)
# runtime-cuda-tensorflow-ubi9-python-$(RELEASE_PYTHON_VERSION)
rocm-runtime-pytorch-ubi9-python-$(RELEASE_PYTHON_VERSION)
# rstudio-c9s-python-$(RELEASE_PYTHON_VERSION)
# cuda-rstudio-c9s-python-$(RELEASE_PYTHON_VERSION)
# rstudio-rhel9-python-$(RELEASE_PYTHON_VERSION)
# cuda-rstudio-rhel9-python-$(RELEASE_PYTHON_VERSION)
# rocm-jupyter-minimal-ubi9-python-$(RELEASE_PYTHON_VERSION)
# rocm-jupyter-tensorflow-ubi9-python-$(RELEASE_PYTHON_VERSION)
# rocm-runtime-pytorch-ubi9-python-$(RELEASE_PYTHON_VERSION)
# rocm-runtime-tensorflow-ubi9-python-$(RELEASE_PYTHON_VERSION)
else
$(error Invalid Python version $(RELEASE_PYTHON_VERSION))
Expand Down
8 changes: 4 additions & 4 deletions manifests/base/runtime-datascience-imagestream.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
opendatahub.io/runtime-image: "true"
annotations:
opendatahub.io/runtime-image-url: "https://github.com//opendatahub-io/notebooks/tree/main/runtimes"
opendatahub.io/runtime-image-name: "Datascience with Python 3.11 (UBI9)"
opendatahub.io/runtime-image-name: "Datascience with Python 3.12 (UBI9)"
opendatahub.io/runtime-image-desc: "Datascience runtime image for Elyra, enabling pipeline execution from Workbenches with a set of advanced AI/ML data science libraries, supporting different runtimes for various pipeline nodes."
name: runtime-datascience
spec:
Expand All @@ -18,12 +18,12 @@ spec:
opendatahub.io/runtime-image-metadata: |
[
{
"display_name": "Datascience with Python 3.11 (UBI9)",
"display_name": "Datascience with Python 3.12 (UBI9)",
"metadata": {
"tags": [
"datascience"
],
"display_name": "Datascience with Python 3.11 (UBI9)",
"display_name": "Datascience with Python 3.12 (UBI9)",
"pull_policy": "IfNotPresent"
},
"schema_name": "runtime-image"
Expand All @@ -32,7 +32,7 @@ spec:
openshift.io/imported-from: quay.io/opendatahub/workbench-images
from:
kind: DockerImage
name: odh-pipeline-runtime-datascience-cpu-py311-ubi9-n_PLACEHOLDER
name: odh-pipeline-runtime-datascience-cpu-py312-ubi9-n_PLACEHOLDER
name: "datascience"
referencePolicy:
type: Source
8 changes: 4 additions & 4 deletions manifests/base/runtime-minimal-imagestream.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
opendatahub.io/runtime-image: "true"
annotations:
opendatahub.io/runtime-image-url: "https://github.com//opendatahub-io/notebooks/tree/main/runtimes"
opendatahub.io/runtime-image-name: "Python 3.11 (UBI9)"
opendatahub.io/runtime-image-name: "Python 3.12 (UBI9)"
opendatahub.io/runtime-image-desc: "Minimal runtime image for Elyra, enabling pipeline execution from Workbenches with minimal dependency set to start experimenting with, for various pipeline nodes."
name: runtime-minimal
spec:
Expand All @@ -18,12 +18,12 @@ spec:
opendatahub.io/runtime-image-metadata: |
[
{
"display_name": "Python 3.11 (UBI9)",
"display_name": "Python 3.12 (UBI9)",
"metadata": {
"tags": [
"minimal"
],
"display_name": "Python 3.11 (UBI9)",
"display_name": "Python 3.12 (UBI9)",
"pull_policy": "IfNotPresent"
},
"schema_name": "runtime-image"
Expand All @@ -32,7 +32,7 @@ spec:
openshift.io/imported-from: quay.io/opendatahub/workbench-images
from:
kind: DockerImage
name: odh-pipeline-runtime-minimal-cpu-py311-ubi9-n_PLACEHOLDER
name: odh-pipeline-runtime-minimal-cpu-py312-ubi9-n_PLACEHOLDER
name: "minimal"
referencePolicy:
type: Source
8 changes: 4 additions & 4 deletions manifests/base/runtime-pytorch-imagestream.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
opendatahub.io/runtime-image: "true"
annotations:
opendatahub.io/runtime-image-url: "https://github.com//opendatahub-io/notebooks/tree/main/runtimes"
opendatahub.io/runtime-image-name: "PyTorch with CUDA and Python 3.11 (UBI9)"
opendatahub.io/runtime-image-name: "PyTorch with CUDA and Python 3.12 (UBI9)"
opendatahub.io/runtime-image-desc: "PyTorch runtime image for Elyra, enabling pipeline execution from Workbenches with PyTorch libraries and dependencies, supporting different runtimes for various pipeline nodes."
name: runtime-pytorch
spec:
Expand All @@ -18,12 +18,12 @@ spec:
opendatahub.io/runtime-image-metadata: |
[
{
"display_name": "PyTorch with CUDA and Python 3.11 (UBI9)",
"display_name": "PyTorch with CUDA and Python 3.12 (UBI9)",
"metadata": {
"tags": [
"pytorch"
],
"display_name": "PyTorch with CUDA and Python 3.11 (UBI9)",
"display_name": "PyTorch with CUDA and Python 3.12 (UBI9)",
"pull_policy": "IfNotPresent"
},
"schema_name": "runtime-image"
Expand All @@ -32,7 +32,7 @@ spec:
openshift.io/imported-from: quay.io/opendatahub/workbench-images
from:
kind: DockerImage
name: odh-pipeline-runtime-pytorch-cuda-py311-ubi9-n_PLACEHOLDER
name: odh-pipeline-runtime-pytorch-cuda-py312-ubi9-n_PLACEHOLDER
name: "pytorch"
referencePolicy:
type: Source
8 changes: 4 additions & 4 deletions manifests/base/runtime-rocm-pytorch-imagestream.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
opendatahub.io/runtime-image: "true"
annotations:
opendatahub.io/runtime-image-url: "https://github.com//opendatahub-io/notebooks/tree/main/runtimes"
opendatahub.io/runtime-image-name: "PyTorch with ROCm and Python 3.11 (UBI9)"
opendatahub.io/runtime-image-name: "PyTorch with ROCm and Python 3.12 (UBI9)"
opendatahub.io/runtime-image-desc: "ROCm optimized PyTorch runtime image for Elyra, enabling pipeline execution from Workbenches with PyTorch libraries and dependencies, supporting different runtimes for various pipeline nodes."
name: runtime-rocm-pytorch
spec:
Expand All @@ -18,12 +18,12 @@ spec:
opendatahub.io/runtime-image-metadata: |
[
{
"display_name": "PyTorch with ROCm and Python 3.11 (UBI9)",
"display_name": "PyTorch with ROCm and Python 3.12 (UBI9)",
"metadata": {
"tags": [
"rocm-pytorch"
],
"display_name": "PyTorch with ROCm and Python 3.11 (UBI9)",
"display_name": "PyTorch with ROCm and Python 3.12 (UBI9)",
"pull_policy": "IfNotPresent"
},
"schema_name": "runtime-image"
Expand All @@ -32,7 +32,7 @@ spec:
openshift.io/imported-from: quay.io/opendatahub/workbench-images
from:
kind: DockerImage
name: odh-pipeline-runtime-pytorch-rocm-py311-ubi9-n_PLACEHOLDER
name: odh-pipeline-runtime-pytorch-rocm-py312-ubi9-n_PLACEHOLDER
name: "rocm-pytorch"
referencePolicy:
type: Source
8 changes: 4 additions & 4 deletions manifests/base/runtime-rocm-tensorflow-imagestream.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
annotations:
# TODO: once the restraction takes a final shape need to update that url
opendatahub.io/runtime-image-url: "https://github.com//opendatahub-io/notebooks/tree/main/runtimes"
opendatahub.io/runtime-image-name: "TensorFlow with ROCm and Python 3.11 (UBI9)"
opendatahub.io/runtime-image-name: "TensorFlow with ROCm and Python 3.12 (UBI9)"
opendatahub.io/runtime-image-desc: "ROCm optimized TensorFlow runtime image for Elyra, enabling pipeline execution from Workbenches with TensorFlow libraries and dependencies, supporting different runtimes for various pipeline nodes."
name: runtime-rocm-tensorflow
spec:
Expand All @@ -19,12 +19,12 @@ spec:
opendatahub.io/runtime-image-metadata: |
[
{
"display_name": "TensorFlow with ROCm and Python 3.11 (UBI9)",
"display_name": "TensorFlow with ROCm and Python 3.12 (UBI9)",
"metadata": {
"tags": [
"rocm-tensorflow"
],
"display_name": "TensorFlow with ROCm and Python 3.11 (UBI9)",
"display_name": "TensorFlow with ROCm and Python 3.12 (UBI9)",
"pull_policy": "IfNotPresent"
},
"schema_name": "runtime-image"
Expand All @@ -33,7 +33,7 @@ spec:
openshift.io/imported-from: quay.io/opendatahub/workbench-images
from:
kind: DockerImage
name: odh-pipeline-runtime-tensorflow-rocm-py311-ubi9-n_PLACEHOLDER
name: odh-pipeline-runtime-tensorflow-rocm-py312-ubi9-n_PLACEHOLDER
name: "rocm-tensorflow"
referencePolicy:
type: Source
8 changes: 4 additions & 4 deletions manifests/base/runtime-tensorflow-imagestream.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
annotations:
# TODO: once the restraction takes a final shape need to update that url
opendatahub.io/runtime-image-url: "https://github.com//opendatahub-io/notebooks/tree/main/runtimes"
opendatahub.io/runtime-image-name: "TensorFlow with CUDA and Python 3.11 (UBI9)"
opendatahub.io/runtime-image-name: "TensorFlow with CUDA and Python 3.12 (UBI9)"
opendatahub.io/runtime-image-desc: "TensorFlow runtime image for Elyra, enabling pipeline execution from Workbenches with TensorFlow libraries and dependencies, supporting different runtimes for various pipeline nodes."
name: runtime-tensorflow
spec:
Expand All @@ -19,12 +19,12 @@ spec:
opendatahub.io/runtime-image-metadata: |
[
{
"display_name": "TensorFlow with CUDA and Python 3.11 (UBI9)",
"display_name": "TensorFlow with CUDA and Python 3.12 (UBI9)",
"metadata": {
"tags": [
"tensorflow"
],
"display_name": "TensorFlow with CUDA and Python 3.11 (UBI9)",
"display_name": "TensorFlow with CUDA and Python 3.12 (UBI9)",
"pull_policy": "IfNotPresent"
},
"schema_name": "runtime-image"
Expand All @@ -33,7 +33,7 @@ spec:
openshift.io/imported-from: quay.io/opendatahub/workbench-images
from:
kind: DockerImage
name: odh-pipeline-runtime-tensorflow-cuda-py311-ubi9-n_PLACEHOLDER
name: odh-pipeline-runtime-tensorflow-cuda-py312-ubi9-n_PLACEHOLDER
name: "tensorflow"
referencePolicy:
type: Source
57 changes: 57 additions & 0 deletions runtimes/datascience/ubi9-python-3.12/Dockerfile.cpu
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
####################
# base #
####################
FROM registry.access.redhat.com/ubi9/python-312:latest AS base

WORKDIR /opt/app-root/bin

# OS Packages needs to be installed as root
USER 0

# Install useful OS packages
RUN dnf install -y mesa-libGL skopeo && dnf clean all && rm -rf /var/cache/yum

# Other apps and tools installed as default user
USER 1001

# Install micropipenv to deploy packages from Pipfile.lock
RUN pip install --no-cache-dir -U "micropipenv[toml]"

# Install the oc client
RUN curl -L https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/ocp/stable/openshift-client-linux.tar.gz \
-o /tmp/openshift-client-linux.tar.gz && \
tar -xzvf /tmp/openshift-client-linux.tar.gz oc && \
rm -f /tmp/openshift-client-linux.tar.gz

#######################
# runtime-datascience #
#######################
FROM base AS runtime-datascience

ARG DATASCIENCE_SOURCE_CODE=runtimes/datascience/ubi9-python-3.12

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

WORKDIR /opt/app-root/bin

# Install Python packages from Pipfile.lock
COPY ${DATASCIENCE_SOURCE_CODE}/Pipfile.lock ./
# Copy Elyra dependencies for air-gapped enviroment
COPY ${DATASCIENCE_SOURCE_CODE}/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.12/site-packages && \
fix-permissions /opt/app-root -P

WORKDIR /opt/app-root/src
53 changes: 53 additions & 0 deletions runtimes/datascience/ubi9-python-3.12/Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[dev-packages]

[packages]
# Datascience and useful extensions
boto3 = "~=1.37.8"
kafka-python-ng = "~=2.2.3"
matplotlib = "~=3.10.1"
numpy = "~=2.2.3"
pandas = "~=2.2.3"
plotly = "~=6.0.0"
scikit-learn = "~=1.6.1"
scipy = "~=1.15.2"
skl2onnx = "~=1.18.0"
onnxconverter-common = "~=1.13.0" # Required for skl2onnx, as upgraded version is not compatible with protobuf
codeflare-sdk = "~=0.29.0"

# DB connectors
pymongo = "~=4.11.2"
psycopg = "~=3.2.5"
pyodbc = "~=5.2.0"
mysql-connector-python = "~=9.3.0"

# This is a comprehensive list of python dependencies that Elyra requires to execute Jupyter notebooks.
ipykernel = "~=6.29.5"
ipython = "~=9.0.1"
ipython-genutils = "~=0.2.0"
jinja2 = "~=3.1.6"
jupyter-client = ">=8.6.3"
jupyter-core = "~=5.7.2"
MarkupSafe = "~=3.0.2"
minio = "~=7.2.15"
nbclient = "~=0.10.2"
nbconvert = "~=7.16.6"
nbformat = "~=5.10.4"
papermill = "~=2.6.0"
pyzmq = "~=26.2.1"
prompt-toolkit = "~=3.0.50"
requests = "~=2.32.3"
tornado = "~=6.5.1"
traitlets = "~=5.14.3"
urllib3 = "~=2.5.0"

# Base packages
setuptools = "==78.1.1"
wheel = "==0.45.1"

[requires]
python_version = "3.12"
Loading
Loading