Skip to content

Commit dd4ffd5

Browse files
committed
Make sure the workflow retriggers on the right label
1 parent 42eb8f3 commit dd4ffd5

1 file changed

Lines changed: 144 additions & 140 deletions

File tree

.github/workflows/test-software.eessi.io.yml

Lines changed: 144 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
push:
55
branches: [ "main" ]
66
pull_request:
7+
types:
8+
- opened
9+
- synchronize
10+
- labeled
711
workflow_dispatch:
812
permissions:
913
contents: read # to fetch code (actions/checkout)
@@ -147,11 +151,11 @@ jobs:
147151
echo "EOF" >> "$GITHUB_OUTPUT"
148152
149153
check_missing:
150-
# if: >
151-
# (
152-
# contains(github.event.pull_request.labels.*.name, 'bot:deploy')
153-
# || contains(github.event.pull_request.labels.*.name, 'force-ci-checks')
154-
# )
154+
if: >
155+
(
156+
contains(github.event.pull_request.labels.*.name, 'bot:deploy')
157+
|| contains(github.event.pull_request.labels.*.name, 'force-ci-checks')
158+
)
155159
needs: check_EESSI_version_changed_files
156160
strategy:
157161
fail-fast: false
@@ -172,151 +176,151 @@ jobs:
172176

173177
runs-on: ${{ matrix.runs_on }}
174178
steps:
175-
- name: Check out software-layer repository
176-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
177-
with:
178-
fetch-depth: 0 # Fetch all history for all branches and tags
179+
- name: Check out software-layer repository
180+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
181+
with:
182+
fetch-depth: 0 # Fetch all history for all branches and tags
179183

180-
- name: Clone EESSI/software-layer-scripts repository
181-
run: |
182-
git clone https://github.com/EESSI/software-layer-scripts
184+
- name: Clone EESSI/software-layer-scripts repository
185+
run: |
186+
git clone https://github.com/EESSI/software-layer-scripts
183187
184-
- name: Show host system info
185-
run: |
186-
echo "/proc/cpuinfo:"
187-
cat /proc/cpuinfo
188-
echo
189-
echo "lscpu:"
190-
lscpu
188+
- name: Show host system info
189+
run: |
190+
echo "/proc/cpuinfo:"
191+
cat /proc/cpuinfo
192+
echo
193+
echo "lscpu:"
194+
lscpu
195+
196+
- name: Mount EESSI CernVM-FS pilot repository
197+
uses: cvmfs-contrib/github-action-cvmfs@55899ca74cf78ab874bdf47f5a804e47c198743c # v4.0
198+
with:
199+
cvmfs_config_package: https://github.com/EESSI/filesystem-layer/releases/download/latest/cvmfs-config-eessi_latest_all.deb
200+
cvmfs_http_proxy: DIRECT
201+
cvmfs_repositories: software.eessi.io
191202

