Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 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
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -433,16 +433,16 @@ else ifeq ($(PYTHON_VERSION), 3.12)
runtimes/pytorch/ubi9-python-$(PYTHON_VERSION) \
runtimes/tensorflow/ubi9-python-$(PYTHON_VERSION) \
runtimes/rocm-pytorch/ubi9-python-$(PYTHON_VERSION) \
runtimes/pytorch+llmcompressor/ubi9-python-$(PYTHON_VERSION)
# runtimes/rocm-tensorflow/ubi9-python-$(PYTHON_VERSION)
# jupyter/rocm/tensorflow/ubi9-python-$(PYTHON_VERSION)
runtimes/pytorch+llmcompressor/ubi9-python-$(PYTHON_VERSION) \
runtimes/rocm-tensorflow/ubi9-python-$(PYTHON_VERSION) \
jupyter/rocm/tensorflow/ubi9-python-$(PYTHON_VERSION)
# rstudio/rhel9-python-$(PYTHON_VERSION)
# rstudio/c9s-python-$(PYTHON_VERSION)
else
$(error Invalid Python version $(PYTHON_VERSION))
endif

# Default value is false, can be overiden
# Default value is false, can be overridden
# The below directories are not supported on tier-1
INCLUDE_OPT_DIRS ?= false
OPT_DIRS :=
Expand Down Expand Up @@ -526,13 +526,13 @@ all-images: \
runtime-cuda-pytorch-llmcompressor-ubi9-python-$(RELEASE_PYTHON_VERSION) \
rocm-jupyter-minimal-ubi9-python-$(RELEASE_PYTHON_VERSION) \
rocm-jupyter-pytorch-ubi9-python-$(RELEASE_PYTHON_VERSION) \
rocm-runtime-pytorch-ubi9-python-$(RELEASE_PYTHON_VERSION)
# rocm-runtime-tensorflow-ubi9-python-$(RELEASE_PYTHON_VERSION)
rocm-runtime-pytorch-ubi9-python-$(RELEASE_PYTHON_VERSION) \
rocm-runtime-tensorflow-ubi9-python-$(RELEASE_PYTHON_VERSION) \
rocm-jupyter-tensorflow-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-tensorflow-ubi9-python-$(RELEASE_PYTHON_VERSION)

else
$(error Invalid Python version $(RELEASE_PYTHON_VERSION))
Expand Down
2 changes: 1 addition & 1 deletion jupyter/datascience/ubi9-python-3.12/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ 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.30.0"
kubeflow-training = "==1.9.2"
kubeflow-training = "==1.9.3"

# DB connectors
pymongo = "~=4.11.2"
Expand Down
8 changes: 4 additions & 4 deletions jupyter/datascience/ubi9-python-3.12/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions jupyter/datascience/ubi9-python-3.12/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1134,9 +1134,9 @@ kiwisolver==1.4.9; python_version >= '3.10' \
--hash=sha256:fb3b8132019ea572f4611d770991000d7f58127560c4889729248eb5852a102f \
--hash=sha256:fb940820c63a9590d31d88b815e7a3aa5915cad3ce735ab45f0c730b39547de1 \
--hash=sha256:fc1795ac5cd0510207482c3d1d3ed781143383b8cfd36f5c645f3897ce066220
kubeflow-training==1.9.2 \
--hash=sha256:f99dd637d915f686331597f1c983ee133f61e69fa470c179d9d041912e82834d \
--hash=sha256:fdba63093c38eb7a5c56c3cfd30ed9f57367330af9b84bc318b56bca1d307da7
kubeflow-training==1.9.3 \
--hash=sha256:9033752cf32467bb93d0b6706b40445d29bc85b115a57b892aabfead6c88cd5c \
--hash=sha256:f13634679b506119eb514164179a98b1963d8a59ba1c491eb43631b32d65576a
kubernetes==30.1.0; python_version >= '3.6' \
--hash=sha256:41e4c77af9f28e7a6c314e3bd06a8c6229ddd787cad684e0ab9f69b498e98ebc \
--hash=sha256:e212e8b7579031dd2e512168b617373bc1e03888d41ac4e04039240a292d478d
Expand Down
2 changes: 1 addition & 1 deletion jupyter/rocm/tensorflow/ubi9-python-3.11/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name = "pypi"
[dev-packages]
# tf2onnx has pinned protobuf version, that causes conflict with other packages
# This is a workaround to avoid the conflict
tf2onnx = "~= 1.16.1"
tf2onnx = "~=1.16.1"

