Skip to content

Commit

Permalink
Merge pull request opendatahub-io#620 from harshad16/switch-ubi
Browse files Browse the repository at this point in the history
Switch base image to UBI for AMD rocm install
  • Loading branch information
openshift-merge-bot[bot] authored Jul 23, 2024
2 parents a1154b4 + fdf988d commit bc3b27e
Show file tree
Hide file tree
Showing 20 changed files with 90 additions and 154 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-notebooks-TEMPLATE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

- name: Free up additional disk space
# https://docs.github.com/en/actions/learn-github-actions/expressions
if: "${{ contains(inputs.target, 'amd') || contains(inputs.target, 'cuda') || contains(inputs.target, 'intel') ||
if: "${{ contains(inputs.target, 'rocm') || contains(inputs.target, 'cuda') || contains(inputs.target, 'intel') ||
contains(inputs.target, 'pytorch') || contains(inputs.target, 'tensorflow') }}"
run: |
set -x
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/build-notebooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -416,57 +416,57 @@
},
"secrets": "inherit"
},
"amd-c9s-python-3_9": {
"rocm-ubi9-python-3_9": {
"needs": [
"base-c9s-python-3_9"
"base-ubi9-python-3_9"
],
"uses": "./.github/workflows/build-notebooks-TEMPLATE.yaml",
"with": {
"target": "amd-c9s-python-3.9",
"target": "rocm-ubi9-python-3.9",
"github": "${{ toJSON(github) }}"
},
"secrets": "inherit"
},
"amd-jupyter-minimal-c9s-python-3_9": {
"rocm-jupyter-minimal-ubi9-python-3_9": {
"needs": [
"amd-c9s-python-3_9"
"rocm-ubi9-python-3_9"
],
"uses": "./.github/workflows/build-notebooks-TEMPLATE.yaml",
"with": {
"target": "amd-jupyter-minimal-c9s-python-3.9",
"target": "rocm-jupyter-minimal-ubi9-python-3.9",
"github": "${{ toJSON(github) }}"
},
"secrets": "inherit"
},
"amd-jupyter-datascience-c9s-python-3_9": {
"rocm-jupyter-datascience-ubi9-python-3_9": {
"needs": [
"amd-jupyter-minimal-c9s-python-3_9"
"rocm-jupyter-minimal-ubi9-python-3_9"
],
"uses": "./.github/workflows/build-notebooks-TEMPLATE.yaml",
"with": {
"target": "amd-jupyter-datascience-c9s-python-3.9",
"target": "rocm-jupyter-datascience-ubi9-python-3.9",
"github": "${{ toJSON(github) }}"
},
"secrets": "inherit"
},
"amd-jupyter-tensorflow-c9s-python-3_9": {
"rocm-jupyter-tensorflow-ubi9-python-3_9": {
"needs": [
"amd-jupyter-datascience-c9s-python-3_9"
"rocm-jupyter-datascience-ubi9-python-3_9"
],
"uses": "./.github/workflows/build-notebooks-TEMPLATE.yaml",
"with": {
"target": "amd-jupyter-tensorflow-c9s-python-3.9",
"target": "rocm-jupyter-tensorflow-ubi9-python-3.9",
"github": "${{ toJSON(github) }}"
},
"secrets": "inherit"
},
"amd-jupyter-pytorch-c9s-python-3_9": {
"rocm-jupyter-pytorch-ubi9-python-3_9": {
"needs": [
"amd-jupyter-datascience-c9s-python-3_9"
"rocm-jupyter-datascience-ubi9-python-3_9"
],
"uses": "./.github/workflows/build-notebooks-TEMPLATE.yaml",
"with": {
"target": "amd-jupyter-pytorch-c9s-python-3.9",
"target": "rocm-jupyter-pytorch-ubi9-python-3.9",
"github": "${{ toJSON(github) }}"
},
"secrets": "inherit"
Expand Down
39 changes: 19 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -252,31 +252,30 @@ rstudio-c9s-python-3.9: base-c9s-python-3.9
cuda-rstudio-c9s-python-3.9: cuda-c9s-python-3.9
$(call image,$@,rstudio/c9s-python-3.9,$<)

####################################### Buildchain for AMD Python 3.9 using C9S #######################################
.PHONY: amd-c9s-python-3.9
amd-c9s-python-3.9: base-c9s-python-3.9
$(call image,$@,amd/c9s-python-3.9,$<)

# We are only using c9s base image here onwards,
# DON'T confuse due to the ubi9 mention, it just directory name.
.PHONY: amd-jupyter-minimal-c9s-python-3.9
amd-jupyter-minimal-c9s-python-3.9: amd-c9s-python-3.9
####################################### Buildchain for AMD Python 3.9 using UBI9 #######################################
.PHONY: rocm-ubi9-python-3.9
rocm-ubi9-python-3.9: base-ubi9-python-3.9
$(call image,$@,rocm/ubi9-python-3.9,$<)

# We are only using rocm-ubi9 base image here onwards
.PHONY: rocm-jupyter-minimal-ubi9-python-3.9
rocm-jupyter-minimal-ubi9-python-3.9: rocm-ubi9-python-3.9
$(call image,$@,jupyter/minimal/ubi9-python-3.9,$<)

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

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

# Build and push jupyter-pytorch-ubi9-python-3.9 image to the registry
.PHONY: amd-jupyter-pytorch-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 rocm-jupyter-pytorch-ubi9-python-3.9 image to the registry
.PHONY: rocm-jupyter-pytorch-ubi9-python-3.9
rocm-jupyter-pytorch-ubi9-python-3.9: rocm-jupyter-datascience-ubi9-python-3.9
$(call image,$@,jupyter/rocm/pytorch/ubi9-python-3.9,$<)

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

Expand Down
102 changes: 0 additions & 102 deletions amd/c9s-python-3.9/Dockerfile

This file was deleted.

4 changes: 2 additions & 2 deletions ci/cached-builds/gen_gha_matrix_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ def test_select_changed_targets(self):
changed_files = ["jupyter/datascience/ubi9-python-3.9/Dockerfile"]

leafs = gha_pr_changed_files.filter_out_unchanged(leafs, changed_files)
assert set(leafs) == {'amd-jupyter-pytorch-c9s-python-3.9',
'amd-jupyter-tensorflow-c9s-python-3.9',
assert set(leafs) == {'rocm-jupyter-pytorch-c9s-python-3.9',
'rocm-jupyter-tensorflow-c9s-python-3.9',
'cuda-jupyter-tensorflow-ubi9-python-3.9',
'jupyter-trustyai-ubi9-python-3.9',
'jupyter-pytorch-ubi9-python-3.9'}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

LABEL name="odh-notebook-jupyter-amd-pytorch-ubi9-python-3.9" \
LABEL name="odh-notebook-jupyter-rocm-pytorch-ubi9-python-3.9" \
summary="Jupyter AMD pytorch notebook image for ODH notebooks" \
description="Jupyter AMD pytorch notebook image with base Python 3.9 builder image based on UBI9 for ODH notebooks" \
io.k8s.display-name="Jupyter AMD pytorch notebook image for ODH notebooks" \
io.k8s.description="Jupyter 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/jupyter/amd/pytorch/ubi9-python-3.9" \
io.openshift.build.image="quay.io/opendatahub/workbench-images:jupyter-amd-pytorch-ubi9-python-3.9"
io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/jupyter/rocm/pytorch/ubi9-python-3.9" \
io.openshift.build.image="quay.io/opendatahub/workbench-images:rocm-jupyter-pytorch-ubi9-python-3.9"

# Install Python packages and Jupyterlab extensions from Pipfile.lock
COPY Pipfile.lock ./
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namePrefix: jupyter-amd-pytorch-ubi9-python-3-9-
namePrefix: rocm-jupyter-pytorch-ubi9-python-3-9-
commonLabels:
app: jupyter-amd-pytorch-ubi9-python-3-9
app: rocm-jupyter-pytorch-ubi9-python-3-9
resources:
- service.yaml
- statefulset.yaml
images:
- name: quay.io/opendatahub/workbench-images
newName: quay.io/opendatahub/workbench-images
newTag: jupyter-amd-pytorch-ubi9-python-3.9
newTag: rocm-jupyter-pytorch-ubi9-python-3.9
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
spec:
containers:
- name: notebook
image: quay.io/opendatahub/workbench-images:jupyter-amd-pytorch-ubi9-python-3.9
image: quay.io/opendatahub/workbench-images:rocm-jupyter-pytorch-ubi9-python-3.9
imagePullPolicy: Always
workingDir: /opt/app-root/src
env:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

LABEL name="odh-notebook-jupyter-amd-tensorflow-ubi9-python-3.9" \
LABEL name="odh-notebook-jupyter-rocm-tensorflow-ubi9-python-3.9" \
summary="Jupyter AMD tensorflow notebook image for ODH notebooks" \
description="Jupyter AMD tensorflow notebook image with base Python 3.9 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.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/jupyter/amd/tensorflow/ubi9-python-3.9" \
io.openshift.build.image="quay.io/opendatahub/workbench-images:jupyter-amd-tensorflow-ubi9-python-3.9"
io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/jupyter/rocm/tensorflow/ubi9-python-3.9" \
io.openshift.build.image="quay.io/opendatahub/workbench-images:rocm-jupyter-tensorflow-ubi9-python-3.9"

# Install Python packages and Jupyterlab extensions from Pipfile.lock
COPY Pipfile.lock ./
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namePrefix: jupyter-amd-tensorflow-ubi9-python-3-9-
namePrefix: rocm-jupyter-tensorflow-ubi9-python-3-9-
commonLabels:
app: jupyter-amd-tensorflow-ubi9-python-3-9
app: rocm-jupyter-tensorflow-ubi9-python-3-9
resources:
- service.yaml
- statefulset.yaml
images:
- name: quay.io/opendatahub/workbench-images
newName: quay.io/opendatahub/workbench-images
newTag: jupyter-amdtensorflow-ubi9-python-3.9
newTag: jupyter-pytorch-ubi9-python-3.9-2023a-20231002-4e9bbb3
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
spec:
containers:
- name: notebook
image: quay.io/opendatahub/workbench-images:jupyter-amd-tensorflow-ubi9-python-3.9
image: quay.io/opendatahub/workbench-images:rocm-jupyter-tensorflow-ubi9-python-3.9
imagePullPolicy: Always
workingDir: /opt/app-root/src
env:
Expand Down
39 changes: 39 additions & 0 deletions rocm/ubi9-python-3.9/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Install ROCm AMD from:
# https://github.com/ROCm/ROCm-docker/blob/master/dev/Dockerfile-centos-7-complete
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
LABEL name="odh-notebook-rocm-python-3.9" \
summary="ROCm Python 3.9 base image for ODH notebooks" \
description="ROCm Python 3.9 builder image based on UBI9 for ODH notebooks" \
io.k8s.display-name="ROCm Python 3.9 base image for ODH notebooks" \
io.k8s.description="ROCm 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/rocm/ubi9-python-3.9" \
io.openshift.build.image="quay.io/opendatahub/workbench-images:rocm-ubi9-python-3.9"

USER 0
WORKDIR /opt/app-root/bin

ARG ROCM_VERSION=6.1
ARG AMDGPU_VERSION=6.1

# Enable epel-release repositories

# Install the ROCm rpms
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/rhel9/$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 && \
yum install -y rocm && \
yum clean all && rm -rf /var/cache/yum

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

0 comments on commit bc3b27e

Please sign in to comment.