Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow Updates for GitHub CI #273

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4a0a693
Update PAPI GitHub CI to reduce the number of tests and to add shlib …
Nov 7, 2024
af68eb2
Updating GitHub CI.
Nov 8, 2024
3a87155
Reformat conditional check.
Nov 8, 2024
d8db022
Adding cuda_component.yml to test label.
Nov 8, 2024
7d92b68
Remove PAPI spack from cuda_component.yml
Nov 8, 2024
c66c4ed
Updat component specific yml.
Nov 8, 2024
8544293
Remove .yml titled cuda_component.yml.
Nov 8, 2024
99943f9
Update to be on push as well for per component.
Nov 8, 2024
b1a06f8
Updating conditional structure in per_component.yml
Nov 8, 2024
7c64e29
updating per_component.yml to remove on push.
Nov 8, 2024
7af72c0
Restructure on.
Nov 8, 2024
40f5d47
Test per_component.yml.
Nov 8, 2024
ba2dbcd
Restructure if in per_component.yml
Nov 8, 2024
2a6452c
Restructure conditional check in per_component.yml.
Nov 8, 2024
f4a8b19
Updating per component workflow to work with labels.
Nov 9, 2024
8f7fd17
Adding a worfklow for each component and the counter analysis toolkit.
Nov 14, 2024
79533d6
Removing all_native_events.c as it is in another PR and run_tests_shl…
Nov 14, 2024
1f5a1a1
Removing main.yml
Nov 14, 2024
c21790e
removing component check
Nov 14, 2024
4a53b13
testing papi framework workflow
Nov 14, 2024
c7c7d7a
update paths for per component .yml's.
Nov 14, 2024
f25dcfc
update paths for appio_component.yml
Nov 14, 2024
db95395
Update shlib script name.
Nov 14, 2024
cdc63d8
Restructure papi_framework
Nov 14, 2024
067df7d
update ci test for counter analysis toolkit.
Nov 15, 2024
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
45 changes: 45 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
As of now, the GitHub CI is designed to run in three instances:
1. A per component basis, meaning if a component's codebase is updated then we only will run CI tests for that component. As an example, if we update `cupti_profiler.c` in `src/components/cuda` then we will only run CI tests for that component.
2. A change in the PAPI framework i.e. in the `src/` directory. If this occurs then we will run a full test suite.
3. A weekly test which builds PAPI with multiple components. This is currently programmed to run weekly on Sundays at 5:00PM eastern time. This is being done to simulate users' behavior of compiling in multiple components for a PAPI build.


# Per Component Basis
All per component basis tests have a `.yml` that is structured with `componentName_component.yml`. As
an example for the `cuda` component we would have a `.yml` of `cuda_component.yml`. Therefore,
if a new component is added to PAPI, you will need to create a `.yml` based on the aforementioned structure.

Along with creating the `.yml` file, you will need to add an associated workflow. Below is a skeleton that can
be used as a starting point. As a reminder, make sure to change the necessary fields out for your component.

