Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
41117ca
Update h2yaml versions
thilinarmtb Mar 12, 2026
4672e2b
Update h2yaml package
thilinarmtb Mar 13, 2026
0b439c4
Pin llvm version to 18
thilinarmtb Mar 13, 2026
55e082c
Install libclang and python3-clang
thilinarmtb Mar 13, 2026
28d8863
Move tmate out of the setup-thapi-deps action
thilinarmtb Mar 13, 2026
3566ed9
Patch llvm@18 packages.yml entry to have `+python`
thilinarmtb Mar 13, 2026
4bad5fc
Mark h2yaml as a build dependency
thilinarmtb Mar 13, 2026
ff3b60e
Add the latest h2yaml version
thilinarmtb Mar 17, 2026
82cd44b
Appending PYTHONPATH to see if we can import clang
thilinarmtb Mar 17, 2026
86f6d91
Much cleaner workaround for GitHub CI
thilinarmtb Mar 17, 2026
06ff710
Minor cleanup
thilinarmtb Mar 17, 2026
a384ca2
Find site-packages dir using major/minor versions
thilinarmtb Mar 17, 2026
8e754ee
Add thapi v0.0.13
thilinarmtb Mar 19, 2026
974149f
Update GitHub CI
thilinarmtb Mar 19, 2026
ae52696
Check thapi for clang-parser in bash
thilinarmtb Mar 19, 2026
c5778ff
Rename the workflow
thilinarmtb Mar 19, 2026
2a359c6
Remove `thapi` from CI matrix since it is the same as `thapi@master`
thilinarmtb Mar 19, 2026
c6d59ce
Fix a typo
thilinarmtb Mar 19, 2026
edc7d04
Add the skip check
thilinarmtb Mar 23, 2026
66951eb
Get rid of deprecated `+mpi` variant
thilinarmtb Mar 23, 2026
e6d8e29
Add `+clang-parser`
thilinarmtb Mar 24, 2026
84e9178
Remove pin to llvm@18, explicitly ask for `+clang`
thilinarmtb Mar 24, 2026
a7c4194
Install llvm from apt during dependency install
thilinarmtb Mar 24, 2026
c4e41bb
Add llvm apt-key
thilinarmtb Mar 25, 2026
875a4a2
Use json output to figure out the version
thilinarmtb Mar 26, 2026
099202b
Run CI only on PR and commits to main
thilinarmtb Mar 26, 2026
e3122aa
Get rid of pre_job
thilinarmtb Mar 26, 2026
0f5bf90
Find compilers after installing llvm
thilinarmtb Mar 26, 2026
42d4b48
Update alternatives
thilinarmtb Mar 26, 2026
0459357
Use the same spec
thilinarmtb Mar 26, 2026
1a339fb
Get rid of Polaris workaround
thilinarmtb Mar 26, 2026
180d119
Avoid updating alternatives
thilinarmtb Mar 27, 2026
d4bc17d
Re-add Polaris workaround
thilinarmtb Mar 27, 2026
173feba
Increase tmate time to 2h
thilinarmtb Mar 27, 2026
3068769
Split the install workflow into two
thilinarmtb Mar 27, 2026
f2157d8
Fix h2yaml versions
thilinarmtb Mar 27, 2026
7856ebb
More fixes and simplifications
thilinarmtb Mar 27, 2026
e05ac18
Add a comment on ^llvm@${LLVM_FULL_VER}
thilinarmtb Mar 27, 2026
db2610c
Fix a typo, mv presubmit.yml --> ci.yml
thilinarmtb Mar 30, 2026
806db98
Install LLVM/Clang as part of the action
thilinarmtb Mar 30, 2026
36d61bc
thapi --> THAPI
thilinarmtb Mar 31, 2026
b4c557c
Minor refactor
thilinarmtb Mar 31, 2026
c4b3909
deprecated --> legacy
thilinarmtb Mar 31, 2026
6103ad7
Add comments
thilinarmtb Mar 31, 2026
fd03fbf
Update actions to v6
thilinarmtb Mar 31, 2026
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
70 changes: 59 additions & 11 deletions .github/actions/setup-thapi-deps/action.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: 'Setup Thapi Deps'
name: 'Setup THAPI dependencies'
inputs:
cache-dir:
description: 'Directory for spack cache'
required: true
install-llvm:
description: 'Install LLVM/Clang and add related workarounds'
required: true
runs:
using: "composite"
steps:
Expand All @@ -11,28 +14,73 @@ runs:
with:
packages: libnuma-dev
- name: Checkout Spack
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: spack/spack
ref: releases/latest
path: external/spack
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
detached: true
if: ${{ github.event_name == 'workflow_dispatch' && (inputs.debug_enabled == true || inputs.debug_enabled == 'true') }}
- name: Setup spack environment
- name: Add THAPI repo
shell: bash
run: |
. external/spack/share/spack/setup-env.sh
spack repo add ./
spack compiler find
# find external packages known to spack (avoid bzip2 and xz since
- name: Find compilers and external packages
shell: bash
run: |
# Find external packages known to spack (avoid bzip2 and xz since
# they cause build failures in elfutils).
. external/spack/share/spack/setup-env.sh
spack compiler find
spack external find --all --exclude bzip2 --exclude xz