[packages]
# ROCm TensorFlow packages
Expand Down
2 changes: 1 addition & 1 deletion jupyter/rocm/tensorflow/ubi9-python-3.11/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

194 changes: 194 additions & 0 deletions jupyter/rocm/tensorflow/ubi9-python-3.12/Dockerfile.rocm
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
######################################################
# mongocli-builder (build stage only, not published) #
######################################################
FROM registry.access.redhat.com/ubi9/go-toolset:latest AS mongocli-builder

ARG MONGOCLI_VERSION=2.0.4

WORKDIR /tmp/
RUN curl -Lo mongodb-cli-mongocli-v${MONGOCLI_VERSION}.zip https://github.com/mongodb/mongodb-cli/archive/refs/tags/mongocli/v${MONGOCLI_VERSION}.zip
RUN unzip ./mongodb-cli-mongocli-v${MONGOCLI_VERSION}.zip
RUN cd ./mongodb-cli-mongocli-v${MONGOCLI_VERSION}/ && \
CGO_ENABLED=1 GOOS=linux go build -a -tags strictfipsruntime -o /tmp/mongocli ./cmd/mongocli/

####################
# 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

# upgrade first to avoid fixable vulnerabilities begin
RUN dnf -y upgrade --refresh --best --nodocs --noplugins --setopt=install_weak_deps=0 --setopt=keepcache=0 \
&& dnf clean all -y
# upgrade first to avoid fixable vulnerabilities end

# 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 and uv to deploy packages from requirements.txt begin
RUN pip install --no-cache-dir -U "micropipenv[toml]==1.9.0" "uv==0.8.12"
# Install micropipenv and uv to deploy packages from requirements.txt end

# Install the oc client begin
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
# Install the oc client end

#############
# rocm-base #
#############
FROM base AS rocm-base

USER 0
WORKDIR /opt/app-root/bin

# Please keep in sync with ROCm/python3.12 dependent images
ARG ROCM_VERSION=6.4.3
ARG AMDGPU_VERSION=6.4.3

# Install the ROCm rpms
# ref: https://github.com/ROCm/ROCm-docker/blob/master/dev/Dockerfile-centos-7-complete
# docs: https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/install-methods/package-manager/package-manager-rhel.html#registering-rocm-repositories
# Note: Based on 6.4 above new package mivisionx is a pre-requistes, which bring in more dependent packages
# so we are only installing meta packages of rocm
# ref: https://rocm.docs.amd.com/projects/install-on-linux/en/develop/reference/package-manager-integration.html#packages-in-rocm-programming-models
RUN echo "[ROCm]" > /etc/yum.repos.d/rocm.repo && \
echo "name=ROCm" >> /etc/yum.repos.d/rocm.repo && \
echo "baseurl=https://repo.radeon.com/rocm/el9/${ROCM_VERSION}/main" >> /etc/yum.repos.d/rocm.repo && \
echo "enabled=1" >> /etc/yum.repos.d/rocm.repo && \
echo "gpgcheck=0" >> /etc/yum.repos.d/rocm.repo && \
echo "[amdgpu]" > /etc/yum.repos.d/amdgpu.repo && \
echo "name=amdgpu" >> /etc/yum.repos.d/amdgpu.repo && \
echo "baseurl=https://repo.radeon.com/amdgpu/${AMDGPU_VERSION}/rhel/9.4/main/x86_64" >> /etc/yum.repos.d/amdgpu.repo && \
echo "enabled=1" >> /etc/yum.repos.d/amdgpu.repo && \
echo "gpgcheck=0" >> /etc/yum.repos.d/amdgpu.repo && \
dnf install -y 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm' && \
dnf clean all && dnf makecache && \
dnf install -y rocm-developer-tools rocm-ml-sdk rocm-openmp-sdk rocm-utils && \
dnf clean all && rm -rf /var/cache/dnf

# https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/post-install.html#configure-rocm-shared-objects
RUN tee --append /etc/ld.so.conf.d/rocm.conf <<EOF
/opt/rocm/lib
/opt/rocm/lib64
EOF
RUN ldconfig

# Restore notebook user workspace
USER 1001
WORKDIR /opt/app-root/src

########################
# rocm-jupyter-minimal #
########################
FROM rocm-base AS rocm-jupyter-minimal

ARG JUPYTER_REUSABLE_UTILS=jupyter/utils
ARG MINIMAL_SOURCE_CODE=jupyter/minimal/ubi9-python-3.12

WORKDIR /opt/app-root/bin

COPY ${JUPYTER_REUSABLE_UTILS} utils/