```
name: cuda # replace cuda with your component name

on:
pull_request:
paths:
- 'src/components/cuda/**' # replace the cuda path with your component

jobs:
component_tests:
strategy:
matrix:
component: [cuda] # replace cuda with your component name
debug: [yes, no]
shlib: [with, without]
fail-fast: false
runs-on: [self-hosted, nvidia_gpu]
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: cuda component tests # replace cuda with your component name
run: .github/workflows/ci_per_component.sh ${{matrix.component}} ${{matrix.debug}} ${{matrix.shlib}}
````

# PAPI Framework


# Weekly Test
For the weekly test, we utilize the files `weekly_papi_build.yml` and the script `ci_weekly_papi_build.sh`. Any changes for the weekly test need to be done to these two files.

As a reminder this weekly test is ran on Sunday's at 5:00PM eastern time.
23 changes: 23 additions & 0 deletions .github/workflows/appio_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: appio

on:
pull_request:
# run CI only if appio directory or appio sub-directories receive updates
# run CI if framework receives an update
paths:
- 'src/components/appio/**'

jobs:
component_tests:
strategy:
matrix:
component: [appio]
debug: [yes, no]
shlib: [with, without]
fail-fast: false
runs-on: [self-hosted, cpu_intel]
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: appio component tests
run: .github/workflows/ci_per_component.sh ${{matrix.component}} ${{matrix.debug}} ${{matrix.shlib}}
20 changes: 20 additions & 0 deletions .github/workflows/cat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: counter analysis toolkit

on:
pull_request:
# run CI for updates to counter analysis toolkit
paths:
- 'src/counter_analysis_toolkit/**'
jobs:
component_tests:
strategy:
matrix:
debug: [yes, no]
shlib: [with, without]
fail-fast: false
runs-on: [self-hosted, cpu_intel]
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: counter analysis toolkit tests
run: .github/workflows/ci_cat.sh ${{matrix.debug}} ${{matrix.shlib}}
62 changes: 0 additions & 62 deletions .github/workflows/ci.sh

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/ci_cat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash -e

DEBUG=$1
SHLIB=$2
COMPILER=$3

[ -z "$COMPILER" ] && COMPILER=gcc@11

source /etc/profile
set +x
set -e
trap 'echo "# $BASH_COMMAND"' DEBUG
shopt -s expand_aliases

module load $COMPILER

# configuring and install PAPI
if [ "$SHLIB" = "with" ]; then
./configure --prefix=$PWD/cat-ci --with-debug=$DEBUG --enable-warnings --with-shlib-tools
else
./configure --prefix=$PWD/cat-ci --with-debug=$DEBUG --enable-warnings
fi
make -j4 && make install

# set PAPI_DIR for CAT
export PAPI_DIR=$PWD/cat-ci

cd counter_analysis_toolkit

# check detected architecture was correct
DETECTED_ARCH=$(make | head -n 1 | grep -o 'ARCH.*')
if [ "$DETECTED_ARCH" != "ARCH=X86" ]; then
echo "Failed to detect appropriate architecture."
exit 1
fi

make -j4

mkdir OUT_DIR
echo "BR_INST_RETIRED 0" > event_list.txt
echo "PAPI_CI_FAKE_EVENT 0" >> event_list.txt
./cat_collect -in event_list.txt -out OUT_DIR -branch

# we expect this file to exist and have values
[ -f BR_INST_RETIRED.branch ]; [ -s BR_INST_RETIRED.branch ]
# we expect this file to exist but be empty
[ -f PAPI_CI_FAKE_EVENT.branch ]; [ ! -s PAPI_CI_FAKE_EVENT.branch ]
79 changes: 79 additions & 0 deletions .github/workflows/ci_papi_framework.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/bin/bash -e

COMPONENTS=$1
DEBUG=$2
SHLIB=$3
COMPILER=$4

[ -z "$COMPILER" ] && COMPILER=gcc@11

source /etc/profile
set +x
set -e
trap 'echo "# $BASH_COMMAND"' DEBUG
shopt -s expand_aliases

module load $COMPILER

cd src

# set necessary environment variables for lmsensors
case "$COMPONENTS" in
*"lmsensors"*)
wget https://github.com/groeck/lm-sensors/archive/V3-4-0.tar.gz
tar -zxf V3-4-0.tar.gz
cd lm-sensors-3-4-0
make install PREFIX=../lm ETCDIR=../lm/etc
cd ..
export PAPI_LMSENSORS_ROOT=lm
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PAPI_LMSENSORS_ROOT/lib
;;
esac

# set necessary environment variables for rocm and rocm_smi
case "$COMPONENTS" in
*"rocm rocm_smi"*)
export PAPI_ROCM_ROOT=`ls -d /opt/rocm-*`
export PAPI_ROCMSMI_ROOT=$PAPI_ROCM_ROOT/rocm_smi
;;
esac

# set necessary environment variables for cuda and nvml
case "$COMPONENTS" in
*"cuda nvml"*)
module load cuda
export PAPI_CUDA_ROOT=$ICL_CUDA_ROOT
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PAPI_CUDA_ROOT/extras/CUPTI/lib64
;;
esac

# test linking with or without --with-shlib-tools
if [ "$SHLIB" = "with" ]; then
./configure --with-debug=$DEBUG --enable-warnings --with-components="$COMPONENTS" --with-shlib-tools
else
./configure --with-debug=$DEBUG --enable-warnings --with-components="$COMPONENTS"
fi

make -j4

# run PAPI utilities
utils/papi_component_avail

# check list of active components
#ACTIVE_COMPONENTS=$(utils/papi_component_avail | grep -A1000 'Active components' | grep "Name:" | sed 's/Name: //' | awk '{print $1}' | paste -sd ' ' -)
#EXPECTED_ACTIVE_COMPONENTS="perf_event perf_event_uncore cuda nvml powercap net appio io stealtime coretemp lmsensors sde sysdetect"
#if [ "$ACTIVE_COMPONENTS" != "$EXPECTED_ACTIVE_COMPONENTS" ]; then
# DISABLED_COMPONENTS=$(diff --side-by-side --suppress-common-lines <(echo "$EXPECTED_ACTIVE_COMPONENTS" | sed 's/ /\n/g') <(echo "$ACTIVE_COMPONENTS" | sed 's/ /\n/g') | awk '{print $2}')
# echo -e "Components are disabled that should be active, these are:\n$DISABLED_COMPONENTS"
# exit 1
#fi

# without '--with-shlib-tools' in ./configure
if [ "$SHLIB" = "without" ]; then
echo "Running full test suite for active components"
./run_tests.sh
# with '--with-shlib-tools' in ./configure
else
echo "Running single component test for active components"
./ci_run_tests_shlib.sh TESTS_QUIET
fi
74 changes: 74 additions & 0 deletions .github/workflows/ci_per_component.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/bin/bash -e

COMPONENT=$1
DEBUG=$2
SHLIB=$3
COMPILER=$4

[ -z "$COMPILER" ] && COMPILER=gcc@11

source /etc/profile
set +x
set -e
trap 'echo "# $BASH_COMMAND"' DEBUG
shopt -s expand_aliases

module load $COMPILER

CPU_COMPONENTS="perf_event perf_event_uncore sysdetect"

cd src

# lmsensors environment variables
if [ "$COMPONENT" = "lmsensors"]; then
wget https://github.com/groeck/lm-sensors/archive/V3-4-0.tar.gz
tar -zxf V3-4-0.tar.gz
cd lm-sensors-3-4-0
make install PREFIX=../lm ETCDIR=../lm/etc
cd ..
export PAPI_LMSENSORS_ROOT=lm
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PAPI_LMSENSORS_ROOT/lib
fi

# rocm and rocm_smi environment variables
if [ "$COMPONENT" = "rocm" || "$COMPONENT" = "rocm_smi" ]; then
export PAPI_ROCM_ROOT=`ls -d /opt/rocm-*`
export PAPI_ROCMSMI_ROOT=$PAPI_ROCM_ROOT/rocm_smi
fi

# set necessary environemnt variables for cuda and nvml
if [ "$COMPONENT" = "cuda" || "$COMPONENT" = "nvml" ]; then
module load cuda
export PAPI_CUDA_ROOT=$ICL_CUDA_ROOT
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PAPI_CUDA_ROOT/extras/CUPTI/lib64
fi

# test linking with or without --with-shlib-tools
if [ "$SHLIB" = "with" ]; then
./configure --with-debug=$DEBUG --enable-warnings --with-components="$COMPONENT" --with-shlib-tools
else
./configure --with-debug=$DEBUG --enable-warnings --with-components="$COMPONENT"
fi

make -j4

# run PAPI utilities
utils/papi_component_avail
ACTIVE_COMPONENTS=$(utils/papi_component_avail | grep -A1000 'Active components' | grep "Name:" | sed 's/Name: //' | awk '{print $1}' | paste -sd ' ' -)

#if [ "$ACTIVE_COMPONENTS" != "$CPU_COMPONENTS $COMPONENT" ]; then
# DISABLED_COMPONENTS=$(diff --side-by-side --suppress-common-lines <(echo "$EXPECTED_ACTIVE_COMPONENTS" | sed 's/ /\n/g') <(echo "$ACTIVE_COMPONENTS" | sed 's/ /\n/g') | awk '{print $2}')
# echo -e "Components are disabled that should be active, these are:\n$DISABLED_COMPONENTS"
# exit 1
#fi


# without '--with-shlib-tools' in ./configure
if [ "$SHLIB" = "without" ]; then
echo "Running full test suite for active components"
./run_tests.sh
# with '--with-shlib-tools' in ./configure
else
echo "Running single component test for active components"
./ci_run_tests_shlib.sh TESTS_QUIET
fi
23 changes: 23 additions & 0 deletions .github/workflows/coretemp_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: coretemp

on:
pull_request:
# run CI only if coretemp directory or coretemp sub-directories receive updates
# run CI if framework receives an update
paths:
- 'src/components/coretemp/**'

jobs:
component_tests:
strategy:
matrix:
component: [coretemp]
debug: [yes, no]
shlib: [with, without]
fail-fast: false
runs-on: [self-hosted, cpu_intel]
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: coretemp component tests
run: .github/workflows/ci_per_component.sh ${{matrix.component}} ${{matrix.debug}} ${{matrix.shlib}}
Loading
Loading