- name: Setup spack mirror
shell: bash
run: |
# Setup a spack mirror to store built packages. More info can be
# found here:
# https://spack.readthedocs.io/en/latest/binary_caches.html
. external/spack/share/spack/setup-env.sh
spack mirror add --autopush --unsigned thapi_cache ${{ inputs.cache-dir }}
- name: Install llvm/clang version in thapi@develop+clang-parser spec
shell: bash
if: ${{ inputs.install-llvm == 'true' }}
run: |
# Source spack
. external/spack/share/spack/setup-env.sh

# Find the llvm major version in the thapi@develop+clang-parser variant. We
# need to filter out the fetch lines generated by `spack spec` when it is run
# for the first time. These lines start with `==>`.
LLVM_VER=$( spack spec -j thapi@develop+clang-parser | grep -v '==>' | jq '.spec.nodes[] | select(.name == "llvm") | .version' )
# Extract major version (21) from "\"21.1.4\"".
LLVM_VER=$( echo $LLVM_VER | awk '{ split($0,a,"[\".]"); print a[2] }' )

# Add llvm to apt repository.
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
REPO="deb http://apt.llvm.org/noble/ llvm-toolchain-noble-${LLVM_VER} main"
echo "$REPO" | sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt-get update

# Install llvm/clang
sudo apt-get install libllvm${LLVM_VER} llvm-${LLVM_VER} llvm-${LLVM_VER}-dev
sudo apt-get install clang-${LLVM_VER} libclang-${LLVM_VER}-dev python3-clang-${LLVM_VER}

# Let spack find newly installed llvm/clang.
spack compiler find
spack external find --all --exclude bzip2 --exclude xz

LLVM_FULL_VER=`llvm-config-${LLVM_VER} --version`
echo "LLVM_FULL_VER=${LLVM_FULL_VER}" >> ${GITHUB_ENV}
- name: Workaround for providing llvm+python in GitHub CI runners
shell: bash
if: ${{ inputs.install-llvm == 'true' }}
run: |
# Symlink python3-clang package to site-packages so h2yaml won't fail on
# `import clang`. This way, our llvm+python trick will work without an issue.
python_major=$(python -c "import sys; print(f'{sys.version_info.major}')")
Comment thread
thilinarmtb marked this conversation as resolved.
python_minor=$(python -c "import sys; print(f'{sys.version_info.minor}')")
SITE_PACKAGES=/usr/lib/python${python_major}.${python_minor}/site-packages
sudo mkdir -p ${SITE_PACKAGES}
sudo ln -s /usr/lib/python${python_major}/dist-packages/clang ${SITE_PACKAGES}/clang

