CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
119 lines
4.0 KiB
Docker
119 lines
4.0 KiB
Docker
# Use amdsmi base image
|
|
FROM amdsmi-image
|
|
|
|
# Sync ROCm repositories
|
|
# Fetch the ROCm signing key over HTTPS, verify it against a pinned SHA-256
|
|
# checksum, and install it as a dedicated signed-by keyring instead of the
|
|
# deprecated "apt-key add" (which would trust the key for every repository).
|
|
# Update the checksum if AMD rotates the key
|
|
# (fingerprint CA8B B472 7A47 B4D0 9B4E E896 9386 B48A 1A69 3C5C).
|
|
RUN apt-get update && apt-get install -y wget gnupg2 ca-certificates && \
|
|
install -d -m 0755 /etc/apt/keyrings && \
|
|
wget -qO /tmp/rocm.gpg.key https://repo.radeon.com/rocm/rocm.gpg.key && \
|
|
echo '2de99e2354646a90d9903e2a669fc4e36b02c1bbff7075c481e12d7edab2c88b /tmp/rocm.gpg.key' | sha256sum -c - && \
|
|
gpg --dearmor < /tmp/rocm.gpg.key > /etc/apt/keyrings/rocm.gpg && \
|
|
chmod 0644 /etc/apt/keyrings/rocm.gpg && \
|
|
rm -f /tmp/rocm.gpg.key && \
|
|
echo 'deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/debian/ jammy main' > /etc/apt/sources.list.d/rocm.list && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install ROCm runtime and dependencies
|
|
RUN apt-get update && \
|
|
apt-get install -y \
|
|
rocm-smi-lib \
|
|
cmake \
|
|
make \
|
|
g++ \
|
|
doxygen \
|
|
texlive-latex-base \
|
|
automake \
|
|
unzip \
|
|
build-essential \
|
|
autoconf \
|
|
libtool \
|
|
pkg-config \
|
|
libgflags-dev \
|
|
libgtest-dev \
|
|
clang \
|
|
libc++-dev \
|
|
curl \
|
|
libcap-dev \
|
|
python3-argcomplete \
|
|
python3-pip \
|
|
bash && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Update setuptools
|
|
RUN python3 -m pip install --upgrade setuptools==59.6.0
|
|
|
|
# Check for modprobe
|
|
RUN command -v modprobe || echo "modprobe not found"
|
|
|
|
# Set environment variables
|
|
ENV GRPC_ROOT=/opt/grpc
|
|
ENV RDC_LIB_DIR=/opt/rocm/lib/rdc
|
|
ENV CMAKE_ROOT=/usr/bin/cmake
|
|
|
|
# Install gRPC
|
|
RUN git clone -b v1.67.1 https://github.com/grpc/grpc --depth=1 --shallow-submodules --recurse-submodules && \
|
|
cd grpc && \
|
|
cmake -B build \
|
|
-DgRPC_INSTALL=ON \
|
|
-DgRPC_BUILD_TESTS=OFF \
|
|
-DBUILD_SHARED_LIBS=ON \
|
|
-DCMAKE_INSTALL_PREFIX="$GRPC_ROOT" \
|
|
-DCMAKE_INSTALL_LIBDIR=lib \
|
|
-DCMAKE_BUILD_TYPE=Release && \
|
|
make -C build -j $(nproc) && \
|
|
make -C build install && \
|
|
echo "$GRPC_ROOT" | tee /etc/ld.so.conf.d/grpc.conf
|
|
|
|
# Build and install RDC
|
|
RUN git clone https://github.com/ROCm/rocm-systems --recursive && \
|
|
cd rocm-systems/projects/rdc && \
|
|
cmake -B build -DGRPC_ROOT="$GRPC_ROOT" \
|
|
-DSMIDIR="$SMI_DIR" \
|
|
-DBUILD_TESTS=OFF \
|
|
-DBUILD_PROFILER=OFF \
|
|
-DBUILD_RUNTIME=OFF \
|
|
-DBUILD_RVS=OFF && \
|
|
make -C build -j $(nproc) && \
|
|
make -C build install
|
|
|
|
# Update system library path
|
|
RUN export RDC_LIB_DIR=/opt/rocm/lib/rdc && \
|
|
export GRPC_LIB_DIR="/opt/grpc/lib" && \
|
|
echo "${RDC_LIB_DIR}" | tee /etc/ld.so.conf.d/x86_64-librdc_client.conf && \
|
|
echo "${GRPC_LIB_DIR}" | tee -a /etc/ld.so.conf.d/x86_64-librdc_client.conf && \
|
|
ldconfig
|
|
|
|
# Expose the port for Prometheus
|
|
EXPOSE 50051
|
|
|
|
# Expose the prometheus plugin port
|
|
EXPOSE 5000
|
|
|
|
# Set working directory to /opt/rocm/libexec/rdc/python_binding
|
|
WORKDIR /opt/rocm/libexec/rdc/python_binding
|
|
|
|
# Install Prometheus
|
|
RUN wget https://github.com/prometheus/prometheus/releases/download/v2.41.0/prometheus-2.41.0.linux-amd64.tar.gz && \
|
|
tar xvfz prometheus-2.41.0.linux-amd64.tar.gz && \
|
|
mv prometheus-2.41.0.linux-amd64/prometheus /usr/local/bin/ && \
|
|
rm -rf prometheus-2.41.0.linux-amd64*
|
|
|
|
# Install Grafana
|
|
RUN wget https://dl.grafana.com/oss/release/grafana-9.3.2.linux-amd64.tar.gz && \
|
|
tar -zxvf grafana-9.3.2.linux-amd64.tar.gz && \
|
|
mv grafana-9.3.2 /usr/local/grafana && \
|
|
rm grafana-9.3.2.linux-amd64.tar.gz
|
|
|
|
# Install Prometheus client for Python
|
|
RUN python3 -m pip install prometheus_client
|
|
|
|
# Ensure sudo can run without a password for the rdcd command
|
|
RUN echo "ALL ALL=(ALL) NOPASSWD: /opt/rocm/bin/rdcd" >> /etc/sudoers
|
|
|
|
# Set the entry point to run the rdcd command
|
|
ENTRYPOINT ["sudo", "/opt/rocm/bin/rdcd", "-u"]
|