forked from opendatahub-io/notebooks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/opendatahub-io/notebooks in…
…to rsync-main
- Loading branch information
Showing
49 changed files
with
7,696 additions
and
6,697 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
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 CentOS Stream 9 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 C9S 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/python-3.9" \ | ||
io.openshift.build.image="quay.io/opendatahub/workbench-images:rocm-python-3.9" | ||
|
||
USER 0 | ||
WORKDIR /opt/app-root/bin | ||
|
||
ARG ROCM_VERSION=6.1 | ||
ARG AMDGPU_VERSION=6.1 | ||
# Base | ||
RUN yum -y install git java-1.8.0-openjdk python; yum clean all | ||
# Install ROCm AMD from: | ||
# https://github.com/ROCm/ROCm-docker/blob/master/dev/Dockerfile-centos-7-complete | ||
# Enable epel-release repositories | ||
RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \ | ||
yum config-manager --set-enabled crb && \ | ||
yum clean all && rm -rf /var/cache/yum | ||
|
||
|
||
# Install required base build and packaging commands for ROCm | ||
RUN yum -y install \ | ||
bc \ | ||
bridge-utils \ | ||
glibc.i686 \ | ||
numactl-libs \ | ||
libssh \ | ||
libunwind-devel \ | ||
libunwind \ | ||
pciutils \ | ||
pciutils-libs \ | ||
re2c \ | ||
doxygen \ | ||
elfutils-libelf-devel \ | ||
expect \ | ||
numactl-devel \ | ||
pciutils-devel \ | ||
qemu-kvm \ | ||
subversion \ | ||
dkms \ | ||
dpkg \ | ||
dpkg-dev \ | ||
dpkg-perl && \ | ||
yum clean all | ||
# These binaries are not available. | ||
# devscripts \ | ||
# pth \ | ||
# libcxx-devel \ | ||
|
||
|
||
# Enable the epel repository for fakeroot | ||
# RUN yum --enablerepo=extras install -y fakeroot | ||
# RUN yum clean all | ||
RUN yum install -y fakeroot && \ | ||
yum clean all | ||
|
||
|
||
# On CentOS, install package centos-release-scl available in CentOS repository: | ||
# RUN yum install -y centos-release-scl | ||
|
||
# Install the devtoolset-7 collection: | ||
# RUN yum install -y devtoolset-7 | ||
# RUN yum install -y devtoolset-7-libatomic-devel devtoolset-7-elfutils-libelf-devel | ||
|
||
# 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/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 | ||
|
||
RUN 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/el/9.2/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 | ||
|
||
# Install rocm and amdgpu binaries | ||
RUN yum install -y amdgpu-dkms rocm && \ | ||
yum clean all | ||
|
||
# Set ENV to enable devtoolset7 by default | ||
# Set ENV to enable devtoolset7 by default | ||
# ENV PATH=/opt/rh/devtoolset-7/root/usr/bin:/opt/rocm/hcc/bin:/opt/rocm/hip/bin:/opt/rocm/bin:/opt/rocm/hcc/bin:${PATH:+:${PATH}} | ||
# ENV MANPATH=/opt/rh/devtoolset-7/root/usr/share/man:${MANPATH} | ||
# ENV INFOPATH=/opt/rh/devtoolset-7/root/usr/share/info${INFOPATH:+:${INFOPATH}} | ||
# ENV PCP_DIR=/opt/rh/devtoolset-7/root | ||
# ENV PERL5LIB=/opt/rh/devtoolset-7/root//usr/lib64/perl5/vendor_perl:/opt/rh/devtoolset-7/root/usr/lib/perl5:/opt/rh/devtoolset-7/root//usr/share/perl5/ | ||
# ENV LD_LIBRARY_PATH=/opt/rocm/lib:/usr/local/lib:/opt/rh/devtoolset-7/root$rpmlibdir$rpmlibdir32${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} | ||
# ENV PYTHONPATH=/opt/rh/devtoolset-7/root/usr/lib64/python$pythonvers/site-packages:/opt/rh/devtoolset-7/root/usr/lib/python$pythonvers/ | ||
# ENV LDFLAGS="-Wl,-rpath=/opt/rh/devtoolset-7/root/usr/lib64 -Wl,-rpath=/opt/rh/devtoolset-7/root/usr/lib" | ||
|
||
# Restore notebook user workspace | ||
USER 1001 | ||
WORKDIR /opt/app-root/src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#!/bin/bash | ||
# | ||
# This script serves to check and validate the definitions for runtime images. | ||
# It does just a brief check of the metadata defined in the json file: | ||
# 1. checks that given `.metadata.image_name` is valid and can be accessed by skopeo tool | ||
# 2. checks that tag in `.metadata.tags[0]` can be found in the output from skopeo tool | ||
# | ||
# THIS FILE DOESN'T CHECK THAT THE USED LINK TO IMAGE IS THE LATEST ONE AVAILABLE! | ||
# | ||
# This script uses `skopeo` and `jq` tools installed locally for retrieving | ||
# information about the particular remote images. | ||
# | ||
# Local execution: ./ci/check-runtime-image.sh | ||
# Note: please execute from the root directory so that relative path matches | ||
# | ||
# In case of the PR on GitHub, this check is tied to GitHub actions automatically, | ||
# see `.github/workflows` directory. | ||
|
||
# ---------------------------- DEFINED FUNCTIONS ----------------------------- # | ||
|
||
function check_image() { | ||
local runtime_image_file="${1}" | ||
|
||
echo "---------------------------------------------" | ||
echo "Checking file: '${runtime_image_file}'" | ||
|
||
local img_tag | ||
local img_url | ||
local img_metadata | ||
|
||
img_tag=$(jq -r '.metadata.tags[0]' "${runtime_image_file}") || { | ||
echo "ERROR: Couldn't parse image tags metadata for '${runtime_image_file}' runtime image file!" | ||
return 1 | ||
} | ||
img_url=$(jq -r '.metadata.image_name' "${runtime_image_file}") || { | ||
echo "ERROR: Couldn't parse image URL metadata for '${runtime_image_file}' runtime image file!" | ||
return 1 | ||
} | ||
|
||
img_metadata="$(skopeo inspect --config "docker://${img_url}")" || { | ||
echo "ERROR: Couldn't download '${img_url}' image metadata with skopeo tool!" | ||
return 1 | ||
} | ||
|
||
local expected_string="runtime-${img_tag}-ubi" | ||
echo "Checking that '${expected_string}' is present in the image metadata" | ||
echo "${img_metadata}" | grep --quiet "${expected_string}" || { | ||
echo "ERROR: The string '${expected_string}' isn't present in the image metadata at all. Please check that the referenced image '${img_url}' is the correct one!" | ||
return 1 | ||
} | ||
|
||
# TODO: we shall extend this check to check also Label "io.openshift.build.commit.ref" value (e.g. '2024a') or something similar | ||
} | ||
|
||
function main() { | ||
ret_code=0 | ||
|
||
# If name of the directory isn't good enough, maybe we can improve this to search for the: `"schema_name": "runtime-image"` string. | ||
runtime_image_files=$(find . -name "*.json" | grep "runtime-images" | sort --unique) | ||
|
||
IFS=$'\n' | ||
for file in ${runtime_image_files}; do | ||
check_image "${file}" || { | ||
echo "ERROR: Check for '${file}' failed!" | ||
ret_code=1 | ||
} | ||
done | ||
|
||
echo "---------------------------------------------" | ||
echo "" | ||
if test "${ret_code}" -eq 0; then | ||
echo "Validation of runtime images definitions was successful! Congrats :)" | ||
else | ||
echo "ERROR: Some of the runtime image definitions aren't valid, please check above!" | ||
fi | ||
|
||
return "${ret_code}" | ||
} | ||
|
||
# ------------------------------ MAIN SCRIPT --------------------------------- # | ||
|
||
main | ||
|
||
exit "${?}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.