Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 62 additions & 20 deletions .github/workflows/atfl_nightly_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

# This workflow runs all build scripts in parallel for multiple operating
# systems and architectures.
# This workflow builds Docker images for multiple operating systems and runs
# the Linux build script inside each image.
# It is intended to be triggered as part of a **nightly build** to
# validate all build configurations and test them automatically.
#
# Each build script is paired with a corresponding test script using
# a matrix strategy. Each build+test pair runs as a separate job,
# Each Docker image and build script pair runs as a separate matrix job,
# allowing for concurrency and clear traceability of failures.

name: ATfL Nightly Build and Test
Expand All @@ -19,10 +18,17 @@ on:
schedule:
- cron: '0 6 * * *' # Every day at 06:00 UTC

# GitHub queues the second run until the first one finishes,
# preventing overlapping executions.
concurrency:
group: atfl-nightly-build
cancel-in-progress: false

jobs:
build-and-test-toolchain:
name: Build ${{ matrix.build_script }} for ${{ matrix.target_os }} on ${{ matrix.runner }}
runs-on: ${{ matrix.runner }}
name: Build ${{ matrix.build_script }} in ${{ matrix.image_name }}
runs-on: ah-ubuntu_24_04-c7g_8x-100
timeout-minutes: 240
env:
ATFL_VERSION: "0.0"

Expand All @@ -34,11 +40,17 @@ jobs:
fail-fast: false # Prevents one job failure from cancelling all
matrix:
include:
# Complete Toolchain Build & Test
# Ubuntu Build & Test
- build_script: build.sh
install_script: install_dependencies_ubuntu.sh
target_os: Ubuntu-24.04-arm64
runner: ah-ubuntu_24_04-c7g_8x-100
dockerfile: Dockerfile_ubuntu2404
image_name: ubuntu2404_docker

# RHEL10 Build & Test
- build_script: build.sh
target_os: RHEL10-arm64
dockerfile: Dockerfile_rhel10
image_name: rhel10_docker

steps:
- name: Checkout
Expand All @@ -47,34 +59,64 @@ jobs:
- name: Add ~/.local/bin to PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Install Dependencies
run: ./arm-software/linux/scripts/${{ matrix.install_script }}

- name: Clean previous artifacts
run: rm -rf arm-software/linux/output arm-software/linux/build
run: rm -rf arm-software/linux/output arm-software/linux/build arm-software/linux/logs

- name: Mark workspace as safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

- name: Build (Unix)
- name: Build Docker image
shell: bash
run: |
set -euo pipefail

docker build \
--file "arm-software/linux/scripts/Docker_Files/${{ matrix.dockerfile }}" \
--tag "${{ matrix.image_name }}" \
--build-arg USER_ID="$(id -u)" \
--build-arg GROUP_ID="$(id -g)" \
arm-software/linux/scripts/Docker_Files

- name: Run build.sh in Docker image
shell: bash
run: |
set -euo pipefail
./arm-software/linux/${{ matrix.build_script }} 2>&1 | tee build.log

docker run --rm \
--volume "$GITHUB_WORKSPACE:/workspace/src" \
--workdir /workspace \
"${{ matrix.image_name }}" \
bash -lc '
set -euo pipefail
git config --global --add safe.directory /workspace/src

if [[ "${{ matrix.target_os }}" == RHEL10-* ]]; then
export ZLIB_STATIC_PATH=/usr/lib64/libz.a
fi

./src/arm-software/linux/${{ matrix.build_script }}
' 2>&1 | tee build-${{ matrix.target_os }}.log

- name: List built artifacts
if: ${{ success() }}
shell: bash
run: |
set -euo pipefail
find arm-software/linux/output -maxdepth 3 -type f \( -name '*.tar.gz' -o -name '*.deb' \) | sort
if [[ -d arm-software/linux/output ]]; then
find arm-software/linux/output -maxdepth 3 -type f \( -name '*.tar.gz' \) | sort
fi

- name: Upload build log
- name: Upload build log and test reports
uses: actions/upload-artifact@v7
if: ${{ always() && !env.ACT }}
with:
name: build-log-${{ matrix.target_os }}
path: build.log
path: |
build-${{ matrix.target_os }}.log
arm-software/linux/logs/bootstrap_check_all.xml
arm-software/linux/logs/check_cxx.xml
arm-software/linux/logs/check_cxxabi.xml
arm-software/linux/logs/product_check_all.xml
if-no-files-found: warn