USER 0

# Dependencies for PDF export begin
RUN ./utils/install_pdf_deps.sh
ENV PATH="/usr/local/texlive/bin/linux:/usr/local/pandoc/bin:$PATH"
# Dependencies for PDF export end

USER 1001

COPY ${MINIMAL_SOURCE_CODE}/start-notebook.sh ./

WORKDIR /opt/app-root/src

ENTRYPOINT ["start-notebook.sh"]

############################
# rocm-jupyter-datascience #
############################
FROM rocm-jupyter-minimal AS rocm-jupyter-datascience

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

WORKDIR /opt/app-root/bin

# OS Packages needs to be installed as root
USER root

# Install useful OS packages
RUN dnf install -y jq unixODBC postgresql git-lfs libsndfile && dnf clean all && rm -rf /var/cache/yum

# Copy dynamically-linked mongocli built in earlier build stage
COPY --from=mongocli-builder /tmp/mongocli /opt/app-root/bin/

# Install MSSQL Client, We need a special repo for MSSQL as they do their own distribution
COPY ${DATASCIENCE_SOURCE_CODE}/mssql-2022.repo /etc/yum.repos.d/mssql-2022.repo

RUN ACCEPT_EULA=Y dnf install -y mssql-tools18 unixODBC-devel && dnf clean all && rm -rf /var/cache/yum

ENV PATH="$PATH:/opt/mssql-tools18/bin"

# Other apps and tools installed as default user
USER 1001

# Copy Elyra setup to utils so that it's sourced at startup
COPY ${DATASCIENCE_SOURCE_CODE}/setup-elyra.sh ${DATASCIENCE_SOURCE_CODE}/utils ./utils/

WORKDIR /opt/app-root/src


###########################
# rocm-jupyter-tensorflow #
###########################
FROM rocm-jupyter-datascience AS rocm-jupyter-tensorflow

ARG DATASCIENCE_SOURCE_CODE=jupyter/datascience/ubi9-python-3.12
ARG TENSORFLOW_SOURCE_CODE=jupyter/rocm/tensorflow/ubi9-python-3.12

WORKDIR /opt/app-root/bin

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

COPY ${TENSORFLOW_SOURCE_CODE}/requirements.txt ./

RUN echo "Installing softwares and packages" && \
# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`,
# we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common.
# Not using --build-constraints=./requirements.txt because error: Unnamed requirements are not allowed as constraints (found: `https://repo.radeon.com/rocm/manylinux/rocm-rel-6.4/
uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./requirements.txt && \
# setup path for runtime configuration
mkdir /opt/app-root/runtimes && \
# Remove default Elyra runtime-images \
rm /opt/app-root/share/jupyter/metadata/runtime-images/*.json && \
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y \
sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json && \
# copy jupyter configuration
cp /opt/app-root/bin/utils/jupyter_server_config.py /opt/app-root/etc/jupyter && \
# Disable announcement plugin of jupyterlab \
jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \
# Apply JupyterLab addons \
/opt/app-root/bin/utils/addons/apply.sh && \
# 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
59 changes: 59 additions & 0 deletions jupyter/rocm/tensorflow/ubi9-python-3.12/Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[dev-packages]
# tf2onnx has pinned protobuf version, that causes conflict with other packages
# This is a workaround to avoid the conflict
tf2onnx = "~=1.16.1"

[packages]
# ROCm TensorFlow packages
# https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/3rd-party/tensorflow-install.html#using-a-wheels-package
tensorflow-rocm = {version = "==2.18.1", file = "https://repo.radeon.com/rocm/manylinux/rocm-rel-6.4/tensorflow_rocm-2.18.1-cp312-cp312-manylinux_2_28_x86_64.whl", hashes = ["sha256:814a5e4842b0c92d63c7a0bb4df0baf51ff2db8615535d83fe8958204b840598"]}
tensorboard = "~=2.18.0"

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

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

# JupyterLab packages

odh-elyra = "==4.2.1"

jupyterlab = "==4.2.7"
jupyter-bokeh = "~=4.0.5"
jupyter-server = "~=2.15.0"
jupyter-server-proxy = "~=4.4.0"
jupyter-server-terminals = "~=0.5.3"
jupyterlab-git = "~=0.50.1"
jupyterlab-lsp = "~=5.1.0"
jupyterlab-widgets = "~=3.0.13"
jupyter-resource-usage = "~=1.1.0"
nbdime = "~=4.0.2"
nbgitpuller = "~=1.2.2"

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

[requires]
python_version = "3.12"
Loading
Loading