Skip to content

Commit c7040f0

Browse files
committed
Adding Dockerfile for AMD based on Centos9
1 parent 5166b53 commit c7040f0

File tree

1 file changed

+102
-0
lines changed

1 file changed

+102
-0
lines changed

amd/c9s-python-3.9/Dockerfile

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
ARG BASE_IMAGE
2+
FROM ${BASE_IMAGE}
3+
LABEL name="odh-notebook-rocm-python-3.9" \
4+
summary="ROCm Python 3.9 base image for ODH notebooks" \
5+
description="ROCm Python 3.9 builder image based on CentOS Stream 9 for ODH notebooks" \
6+
io.k8s.display-name="ROCm Python 3.9 base image for ODH notebooks" \
7+
io.k8s.description="ROCm Python 3.9 builder image based on C9S for ODH notebooks" \
8+
authoritative-source-url="https://github.com/opendatahub-io/notebooks" \
9+
io.openshift.build.commit.ref="main" \
10+
io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/amd/python-3.9" \
11+
io.openshift.build.image="quay.io/opendatahub/workbench-images:rocm-python-3.9"
12+
13+
USER 0
14+
WORKDIR /opt/app-root/bin
15+
16+
ARG ROCM_VERSION=6.1
17+
ARG AMDGPU_VERSION=6.1
18+
# Base
19+
RUN yum -y install git java-1.8.0-openjdk python; yum clean all
20+
# Install ROCm AMD from:
21+
# https://github.com/ROCm/ROCm-docker/blob/master/dev/Dockerfile-centos-7-complete
22+
# Enable epel-release repositories
23+
RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \
24+
yum config-manager --set-enabled crb && \
25+
yum clean all && rm -rf /var/cache/yum
26+
27+
28+
# Install required base build and packaging commands for ROCm
29+
RUN yum -y install \
30+
bc \
31+
bridge-utils \
32+
glibc.i686 \
33+
numactl-libs \
34+
libssh \
35+
libunwind-devel \
36+
libunwind \
37+
pciutils \
38+
pciutils-libs \
39+
re2c \
40+
doxygen \
41+
elfutils-libelf-devel \
42+
expect \
43+
numactl-devel \
44+
pciutils-devel \
45+
qemu-kvm \
46+
subversion \
47+
dkms \
48+
dpkg \
49+
dpkg-dev \
50+
dpkg-perl && \
51+
yum clean all
52+
# These binaries are not available.
53+
# devscripts \
54+
# pth \
55+
# libcxx-devel \
56+
57+
58+
# Enable the epel repository for fakeroot
59+
# RUN yum --enablerepo=extras install -y fakeroot
60+
# RUN yum clean all
61+
RUN yum install -y fakeroot && \
62+
yum clean all
63+
64+
65+
# On CentOS, install package centos-release-scl available in CentOS repository:
66+
# RUN yum install -y centos-release-scl
67+
68+
# Install the devtoolset-7 collection:
69+
# RUN yum install -y devtoolset-7
70+
# RUN yum install -y devtoolset-7-libatomic-devel devtoolset-7-elfutils-libelf-devel
71+
72+
# Install the ROCm rpms
73+
RUN echo "[ROCm]" > /etc/yum.repos.d/rocm.repo && \
74+
echo "name=ROCm" >> /etc/yum.repos.d/rocm.repo && \
75+
echo "baseurl=https://repo.radeon.com/rocm/el9/$ROCM_VERSION/main" >> /etc/yum.repos.d/rocm.repo && \
76+
echo "enabled=1" >> /etc/yum.repos.d/rocm.repo && \
77+
echo "gpgcheck=0" >> /etc/yum.repos.d/rocm.repo
78+
79+
RUN echo "[amdgpu]" > /etc/yum.repos.d/amdgpu.repo && \
80+
echo "name=amdgpu" >> /etc/yum.repos.d/amdgpu.repo && \
81+
echo "baseurl=https://repo.radeon.com/amdgpu/$AMDGPU_VERSION/el/9.2/main/x86_64" >> /etc/yum.repos.d/amdgpu.repo && \
82+
echo "enabled=1" >> /etc/yum.repos.d/amdgpu.repo && \
83+
echo "gpgcheck=0" >> /etc/yum.repos.d/amdgpu.repo
84+
85+
# Install rocm and amdgpu binaries
86+
RUN yum install -y amdgpu-dkms rocm && \
87+
yum clean all
88+
89+
# Set ENV to enable devtoolset7 by default
90+
# Set ENV to enable devtoolset7 by default
91+
# 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}}
92+
# ENV MANPATH=/opt/rh/devtoolset-7/root/usr/share/man:${MANPATH}
93+
# ENV INFOPATH=/opt/rh/devtoolset-7/root/usr/share/info${INFOPATH:+:${INFOPATH}}
94+
# ENV PCP_DIR=/opt/rh/devtoolset-7/root
95+
# 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/
96+
# ENV LD_LIBRARY_PATH=/opt/rocm/lib:/usr/local/lib:/opt/rh/devtoolset-7/root$rpmlibdir$rpmlibdir32${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
97+
# ENV PYTHONPATH=/opt/rh/devtoolset-7/root/usr/lib64/python$pythonvers/site-packages:/opt/rh/devtoolset-7/root/usr/lib/python$pythonvers/
98+
# ENV LDFLAGS="-Wl,-rpath=/opt/rh/devtoolset-7/root/usr/lib64 -Wl,-rpath=/opt/rh/devtoolset-7/root/usr/lib"
99+
100+
# Restore notebook user workspace
101+
USER 1001
102+
WORKDIR /opt/app-root/src

0 commit comments

Comments
 (0)