Skip to content

Commit 0613e68

Browse files
authored
Almalinux dockerfiles + workflows (#438)
* Add AlmaLinux8 (substitute for RHEL8) workflows and Dockerfiles - Add AlmaLinux8 Dockerfile (with FFmpeg, glslang, Vulkan SDK, GLFW built from source for glibc 2.28 compatibility)
1 parent 8e7a0bc commit 0613e68

4 files changed

Lines changed: 109 additions & 0 deletions

File tree

.github/build_tools/configure_ci.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
DISTRO_MAP = {
2121
"ubuntu-22.04": {"image": "ghcr.io/rocm/rocm-examples-ubuntu-22.04:latest", "label": "Ubuntu 22.04"},
2222
"sles-15.7": {"image": "ghcr.io/rocm/rocm-examples-sles-15.7:latest", "label": "SLES 15.7"},
23+
"almalinux-8": {"image": "ghcr.io/rocm/rocm-examples-almalinux-8:latest", "label": "AlmaLinux 8"},
2324
}
2425

2526
def _is_all(value):

.github/workflows/ci_nightly.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ on:
4040
- all
4141
- ubuntu-22.04
4242
- sles-15.7
43+
- almalinux-8
4344

4445
permissions:
4546
contents: read

.github/workflows/ci_therock.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ on:
6161
- all
6262
- ubuntu-22.04
6363
- sles-15.7
64+
- almalinux-8
6465

6566
permissions:
6667
contents: read

Dockerfiles/almalinux-8.Dockerfile

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
FROM almalinux:8
2+
3+
ARG VULKAN_SDK_VERSION=1.4.335.0
4+
ARG GLFW_VERSION=3.4
5+
ARG GLSLANG_VERSION=13.1.1
6+
7+
# GPU_TARGET and THEROCK_FAMILY are set at workflow runtime, not in the base image
8+
ENV VULKAN_SDK_VERSION=${VULKAN_SDK_VERSION}
9+
10+
RUN dnf install -y dnf-plugins-core && \
11+
dnf config-manager --set-enabled powertools && \
12+
dnf update -y && \
13+
dnf install -y \
14+
unzip \
15+
xz \
16+
gcc \
17+
gcc-c++ \
18+
gcc-toolset-13-gcc-c++ \
19+
gcc-toolset-13-libstdc++-devel \
20+
make \
21+
wget \
22+
git \
23+
curl \
24+
nasm \
25+
python3.11 \
26+
python3.11-pip \
27+
elfutils-devel \
28+
mesa-libGL-devel \
29+
wayland-devel \
30+
libxkbcommon-devel \
31+
libXcursor-devel \
32+
libXi-devel \
33+
libXinerama-devel \
34+
libXrandr-devel \
35+
libatomic && \
36+
dnf clean all
37+
38+
# GCC 8's libstdc++fs has an ABI-incompatible std::filesystem::path layout vs
39+
# the one expected by TheRock's libhsa-runtime64.so (built with a newer GCC).
40+
# GCC 13 from gcc-toolset-13 provides a compatible implementation.
41+
ENV PATH="/opt/rh/gcc-toolset-13/root/usr/bin:${PATH}" \
42+
LD_LIBRARY_PATH="/opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13"
43+
44+
# ============================================================================
45+
# Python virtual environment (ready for ROCm wheel or tarball installation)
46+
# ROCm installation is delegated to the CI workflow to support both methods
47+
# ============================================================================
48+
49+
RUN python3.11 -m venv /opt/venv && \
50+
/opt/venv/bin/pip install --upgrade pip && \
51+
/opt/venv/bin/pip install pyyaml cmake
52+
53+
ENV PATH="/opt/venv/bin:${PATH}"
54+
ENV VIRTUAL_ENV="/opt/venv"
55+
56+
# Build GLFW from source (not available in RHEL 8 repos)
57+
WORKDIR /tmp
58+
RUN wget https://github.com/glfw/glfw/releases/download/${GLFW_VERSION}/glfw-${GLFW_VERSION}.zip && \
59+
unzip glfw-${GLFW_VERSION}.zip && \
60+
cmake -S glfw-${GLFW_VERSION} -B glfw-${GLFW_VERSION}/build \
61+
-DGLFW_BUILD_EXAMPLES=OFF \
62+
-DGLFW_BUILD_TESTS=OFF \
63+
-DGLFW_BUILD_DOCS=OFF && \
64+
cmake --build glfw-${GLFW_VERSION}/build --target install && \
65+
rm -rf /tmp/glfw-${GLFW_VERSION}*
66+
67+
# Build glslang from source (Vulkan SDK prebuilt binaries require glibc 2.34+,
68+
# but RHEL 8 ships glibc 2.28)
69+
RUN git clone --branch ${GLSLANG_VERSION} --depth 1 https://github.com/KhronosGroup/glslang.git && \
70+
cmake -S glslang -B glslang/build \
71+
-DCMAKE_BUILD_TYPE=Release \
72+
-DENABLE_OPT=OFF \
73+
-DENABLE_CTEST=OFF && \
74+
cmake --build glslang/build -j$(nproc) --target glslang-standalone && \
75+
cp glslang/build/StandAlone/glslang /usr/local/bin/glslangValidator && \
76+
rm -rf /tmp/glslang
77+
78+
# Install Vulkan SDK (headers, libraries, and layers)
79+
ENV VULKAN_SDK=/opt/vulkan-sdk/${VULKAN_SDK_VERSION}/x86_64
80+
RUN mkdir -p /opt/vulkan-sdk && \
81+
wget https://sdk.lunarg.com/sdk/download/${VULKAN_SDK_VERSION}/linux/vulkansdk-linux-x86_64-${VULKAN_SDK_VERSION}.tar.xz && \
82+
tar -xvf vulkansdk-linux-x86_64-${VULKAN_SDK_VERSION}.tar.xz -C /opt/vulkan-sdk && \
83+
rm vulkansdk-linux-x86_64-${VULKAN_SDK_VERSION}.tar.xz && \
84+
cp /usr/local/bin/glslangValidator ${VULKAN_SDK}/bin/glslangValidator
85+
86+
ENV PATH="${VULKAN_SDK}/bin:${PATH}"
87+
ENV LD_LIBRARY_PATH="${VULKAN_SDK}/lib:${LD_LIBRARY_PATH}"
88+
ENV VK_ADD_LAYER_PATH="${VULKAN_SDK}/share/vulkan/explicit_layer.d"
89+
ENV PKG_CONFIG_PATH="${VULKAN_SDK}/share/pkgconfig:${VULKAN_SDK}/lib/pkgconfig"
90+
91+
# Build FFmpeg from source (not available in RHEL 8 repos)
92+
WORKDIR /tmp
93+
RUN wget https://ffmpeg.org/releases/ffmpeg-4.4.6.tar.xz && \
94+
tar -xvf ffmpeg-4.4.6.tar.xz && \
95+
cd ffmpeg-4.4.6 && \
96+
./configure --enable-pic --enable-shared && \
97+
make -j$(nproc) && \
98+
make install && \
99+
ldconfig && \
100+
rm -rf /tmp/ffmpeg-4.4.6*
101+
102+
ENV HIP_PLATFORM=amd
103+
104+
WORKDIR /workspace
105+
106+
CMD ["/bin/bash"]

0 commit comments

Comments
 (0)