# Trick spack to think that llvm found in packages.yml has +python variant:
sed -i 's/llvm@[0-9][0-9]\.[0-9]\.[0-9]/&+python/' ~/.spack/packages.yaml
164 changes: 164 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
name: THAPI unit tests
Comment thread
thilinarmtb marked this conversation as resolved.
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
env:
SPACK_OPT: "--concurrent-packages 2 --show-log-on-error --fail-fast"
CACHE_DIR: "${{ github.workspace }}/thapi_cache_${{ github.run_id }}"
CACHE_DIR_LEGACY: "${{ github.workspace }}/thapi_cache_legacy_${{ github.run_id }}"
jobs:
install_legacy_dependencies:
runs-on: ubuntu-latest
name: Install dependencies (legacy)
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ inputs.debug_enabled }}
- name: Checkout dependencies (spack,...)
uses: ./.github/actions/setup-thapi-deps
with:
cache-dir: ${{ env.CACHE_DIR_LEGACY }}
install-llvm: 'false'
- name: Install dependencies
run: |
# Install the dependencies of the latest legacy version.
. external/spack/share/spack/setup-env.sh
spack install --only dependencies $SPACK_OPT thapi@0.0.12
Comment thread
thilinarmtb marked this conversation as resolved.
- name: Upload THAPI build cache
uses: actions/upload-artifact@v6
with:
name: thapi_cache_legacy
include-hidden-files: true
path: ${{ env.CACHE_DIR_LEGACY }}
if-no-files-found: error
- name: Block to allow inspecting failures
run: sleep 120m
if: ${{ failure() && inputs.debug_enabled }}
install_legacy:
strategy:
matrix:
version: ['thapi@0.0.7', 'thapi@0.0.8', 'thapi@0.0.9', 'thapi@0.0.10', 'thapi@0.0.11', 'thapi@0.0.12']
needs: install_legacy_dependencies
runs-on: ubuntu-latest
name: Install ${{ matrix.version }} (legacy)
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ inputs.debug_enabled }}
- name: Download THAPI build cache
uses: actions/download-artifact@v6
with:
name: thapi_cache_legacy
path: ${{ env.CACHE_DIR_LEGACY }}
- name: Checkout dependencies (spack,...)
uses: ./.github/actions/setup-thapi-deps
with:
cache-dir: ${{ env.CACHE_DIR_LEGACY }}
install-llvm: 'false'
- name: Install ${{ matrix.version }}
if: ${{ matrix.version != 'thapi@develop ^lttng-tools@master ^lttng-ust@master ^babeltrace2@master' }}
run: |
. external/spack/share/spack/setup-env.sh
spack install $SPACK_OPT ${{ matrix.version }}
- name: Block to allow inspecting failures
run: sleep 120m
if: ${{ failure() && inputs.debug_enabled }}
install_dependencies:
runs-on: ubuntu-latest
name: Install dependencies
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ inputs.debug_enabled }}
- name: Checkout dependencies (spack,...)
uses: ./.github/actions/setup-thapi-deps
with:
cache-dir: ${{ env.CACHE_DIR }}
install-llvm: 'true'
- name: Install dependencies
run: |
. external/spack/share/spack/setup-env.sh
# We have to use the exact llvm version from apt package as a direct dependency
# as the versions in apt and spack doesn't agree to the patch version. The
# latter will force spack to build llvm from scratch.
spack install --only dependencies $SPACK_OPT thapi@develop ^llvm@${LLVM_FULL_VER}
- name: Upload THAPI build cache
uses: actions/upload-artifact@v6
with:
name: thapi_cache
include-hidden-files: true
path: ${{ env.CACHE_DIR }}
if-no-files-found: error
- name: Block to allow inspecting failures
run: sleep 120m
if: ${{ failure() && inputs.debug_enabled }}
install:
strategy:
matrix:
version: ['thapi@0.0.13', 'thapi@master', 'thapi@develop', 'thapi@develop+archive',
'thapi@develop ^lttng-tools@master ^lttng-ust@master ^babeltrace2@master']
needs: install_dependencies
runs-on: ubuntu-latest
name: Install ${{ matrix.version }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ inputs.debug_enabled }}
- name: Download THAPI build cache
uses: actions/download-artifact@v6
with:
name: thapi_cache
path: ${{ env.CACHE_DIR }}
- name: Checkout dependencies (spack,...)
uses: ./.github/actions/setup-thapi-deps
with:
cache-dir: ${{ env.CACHE_DIR }}
install-llvm: 'true'
- name: Install ${{ matrix.version }}
if: ${{ matrix.version != 'thapi@develop ^lttng-tools@master ^lttng-ust@master ^babeltrace2@master' }}
run: |
. external/spack/share/spack/setup-env.sh
spack install $SPACK_OPT ${{ matrix.version }} ^llvm@${LLVM_FULL_VER}
- name: Install thapi@develop with master versions of dependencies
if: ${{ matrix.version == 'thapi@develop ^lttng-tools@master ^lttng-ust@master ^babeltrace2@master' }}
continue-on-error: true
run: |
# This is an allowed failure. We don't care if this test failed
# (Building thapi@develop with unstable lttng@master versions).
. external/spack/share/spack/setup-env.sh
spack install $SPACK_OPT ${{ matrix.version }} ^llvm@${LLVM_FULL_VER} || true
Comment thread
thilinarmtb marked this conversation as resolved.
- name: Block to allow inspecting failures
run: sleep 120m
if: ${{ failure() && inputs.debug_enabled }}
cleanup:
needs: [install, install_legacy]
if: always()
runs-on: ubuntu-latest
name: Cleanup the build cache
steps:
- name: Checkout
uses: actions/checkout@v6
- uses: geekyeggo/delete-artifact@v5
with:
name: |
thapi_cache_legacy
thapi_cache
4 changes: 2 additions & 2 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Checkout Spack
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: spack/spack
ref: releases/latest
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: Lint checks
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
inputs:
debug_enabled:
Expand All @@ -16,7 +20,7 @@ jobs:
name: Check formatting with ruff
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: ruff format check
uses: astral-sh/ruff-action@v3
with:
Expand Down
104 changes: 0 additions & 104 deletions .github/workflows/presubmit.yml

This file was deleted.

Loading
Loading