- name: Get tarball name
Expand All @@ -89,8 +131,8 @@ jobs:
filename=$(basename "$path")
date=$(date -u +%Y%m%d)

# Strip .tar.gz, append date, then add extension back.
artifact_name="${filename%.tar.gz}-${date}.tar.gz"
# Strip .tar.gz, append OS and date, then add extension back.
artifact_name="${filename%.tar.gz}-${{ matrix.target_os }}-${date}.tar.gz"

echo "name=$artifact_name" >> "$GITHUB_OUTPUT"
echo "path=$path" >> "$GITHUB_OUTPUT"
Expand Down
121 changes: 121 additions & 0 deletions arm-software/linux/scripts/Docker_Files/Dockerfile_rhel10
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
FROM registry.access.redhat.com/ubi10/ubi:latest

# Enable the running user to own the build
ARG USER_ID=1001
ARG GROUP_ID=1002
ARG USER=cicd
ARG WORKSPACE=/workspace

RUN groupadd -g ${GROUP_ID} ${USER} || true && \
useradd -u ${USER_ID} -g ${GROUP_ID} -m ${USER} && \
mkdir -p ${WORKSPACE}/build \
${WORKSPACE}/lib \
${WORKSPACE}/logs \
${WORKSPACE}/output \
${WORKSPACE}/patches \
${WORKSPACE}/python \
${WORKSPACE}/src && \
chown -R ${USER}:${GROUP_ID} ${WORKSPACE}

# Install dependencies
ADD RPM-GPG-KEY-AlmaLinux-10 /etc/pki/rpm-gpg/
ADD *.repo /etc/yum.repos.d/

RUN sed -i '/^\[.*\]/a priority=1' /etc/yum.repos.d/ubi.repo

RUN dnf install -y dnf-plugins-core && \
dnf config-manager --set-enabled crb && \
dnf update -y && \
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm && \
dnf install -y --allowerasing --nobest \
binutils-devel \
cpio \
diffutils \
graphviz \
environment-modules \
file \
gnupg2 \
glibc-common \
isl-devel \
libgcc \
libmpc \
libmpc-devel \
libzstd \
libzstd-devel \
libzstd-static \
gcc \
gcc-c++ \
git \
isl \
make \
mpfr \
mpfr-devel \
patch \
perl \
perl-File-Copy \
perl-FindBin \
python3.12 \
python3.12-devel \
python3.12-pip \
unzip \
wget \
zlib-devel \
zlib-static \
zstd

# Install cmake from precompiled-binaries
RUN version=4.3.4 \
&& mkdir /tmp/temp \
&& cd /tmp/temp \
&& wget https://github.com/Kitware/CMake/releases/download/v$version/cmake-$version-linux-aarch64.tar.gz \
&& wget https://github.com/Kitware/CMake/releases/download/v$version/cmake-$version-SHA-256.txt \
&& sha256sum -c --ignore-missing cmake-$version-SHA-256.txt \
&& wget https://github.com/Kitware/CMake/releases/download/v$version/cmake-$version-SHA-256.txt.asc \
&& gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys C6C265324BBEBDC350B513D02D2CEF1034921684 \
&& gpg --verify cmake-$version-SHA-256.txt.asc cmake-$version-SHA-256.txt \
&& tar -xzvf cmake-$version-linux-aarch64.tar.gz -C /opt \
&& cd ~ && rm -rfv /tmp/temp \
&& alternatives \
--install /usr/local/bin/cmake cmake /opt/cmake-$version-linux-aarch64/bin/cmake 10 \
--slave /usr/local/bin/ctest ctest /opt/cmake-$version-linux-aarch64/bin/ctest \
--slave /usr/local/bin/cpack cpack /opt/cmake-$version-linux-aarch64/bin/cpack \
--slave /usr/local/bin/ccmake ccmake /opt/cmake-$version-linux-aarch64/bin/ccmake \
--family cmake \
&& cmake --version \
&& ctest --version \
&& cpack --version

RUN ninja_version=1.12.1 \
&& wget https://github.com/ninja-build/ninja/releases/download/v$ninja_version/ninja-linux-aarch64.zip \
&& unzip ninja-linux-aarch64.zip \
&& mv ninja /usr/bin \
&& rm ninja-linux-aarch64.zip

RUN ln -fs /usr/bin/python3.12 /usr/bin/python && \
ln -fs /usr/bin/python3.12 /usr/bin/python3

