Skip to content

Commit

Permalink
Switch base image to UBI for AMD rocm install
Browse files Browse the repository at this point in the history
- adjust the makefile with ubi change

Signed-off-by: Harshad Reddy Nalla <[email protected]>
  • Loading branch information
harshad16 committed Jul 17, 2024
1 parent e506603 commit 3cfe039
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 115 deletions.
26 changes: 13 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -267,30 +267,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,$<)
####################################### Buildchain for AMD Python 3.9 using UBI9 #######################################
.PHONY: amd-ubi9-python-3.9
amd-ubi9-python-3.9: base-ubi9-python-3.9
$(call image,$@,amd/ubi9-python-3.9,$<)

# We are only using c9s base image here onwards,
# We are only using ubi9 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
.PHONY: amd-jupyter-minimal-ubi9-python-3.9
amd-jupyter-minimal-ubi9-python-3.9: amd-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
.PHONY: amd-jupyter-datascience-ubi9-python-3.9
amd-jupyter-datascience-ubi9-python-3.9: amd-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
.PHONY: amd-jupyter-tensorflow-ubi9-python-3.9
amd-jupyter-tensorflow-ubi9-python-3.9: amd-jupyter-datascience-ubi9-python-3.9
$(call image,$@,jupyter/amd/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
.PHONY: amd-jupyter-pytorch-ubi9-python-3.9
amd-jupyter-pytorch-ubi9-python-3.9: amd-jupyter-datascience-ubi9-python-3.9
$(call image,$@,jupyter/amd/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.

39 changes: 39 additions & 0 deletions amd/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/amd/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 3cfe039

Please sign in to comment.