ARG DISTRO=rockylinux/rockylinux ARG VERSION=8 FROM ${DISTRO}:${VERSION} ENV HOME=/root ENV SHELL=/bin/bash ENV BASH_ENV=/etc/bash.bashrc ENV DEBIAN_FRONTEND=noninteractive WORKDIR /tmp SHELL [ "/bin/bash", "-c" ] ENV PATH=/usr/lib64/openmpi/bin:/usr/local/bin:${PATH} # Dyninst needs GCC >= 10; RHEL 8 base is GCC 8 — use gcc-toolset on el8 only (install step below). ARG GCC_TOOLSET_VERSION=10 ARG EXTRA_PACKAGES="" ARG ELFUTILS_DOWNLOAD_VERSION="0.188" ARG NJOBS="8" RUN echo "* soft memlock unlimited" >> /etc/security/limits.conf && \ echo "* hard memlock unlimited" >> /etc/security/limits.conf RUN OS_VERSION_MAJOR=$(grep '^VERSION_ID=' /etc/os-release | cut -d'=' -f2 | tr -d '"' | cut -d'.' -f1) && \ yum install -y epel-release && crb enable && \ yum install -y --allowerasing \ autoconf automake ccache chrpath cmake curl dpkg-devel elfutils-devel flex git glibc-devel \ gmock-devel gtest-devel iproute json-devel libdwarf-devel libdrm-devel libtool make \ ninja-build numactl-devel openmpi-devel papi-devel pkgconf pkgconf-m4 \ pkgconf-pkg-config python3-devel python3-pip redhat-rpm-config rpm-build rpm-sign \ sqlite-devel strace ucx-devel vim wget which zlib-devel && \ if [ "${OS_VERSION_MAJOR}" -eq 8 ]; then \ yum install -y gcc-toolset-${GCC_TOOLSET_VERSION}-binutils gcc-toolset-${GCC_TOOLSET_VERSION}-gcc gcc-toolset-${GCC_TOOLSET_VERSION}-gcc-c++ gcc-toolset-${GCC_TOOLSET_VERSION}-gcc-gfortran && \ _TS=/opt/rh/gcc-toolset-${GCC_TOOLSET_VERSION}/root/usr/bin && \ ln -sf "${_TS}/gcc" /usr/local/bin/gcc && \ ln -sf "${_TS}/g++" /usr/local/bin/g++ && \ ln -sf "${_TS}/gcc" /usr/local/bin/cc && \ ln -sf "${_TS}/g++" /usr/local/bin/c++ && \ ln -sf "${_TS}/gfortran" /usr/local/bin/gfortran; \ else \ yum install -y binutils gcc gcc-c++ gcc-gfortran; \ fi && \ yum clean all && \ python3 -m pip install --upgrade pip && \ python3 -m pip install 'cmake==3.25' perfetto ARG PYTHON_VERSIONS="8 9 10 11 12 13" # Install pytest test dependencies into each conda env COPY requirements.txt /tmp/requirements.txt RUN wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh -O miniforge.sh && \ bash miniforge.sh -b -p /opt/conda && \ export PATH="/opt/conda/bin:${PATH}" && \ conda config --set always_yes yes --set changeps1 no --set solver classic && \ conda update -c conda-forge -n base conda && \ for i in ${PYTHON_VERSIONS}; do \ conda create -n py3.${i} -c conda-forge python=3.${i} pip && \ /opt/conda/envs/py3.${i}/bin/python -m pip install -r /tmp/requirements.txt; \ done && \ conda clean -a -y # Install pytest test dependencies for system python RUN if python3 -c "import sys; sys.exit(0 if sys.version_info >= (3, 8) else 1)"; then \ python3 -m pip install -r /tmp/requirements.txt; \ else \ echo "Skipping system Python install: $(python3 --version 2>&1) is too old (rocprofiler-systems test suite requires >=3.8)"; \ fi && \ rm -f /tmp/requirements.txt # The Rock Tarball ARG GPU_TYPE="" RUN if [ -n "${GPU_TYPE}" ]; then \ TARBALL=$(curl -fsSL "https://rocm.nightlies.amd.com/tarball-multi-arch/" | \ grep -oE "\"name\": \"therock-dist-linux-${GPU_TYPE}-[^\"]+\", \"mtime\": [0-9.]+" | \ sort -t' ' -k4 -g | \ tail -1 | \ sed 's/.*"name": "\([^"]*\)".*/\1/'); \ test -n "${TARBALL}" || { echo "Error: no therock-dist-linux-${GPU_TYPE}-* tarball found" >&2; exit 1; }; \ VERSION=$(echo "${TARBALL}" | sed -nE 's/.*([0-9]+\.[0-9]+\.[0-9]+).*/\1/p'); \ test -n "${VERSION}" || { echo "Error: could not extract version from '${TARBALL}'" >&2; exit 1; }; \ curl -fSL "https://rocm.nightlies.amd.com/tarball-multi-arch/${TARBALL}" \ -o "/opt/rocm-${VERSION}-${GPU_TYPE}.tar.gz"; \ fi ARG ROCM_VERSION="" RUN if [ -n "${ROCM_VERSION}" ]; then \ OS_VERSION_MAJOR=$(grep '^VERSION_ID=' /etc/os-release | cut -d'=' -f2 | tr -d '"' | cut -d. -f1) && \ printf '%s\n' '[rocm]' \ "name=ROCm ${ROCM_VERSION} repository" \ "baseurl=https://repo.radeon.com/rocm/el${OS_VERSION_MAJOR}/${ROCM_VERSION}/main" \ 'enabled=1' 'priority=50' 'gpgcheck=1' \ 'gpgkey=https://repo.radeon.com/rocm/rocm.gpg.key' > /etc/yum.repos.d/rocm.repo && \ if [ "${OS_VERSION_MAJOR}" -eq 8 ]; then PERL_REPO=powertools; else PERL_REPO=crb; fi && \ dnf -y --enablerepo=${PERL_REPO} install perl-File-BaseDir && \ dnf install -y rocm-dev && \ if [ "${OS_VERSION_MAJOR}" -gt 8 ]; then \ dnf install -y libavcodec-free-devel libavformat-free-devel; \ fi && \ dnf clean all; \ fi WORKDIR /home SHELL [ "/bin/bash", "--login", "-c" ]