ADD pyproject.toml poetry.lock ${WORKSPACE}/python/
WORKDIR ${WORKSPACE}/python

RUN python3.12 -m pip install --no-cache-dir poetry \
&& poetry config virtualenvs.in-project true \
&& poetry install --no-root --no-interaction --no-ansi

ENV PATH="${WORKSPACE}/python/.venv/bin:$PATH"
ENV PYTHON_HOME=${WORKSPACE}/python/.venv

# On some of our machines, the host configuration created issues with the permissions of the filesystem
# Those permission issues prevented the normal initialization of the modules
RUN echo "source /usr/share/Modules/init/bash" >> /home/${USER}/.bashrc

# Copy the entrypoint into the container and make it executable
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh

WORKDIR ${WORKSPACE}

# Set the user to run the build
USER ${USER}

# Run the entrypoint
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]
92 changes: 92 additions & 0 deletions arm-software/linux/scripts/Docker_Files/Dockerfile_ubuntu2404
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
FROM ubuntu:24.04

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y ca-certificates curl
RUN sed -i 's|http://ports.ubuntu.com/ubuntu-ports|https://ports.ubuntu.com/ubuntu-ports|g' /etc/apt/sources.list.d/ubuntu.sources

# Enable the running user to own the build
# And creates required directories
ARG USER_ID=1001
ARG GROUP_ID=1002
ARG USER=cicd
ARG WORKSPACE=/workspace

RUN getent group ${GROUP_ID} >/dev/null || groupadd -g ${GROUP_ID} ${USER} && \
getent passwd ${USER_ID} >/dev/null || useradd -u ${USER_ID} -g ${GROUP_ID} -m ${USER} && \
mkdir -p ${WORKSPACE}/build \
${WORKSPACE}/lib \
${WORKSPACE}/logs \
${WORKSPACE}/output \
${WORKSPACE}/patches \
${WORKSPACE}/python \
${WORKSPACE}/src && \
chown -R ${USER_ID}:${GROUP_ID} ${WORKSPACE}

# Install dependencies
RUN apt-get update && apt-get install -y \
binutils-dev \
build-essential \
ca-certificates \
gnupg \
graphviz \
git \
libzstd-dev \
python3.12 \
python3.12-dev \
python3.12-venv \
python3-pip \
unzip \
wget \
zlib1g-dev

# Install cmake from precompiled-binaries: https://cmake.org/download/
RUN version=4.3.4 \
&& mkdir /tmp/temp \
&& cd /tmp/temp \
&& wget https://github.com/Kitware/CMake/releases/download/v$version/cmake-$version-linux-aarch64.tar.gz \
&& wget https://github.com/Kitware/CMake/releases/download/v$version/cmake-$version-SHA-256.txt \
&& sed -i '/.* cmake-'"$version"'-linux-aarch64.tar.gz/!d' cmake-$version-SHA-256.txt \
&& sha256sum -c cmake-$version-SHA-256.txt \
&& curl -OL https://github.com/Kitware/CMake/releases/download/v$version/cmake-$version-SHA-256.txt \
&& wget https://github.com/Kitware/CMake/releases/download/v$version/cmake-$version-SHA-256.txt.asc \
&& gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys C6C265324BBEBDC350B513D02D2CEF1034921684 \
&& gpg --verify cmake-$version-SHA-256.txt.asc cmake-$version-SHA-256.txt \
&& tar -xzvf cmake-$version-linux-aarch64.tar.gz -C /opt \
&& cd $HOME && rm -rfv /tmp/temp \
&& update-alternatives \
--install /usr/local/bin/cmake cmake /opt/cmake-$version-linux-aarch64/bin/cmake 10 \
--slave /usr/local/bin/ctest ctest /opt/cmake-$version-linux-aarch64/bin/ctest \
--slave /usr/local/bin/cpack cpack /opt/cmake-$version-linux-aarch64/bin/cpack \
--slave /usr/local/bin/ccmake ccmake /opt/cmake-$version-linux-aarch64/bin/ccmake \
&& cmake --version \
&& ctest --version \
&& cpack --version \
&& ccmake --version

RUN ninja_version=1.12.1 \
&& wget https://github.com/ninja-build/ninja/releases/download/v$ninja_version/ninja-linux-aarch64.zip \
&& unzip ninja-linux-aarch64.zip \
&& mv ninja /usr/bin \
&& rm ninja-linux-aarch64.zip