192-
- name: Mount EESSI CernVM-FS pilot repository
193-
uses: cvmfs-contrib/github-action-cvmfs@55899ca74cf78ab874bdf47f5a804e47c198743c # v4.0
194-
with:
195-
cvmfs_config_package: https://github.com/EESSI/filesystem-layer/releases/download/latest/cvmfs-config-eessi_latest_all.deb
196-
cvmfs_http_proxy: DIRECT
197-
cvmfs_repositories: software.eessi.io
203+
- name: Check for missing installlations
204+
if: >
205+
contains(
206+
needs.check_EESSI_version_changed_files.outputs.EESSI_VERSIONS,
207+
matrix.EESSI_VERSION
208+
)
209+
run: |
210+
# Do a basic initialisation to set up Lmod and EESSI modules
211+
export EESSI_MODULE_STICKY=1
212+
source /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/init/lmod/bash
198213
199-
- name: Check for missing installlations
200-
if: >
201-
contains(
202-
needs.check_EESSI_version_changed_files.outputs.EESSI_VERSIONS,
203-
matrix.EESSI_VERSION
204-
)
205-
run: |
206-
# Do a basic initialisation to set up Lmod and EESSI modules
207-
export EESSI_MODULE_STICKY=1
208-
source /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/init/lmod/bash
214+
# From this extract the CPUs we need to loop over
215+
cpu_subdirs=$(echo "${EESSI_CPU_TARGETS}" | yq ".\"${EESSI_VERSION}\".\"${EESSI_CPU_FAMILY}\" | .[]")
216+
if [[ -z "${cpu_subdirs}" ]]; then
217+
echo "ERROR: No CPU subdirs resolved for ${EESSI_VERSION} / ${EESSI_CPU_FAMILY}"
218+
exit 1
219+
fi
209220
210-
# From this extract the CPUs we need to loop over
211-
cpu_subdirs=$(echo "${EESSI_CPU_TARGETS}" | yq ".\"${EESSI_VERSION}\".\"${EESSI_CPU_FAMILY}\" | .[]")
212-
if [[ -z "${cpu_subdirs}" ]]; then
213-
echo "ERROR: No CPU subdirs resolved for ${EESSI_VERSION} / ${EESSI_CPU_FAMILY}"
214-
exit 1
215-
fi
221+
for EESSI_SOFTWARE_SUBDIR_OVERRIDE in $cpu_subdirs; do
222+
# purge before we begin so the environment is clean (including EESSI itself)
223+
module --force purge
224+
# now set the CPU arch
225+
export EESSI_SOFTWARE_SUBDIR_OVERRIDE
226+
module load EESSI//${{matrix.EESSI_VERSION}}
227+
echo ""
228+
echo "---------------- CPU TARGET ----------------"
229+
echo "$EESSI_SOFTWARE_SUBDIR_OVERRIDE"
230+
echo "-------------------------------------------"
231+
env | grep ^EESSI | sort
216232
217-
for EESSI_SOFTWARE_SUBDIR_OVERRIDE in $cpu_subdirs; do
218-
# purge before we begin so the environment is clean (including EESSI itself)
219-
module --force purge
220-
# now set the CPU arch
221-
export EESSI_SOFTWARE_SUBDIR_OVERRIDE
222-
module load EESSI//${{matrix.EESSI_VERSION}}
223-
echo ""
224-
echo "---------------- CPU TARGET ----------------"
225-
echo "$EESSI_SOFTWARE_SUBDIR_OVERRIDE"
226-
echo "-------------------------------------------"
227-
env | grep ^EESSI | sort
233+
# make sure that Lmod cache file is present for the CPU target
234+
cache_file="${EESSI_SOFTWARE_PATH}/.lmod/cache/spiderT.lua"
235+
if [[ -f "$cache_file" ]]; then
236+
ls -l "$cache_file"
237+
else
238+
echo "ERROR: Lmod cache file is missing for CPU target"
239+
echo "Expected file: $cache_file"
240+
echo "This usually means:"
241+
echo " - Lmod spider cache was not generated for this architecture"
242+
echo " - module environment was not fully initialized"
243+
echo " - CVMFS mount is incomplete or stale"
244+
exit 1
245+
fi
228246
229-
# make sure that Lmod cache file is present for the CPU target
230-
cache_file="${EESSI_SOFTWARE_PATH}/.lmod/cache/spiderT.lua"
231-
if [[ -f "$cache_file" ]]; then
232-
ls -l "$cache_file"
233-
else
234-
echo "ERROR: Lmod cache file is missing for CPU target"
235-
echo "Expected file: $cache_file"
236-
echo "This usually means:"
237-
echo " - Lmod spider cache was not generated for this architecture"
238-
echo " - module environment was not fully initialized"
239-
echo " - CVMFS mount is incomplete or stale"
240-
exit 1
241-
fi
247+
# first check the CPU-only builds for this CPU target
248+
echo "first run check_missing_installations.sh for CPU-only builds"
249+
for easystack_file in $(EESSI_VERSION=${{matrix.EESSI_VERSION}} .github/workflows/scripts/only_latest_easystacks.sh); do
250+
eb_version=$(echo ${easystack_file} | sed 's/.*eb-\([0-9.]*\).*.yml/\1/g')
251+
echo "check missing installations for ${easystack_file} with EasyBuild ${eb_version}..."
252+
module purge
253+
module load EasyBuild/${eb_version}
254+
which eb
255+
eb --version
256+
software-layer-scripts/check_missing_installations.sh ${easystack_file}
257+
ec=$?
258+
if [[ ${ec} -ne 0 ]]; then echo "missing installations found for ${easystack_file}!" >&2; exit ${ec}; fi
259+
done
242260
243-
# first check the CPU-only builds for this CPU target
244-
echo "first run check_missing_installations.sh for CPU-only builds"
245-
for easystack_file in $(EESSI_VERSION=${{matrix.EESSI_VERSION}} .github/workflows/scripts/only_latest_easystacks.sh); do
246-
eb_version=$(echo ${easystack_file} | sed 's/.*eb-\([0-9.]*\).*.yml/\1/g')
247-
echo "check missing installations for ${easystack_file} with EasyBuild ${eb_version}..."
248-
module purge
249-
module load EasyBuild/${eb_version}
250-
which eb
251-
eb --version
252-
software-layer-scripts/check_missing_installations.sh ${easystack_file}
253-
ec=$?
254-
if [[ ${ec} -ne 0 ]]; then echo "missing installations found for ${easystack_file}!" >&2; exit ${ec}; fi
261+
# now check the accelerator builds for this CPU target
262+
accelerators=$(echo "${EESSI_ACCELERATOR_TARGETS}" | yq ".\"${{matrix.EESSI_VERSION}}\".\"${EESSI_SOFTWARE_SUBDIR_OVERRIDE}\" // .\"${{matrix.EESSI_VERSION}}\".default | .[]")
263+
if [ -z "${accelerators}" ]; then
264+
echo "no accelerator targets defined for ${EESSI_SOFTWARE_SUBDIR_OVERRIDE}"
265+
else
266+
for accel in ${accelerators}; do
267+
module use ${EESSI_SOFTWARE_PATH}/accel/${accel}/modules/all
268+
echo "checking missing installations for accelerator ${accel} using modulepath: ${MODULEPATH}"
269+
for easystack_file in $(EESSI_VERSION=${{matrix.EESSI_VERSION}} ACCEL_EASYSTACKS=1 .github/workflows/scripts/only_latest_easystacks.sh); do
270+
# Check that the vendor of the accelerator ($accel) matches the vendor name in the easystack filepath
271+
# Only then, do the missing install check
272+
# This avoids e.g. that we're checking for missing AMD GPU installations in an NVIDIA GPU prefix
273+
vendor="${accel%%/*}" # Remove everything after the first /
274+
echo "Checking if easystack file '${easystack_file}' contains '*accel/${vendor}*'"
275+
if [[ "${easystack_file}" == *"accel/${vendor}"* ]]; then
276+
eb_version=$(echo ${easystack_file} | sed 's/.*eb-\([0-9.]*\).*.yml/\1/g')
277+
echo "check missing installations for ${easystack_file} with EasyBuild ${eb_version}..."
278+
module purge
279+
module load EasyBuild/${eb_version}
280+
which eb
281+
eb --version
282+
software-layer-scripts/check_missing_installations.sh ${easystack_file}
283+
ec=$?
284+
if [[ ${ec} -ne 0 ]]; then echo "missing installations found for ${easystack_file}!" >&2; exit ${ec}; fi
285+
else
286+
msg="Not checking easystack file '${easystack_file}', for accelerator target ${accel}:"
287+
msg="${msg} this easystack file targets a different vendor"
288+
echo "${msg}"
289+
fi
255290
done
256-
257-
# now check the accelerator builds for this CPU target
258-
accelerators=$(echo "${EESSI_ACCELERATOR_TARGETS}" | yq ".\"${{matrix.EESSI_VERSION}}\".\"${EESSI_SOFTWARE_SUBDIR_OVERRIDE}\" // .\"${{matrix.EESSI_VERSION}}\".default | .[]")
259-
if [ -z "${accelerators}" ]; then
260-
echo "no accelerator targets defined for ${EESSI_SOFTWARE_SUBDIR_OVERRIDE}"
261-
else
262-
for accel in ${accelerators}; do
263-
module use ${EESSI_SOFTWARE_PATH}/accel/${accel}/modules/all
264-
echo "checking missing installations for accelerator ${accel} using modulepath: ${MODULEPATH}"
265-
for easystack_file in $(EESSI_VERSION=${{matrix.EESSI_VERSION}} ACCEL_EASYSTACKS=1 .github/workflows/scripts/only_latest_easystacks.sh); do
266-
# Check that the vendor of the accelerator ($accel) matches the vendor name in the easystack filepath
267-
# Only then, do the missing install check
268-
# This avoids e.g. that we're checking for missing AMD GPU installations in an NVIDIA GPU prefix
269-
vendor="${accel%%/*}" # Remove everything after the first /
270-
echo "Checking if easystack file '${easystack_file}' contains '*accel/${vendor}*'"
271-
if [[ "${easystack_file}" == *"accel/${vendor}"* ]]; then
272-
eb_version=$(echo ${easystack_file} | sed 's/.*eb-\([0-9.]*\).*.yml/\1/g')
273-
echo "check missing installations for ${easystack_file} with EasyBuild ${eb_version}..."
274-
module purge
275-
module load EasyBuild/${eb_version}
276-
which eb
277-
eb --version
278-
software-layer-scripts/check_missing_installations.sh ${easystack_file}
279-
ec=$?
280-
if [[ ${ec} -ne 0 ]]; then echo "missing installations found for ${easystack_file}!" >&2; exit ${ec}; fi
281-
else
282-
msg="Not checking easystack file '${easystack_file}', for accelerator target ${accel}:"
283-
msg="${msg} this easystack file targets a different vendor"
284-
echo "${msg}"
285-
fi
286-
done
287-
module unuse ${EESSI_SOFTWARE_PATH}/accel/${accel}/modules/all
288-
done
289-
fi
291+
module unuse ${EESSI_SOFTWARE_PATH}/accel/${accel}/modules/all
290292
done
293+
fi
294+
done
291295
292296
- name: Test check_missing_installations.sh with missing package (GCC/8.3.0)
293297
run: |
294-
export EESSI_SOFTWARE_SUBDIR_OVERRIDE=${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}}
295-
source /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/init/bash
296-
# set $EESSI_CPU_FAMILY to the CPU architecture that corresponds to $EESSI_SOFTWARE_SUBDIR_OVERRIDE (part before the first slash),
297-
# to prevent issues with checks in the Easybuild configuration that use this variable
298-
export EESSI_CPU_FAMILY=${EESSI_SOFTWARE_SUBDIR_OVERRIDE%%/*}
299-
module load EasyBuild
300-
which eb
301-
eb --version
302-
export EESSI_PREFIX=/cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}
303-
export EESSI_OS_TYPE=linux
304-
env | grep ^EESSI | sort
305-
# create dummy easystack file with a single entry (something that is not installed in EESSI)
306-
easystack_file="test.yml"
307-
echo "easyconfigs:" > ${easystack_file}
308-
echo " - GCC-8.3.0:" >> ${easystack_file}
309-
echo "created easystack file '${easystack_file}' with a missing installation (GCC/8.3.0):"
310-
cat ${easystack_file}
311-
# note, check_missing_installations.sh exits 1 if a package was
312-
# missing, which is intepreted as false (exit code based, not
313-
# boolean logic), hence when the script exits 0 if no package was
314-
# missing it is interpreted as true, thus the test did not capture
315-
# the missing package
316-
if software-layer-scripts/check_missing_installations.sh ${easystack_file}; then
317-
echo "did NOT capture missing package; test FAILED"
318-
exit 1
319-
else
320-
echo "captured missing package; test PASSED"
321-
exit 0
322-
fi
298+
export EESSI_SOFTWARE_SUBDIR_OVERRIDE=${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}}
299+
source /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/init/bash
300+
# set $EESSI_CPU_FAMILY to the CPU architecture that corresponds to $EESSI_SOFTWARE_SUBDIR_OVERRIDE (part before the first slash),
301+
# to prevent issues with checks in the Easybuild configuration that use this variable
302+
export EESSI_CPU_FAMILY=${EESSI_SOFTWARE_SUBDIR_OVERRIDE%%/*}
303+
module load EasyBuild
304+
which eb
305+
eb --version
306+
export EESSI_PREFIX=/cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}
307+
export EESSI_OS_TYPE=linux
308+
env | grep ^EESSI | sort
309+
# create dummy easystack file with a single entry (something that is not installed in EESSI)
310+
easystack_file="test.yml"
311+
echo "easyconfigs:" > ${easystack_file}
312+
echo " - GCC-8.3.0:" >> ${easystack_file}
313+
echo "created easystack file '${easystack_file}' with a missing installation (GCC/8.3.0):"
314+
cat ${easystack_file}
315+
# note, check_missing_installations.sh exits 1 if a package was
316+
# missing, which is intepreted as false (exit code based, not
317+
# boolean logic), hence when the script exits 0 if no package was
318+
# missing it is interpreted as true, thus the test did not capture
319+
# the missing package
320+
if software-layer-scripts/check_missing_installations.sh ${easystack_file}; then
321+
echo "did NOT capture missing package; test FAILED"
322+
exit 1
323+
else
324+
echo "captured missing package; test PASSED"
325+
exit 0
326+
fi

0 commit comments

Comments
 (0)