ADD pyproject.toml poetry.lock ${WORKSPACE}/python/
WORKDIR ${WORKSPACE}/python
RUN python3.12 -m venv .venv && \
.venv/bin/pip3 install --no-cache-dir poetry && \
.venv/bin/poetry config virtualenvs.in-project true && \
.venv/bin/poetry install --no-root --no-interaction --no-ansi

ENV PATH="${WORKSPACE}/python/.venv/bin:$PATH"
ENV PYTHON_HOME=${WORKSPACE}/python/.venv

# Copy the entrypoint into the container and make it executable
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh

WORKDIR ${WORKSPACE}

# Set the user to run the build
USER ${USER_ID}

# Set the entrypoint
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----

mQINBGaP6O8BEACvg8IlAxGayV8zOi9Ex+Pd8lrj2BrBzloG8ri84ORp9o8ojq7l
ykKmIElHe11cQD2Lf/a4lcQQ4Ec3baiD786X6K2eVSlBEAnZMzfjDg8R63SfsBuu
8Yk+lUyqlBrDnSDYaPruOAzLIz2r82ikIC1jDbipZsMFPFHPI4/hayyWxJ3oGxRe
0mbtYLB9ElEKngt+/hfo7JLklakbznyIRuVEF3VrZb91XC6r/idqfJoNyBXSKidj
z0IwqOhgkLUk84rzltDo3AzwGqusd7PEuhOmqinOhp0hMdXsztD4TVyhw82iXu/O
onOAObZTZYfM6Z8btmDqkoo0aT+oPPCuZ3yC/caU9dhvCSXET/CGoXc3hL55u9PV
qmcVm/mwvuEImEAvxVc0/dBzEUk+FwW8KsaN3HoUKrC4/NqgmaQz8/42np7u2j+B
OOJ4hAckNEdWd8rB86CYN00sdxnvLBsp8V3IwEqXLhGOoBsagy61Z8hKCM+siOGn
xmbbybgaLOs+DPlxt9LrtgLJHODwmD96oysUPJuA0lv8KMiSpId0tSpp9Wn/wHBG
kRgxGYfzQu7WRvRZqQaleft1JTXXOjNzPur0RkJyb3yFwAoxpePyo/WrupM41OHW
58cEqdC6riCnJcS4U84RLj+hwvufBVB7areQ75sETnKeyozZW+P16E1t/wARAQAB
tChBbG1hTGludXggT1MgMTAgPHBhY2thZ2VyQGFsbWFsaW51eC5vcmc+iQJMBBMB
CgA2FiEE7m23uY9b9e3Z2g3l3uXBHMKh5XIFAmaP6O8CGwMECwkIBwQVCgkIBRYC
AwEAAh4FAheAAAoJEN7lwRzCoeVy32AP/A2+KI+JhmsxnactSptkAWGyAAf1YBWW
Js2sc9OJdKj7uIkzszCx7c7VIVeF/VLijIYpM/zwUgir5S5SimzQmY+FumwbKIml
K5RBsoSog22i7Edho0MLa1pa6qvnKS0nkl9DEcu8EbMUhucWbxGnCG/22EEMTrY+
Si1IZNkDGtlBHHBKMC+STbqqTxtdy4tAd2NYwWh3sBIh6PF7T4NLRAugu7PZQr5K
amS4z2lV3ebshGjieA0Zoznwh0AXgN0gZ/0pC/LXI25gcgtrvkCyL8Fe0AyZUMd8
UvZXaRSsm3SkCUIlGjPrvuItn1D7tHmqVSCDKXDM2TqjfiRm1JF+2OFCBNvGz19V
LxWd/Gf+0qw0dtKxRMKzGh0mxXY40hjtmYZulrPxhG5itNDjStovgrevM1HBsXs9
ikrkOGQ0pFcqizTn4ZKAmMozEMuIuV89Vof2bBCg7pHT1FmXVdAaYJxb6a7A/CgN
qHjoh8AxBiGw/Q2NM4YJlUVhHqqd+/lUG3WJqACNEnqSlZkYQ3HqNNaKhHVbD4mN
q/g6v+f8aWWDZDsI6IAfbJUB+KPEnIvQJQleWuHrq7kcUMhEq3dwBMIoTVEHhUUr
RQKToSEM1rN7PcanaXQM2gy141dS7tFLxhapG8ug75LkIUnEOpPMtUjvrU1ZELGq
36vVHBB+dTDg
=tJCw
-----END PGP PUBLIC KEY BLOCK-----
Loading