Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
d71d2df
cleaner PR
Aug 8, 2025
957a892
fix
Aug 8, 2025
5a17a45
test
Aug 8, 2025
ccc76ad
change eb loading
Aug 8, 2025
9d93837
change eb loading
Aug 8, 2025
8f86fa4
now add an installation
Aug 10, 2025
9e0475b
only get modified easystacks
Aug 14, 2025
3e22835
now without using gh
Aug 14, 2025
f4870dc
debugging purposes
Aug 14, 2025
8081eae
fixed typo
Aug 14, 2025
0191252
debugging purposes
Aug 14, 2025
b3e9508
debugging purposes
Aug 14, 2025
045163c
fixed commit hash
Aug 14, 2025
0baa570
debugging purposes
Aug 14, 2025
ad96592
debugging purposes
Aug 14, 2025
d98392d
rookie mistake
Aug 14, 2025
053c97f
indentation matters
Aug 14, 2025
9ee00dd
typo
Aug 14, 2025
4e7525b
debug & bugfix
Aug 18, 2025
4cbb842
debug & bugfix 2
Aug 18, 2025
a2d934b
making variables global
Aug 20, 2025
10dc7e3
making variables global part 2
Aug 20, 2025
370b78c
refining the puzzle
Aug 20, 2025
03547d7
another rookie mistake
Aug 20, 2025
3607f27
solving environment
Aug 20, 2025
cb1390f
solving incosistency
Aug 21, 2025
a34bc01
fixing typos
Aug 21, 2025
42b382c
fixes before testing
Aug 21, 2025
0a127de
fixing environment
Aug 22, 2025
3bb8032
missing file
Aug 22, 2025
31f4284
fix
Aug 22, 2025
3462e07
testing more things
Aug 22, 2025
2ce9ef5
Update .github/workflows/check_licenses.yml
hvelab Aug 26, 2025
4b26b2f
testing with matrix
Sep 2, 2025
91cb66c
checking if --robot makes a difference
Sep 3, 2025
c0fa34b
robot deleted, fail-fast added
Sep 4, 2025
a0e0a67
tiny fixes
Sep 4, 2025
f002228
yet another tiny fix
Sep 4, 2025
d13b1bd
rework on missing modules file
Sep 4, 2025
22c192a
typo fix
Sep 4, 2025
a0bf545
fixing format and adding .yaml files
Oct 5, 2025
e37a01f
first tests with new taml syntax and pipeline adaptation
Nov 10, 2025
7acceb9
tiny output fix
nqhu Nov 25, 2025
1f5297d
artifacts test
nqhu Nov 25, 2025
3c4d09a
tiny fix
nqhu Nov 25, 2025
c2f3fd0
undo fix
nqhu Nov 25, 2025
d212754
Update parse_licenses.py - Change output from json to yaml
Nov 25, 2025
6a231a2
Merge pull request #1 from nqhu/licenses
hvelab Nov 25, 2025
55d5398
fix redundant artifact naming per architecture
nqhu Nov 25, 2025
e36fb84
Add push and PR to licenses branch
Nov 25, 2025
7c3e64d
test
nqhu Nov 25, 2025
cb4e9ae
undo test
nqhu Nov 25, 2025
76b5f2d
test
RJO798 Nov 25, 2025
53ed021
test
RJO798 Nov 25, 2025
fddde05
tiny test
nqhu Nov 26, 2025
66d1320
yet another tiny test
nqhu Nov 26, 2025
b5f40e8
update json references to yaml
Nov 26, 2025
5d85d91
easystacks fix
nqhu Nov 26, 2025
a9dbd33
artifact naming fix
nqhu Nov 26, 2025
699c1bd
dumb mistake
nqhu Nov 26, 2025
faedde9
Added nqhu changes from his branch
Nov 26, 2025
b98b983
argparse debugging test
nqhu Nov 26, 2025
3660d3f
argparse correction
nqhu Nov 26, 2025
59e8e54
quick debugging option test
nqhu Nov 26, 2025
c16b1b3
debugging option
nqhu Nov 26, 2025
9964b7d
add debugging option
nqhu Nov 26, 2025
8273b81
input file option fix
nqhu Nov 26, 2025
0057ea3
add easystack
Nov 26, 2025
da9751c
small output fix
nqhu Nov 27, 2025
2eb78ea
test
Nov 27, 2025
1db2bfb
add debugging option
nqhu Nov 27, 2025
e983c0e
Merge branch 'licenses' into licenses
RJO798 Nov 27, 2025
766b408
add some changes
nqhu Nov 27, 2025
9c216ad
import library pyyaml
nqhu Nov 27, 2025
e9cd6ca
ignore venv file
Nov 27, 2025
7bc7d52
Merge remote-tracking branch 'teammate/licenses' into licenses
Nov 27, 2025
7b50a87
how to edit artifacts new step
nqhu Nov 27, 2025
13dc456
Merge remote-tracking branch 'teammate/licenses' into licenses
Nov 27, 2025
810a345
merge parse_licenses.py
Nov 27, 2025
0d30903
update 'Check for missing licenses' - test
Nov 27, 2025
07fa3af
Delete easystack file - testing
RJO798 Nov 27, 2025
6d69fdb
Revert changes in easystack file to skip CI scan
Nov 27, 2025
61f406d
update 'Check for missing licenses'
Nov 27, 2025
73642f7
Add patch file
Nov 28, 2025
ac2ae96
test
Nov 28, 2025
0043536
test
Nov 28, 2025
bb1a43b
test
Nov 28, 2025
32f1a00
test
Nov 28, 2025
df9794e
test
Nov 28, 2025
b8dac3f
patch file test
Nov 28, 2025
f1fa7c3
add yaml reformat script for patch compatibility
Dec 1, 2025
07d64bd
tiny fix
Dec 1, 2025
c0a5589
review fixes
nqhu Dec 2, 2025
c731115
apply requested fixes
Dec 2, 2025
b431d41
update parse_licenses.py
Dec 2, 2025
2970fcd
path fix
Dec 2, 2025
4a79f1f
Merge remote-tracking branch 'teammate/licenses' into licenses
nqhu Dec 2, 2025
4cff99c
merge bug fix
nqhu Dec 2, 2025
7769ce7
update patch.txt format
Dec 2, 2025
92a8a74
Merge pull request #2 from RJO798/licenses
hvelab Dec 2, 2025
2e27904
cleaning
Dec 2, 2025
d3d155a
refining of outputs
Dec 2, 2025
c1e4fec
Merge branch 'main' into licenses
trz42 Dec 2, 2025
0dfc768
final cleaning
Dec 3, 2025
9a37d98
Merge remote-tracking branch 'upstream/licenses' into licenses
nqhu Dec 3, 2025
4b68e57
new AI help on licenses
nqhu Dec 4, 2025
d68af18
Add new workflow step: process missing licenses with AI
Dec 4, 2025
7facbbf
add easystack for testing
Dec 4, 2025
c756a36
tiny fixes
Dec 4, 2025
f389c2a
add easystack for testing
Dec 4, 2025
9451081
update AI .py file
nqhu Dec 4, 2025
84457d3
tiny fix
Dec 4, 2025
854db89
Add python script to reformat extension_licenses.yaml file
Dec 5, 2025
32feb9a
Revert changes in unwanted files
Dec 5, 2025
7d51864
Merge pull request #5 from RJO798/licenses-mod
hvelab Dec 5, 2025
1288d33
cleaning
Dec 9, 2025
db1197d
removing deprecated file
Dec 9, 2025
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
180 changes: 180 additions & 0 deletions .github/workflows/check_licenses.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
name: Check and update licenses

on:
push:
branches: [ "main", "licenses" ] # this should be kept like this for now because we will continue to do testing in this branches
pull_request:
branches: [ "main", "licenses" ]
# types: [opened, synchronized]
permissions:
contents: read # we dont need to write

jobs:
license_update:

strategy:
fail-fast: false
matrix:
# we just do these two architectures for now as they are ones causing more discrepancies
include:
- runs_on: ubuntu-24.04-arm
EESSI_SOFTWARE_SUBDIR_OVERRIDE: aarch64/generic
NO_SLASH_NAME: aarch64-generic
- runs_on: ubuntu-24.04
EESSI_SOFTWARE_SUBDIR_OVERRIDE: x86_64/generic
NO_SLASH_NAME: x86_64-generic

runs-on: ${{ matrix.runs_on }}

steps:
- uses: actions/checkout@v4
- uses: eessi/github-action-eessi@v3

- name: Check for missing installations
env:
PR_NUMBER: ${{ github.event.number }}

run: |
export EESSI_SOFTWARE_SUBDIR_OVERRIDE=${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}}
source /cvmfs/software.eessi.io/versions/${EESSI_VERSION}/init/bash

# set $EESSI_CPU_FAMILY to the CPU architecture that corresponds to $EESSI_SOFTWARE_SUBDIR_OVERRIDE (part before the first slash),
# to prevent issues with checks in the Easybuild configuration that use this variable
export EESSI_CPU_FAMILY=${EESSI_SOFTWARE_SUBDIR_OVERRIDE%%/*}
export EESSI_PREFIX=/cvmfs/software.eessi.io/versions/${EESSI_VERSION}
export EESSI_OS_TYPE=linux
env | grep ^EESSI | sort
module load EasyBuild

# create a temporary directory to store the output
LOCAL_TMPDIR=$(mktemp -d)
eb_missing_out=$LOCAL_TMPDIR/eb_missing.out
echo "eb_missing_out=$LOCAL_TMPDIR/eb_missing.out" >> $GITHUB_ENV
echo "Temporary directory created: ${eb_missing_out}"
file_list=$(curl -sS \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}/files?per_page=100" |
jq -r '.[].filename | select(test("easystack"))')
echo "Files to check:"
echo $file_list

for easystack_file in $file_list; do
eb_version=$(echo ${easystack_file} | sed 's/.*eb-\([0-9.]*\).*.yml/\1/g')
echo "check missing installations for ${easystack_file} with EasyBuild ${eb_version}..."
module purge
module load EasyBuild/${eb_version}
module load EESSI-extend/${EESSI_VERSION}-easybuild
which eb
${EB:-eb} --version
${EB:-eb} --missing --easystack ${easystack_file} 2>&1 | tee ${eb_missing_out}

exit_code=${PIPESTATUS[0]}
#echo "exit code for eb --missing --easystack ${easystack_file} is ${exit_code}"
grep " required modules missing:" ${eb_missing_out} # > /dev/null
exit_code=$?

if [[ ${exit_code} -eq 0 ]]; then echo "missing installations found for ${easystack_file}!" >&2;
else
echo "no missing installations found for ${easystack_file}."
exit 0
fi
done

- name: Check for software existing in licenses.yml file
run: |
# double check this
if [ -s licenses/licenses.yml ]; then
echo "licenses.yml file exists, checking for software versions that are not in the file..."
echo "tmp file check: ${eb_missing_out}"
# cat ${eb_missing_out}
grep -oP '^\* \K[^ ]+' "${eb_missing_out}" | sort -u > missing.txt
echo "Modules to check"
cat missing.txt

# Check if software exists as key in YAML

while IFS= read -r module; do
# module format: NAME/VERSION-TOOLCHAIN
# e.g. ALL/0.9.2-foss-2023a

name="${module%%/*}" # ALL
rest="${module#*/}" # 0.9.2-foss-2023a
version="${rest%%-*}" # 0.9.2

# Check if licenses.yml has: NAME -> VERSION
if ! yq -e ".\"$name\".\"$version\"" "$LICENSES_YAML" >/dev/null 2>&1; then
echo "$module" >> missing_modules.txt
fi
done < missing.txt

echo "Modules not in licenses.yml: "
cat missing_modules.txt

else
echo "licenses.yml file does not exist? what happened?"
exit 1
fi

- name : Search sources for missing modules
run: |
if [ -s missing_modules.txt ]; then
echo "Searching sources for missing modules..."
# Generates a "modules_results.json" file
module load Python-bundle-PyPI/2023.06-GCCcore-12.3.0
python licenses/parsing_easyconfigs.py missing_modules.txt
cat modules_results.json
fi

- name : Try to fetch the license
run: |
if [ -s modules_results.json ]; then
echo "modules_results.json file exists, trying to fetch the license..."
ml Python-bundle-PyPI/2023.06-GCCcore-12.3.0 BeautifulSoup/4.12.2-GCCcore-12.3.0 PyYAML/6.0-GCCcore-12.3.0
python licenses/parse_licenses.py modules_results.json licenses/licenses.yml
cat temporal_print.yaml
else
echo "modules_results.json file does not exist, skipping license fetch."
fi

- name: Check and generate report on missing licenses
run: |
echo ""
# Look for missing licences in licenses_aux.yaml
OUTPUT=$(yq eval '.. | select(has("License")) | select(.License == "not found" or .License == "Other") | (path | join(" --> ")) + ": " + .License' licenses_aux.yaml)

# Check if the variable is NOT empty (-n)
if [[ -n "$OUTPUT" ]]; then
echo "Missing licenses found, please check the missing_report.yaml file."
echo "$OUTPUT"
echo "$OUTPUT" > missing_report.yaml
else
echo "No missing licenses found."
fi

# Create a patch file
diff -Naur licenses/licenses.yml licenses_aux.yaml > patch.txt || true
echo "patch.txt file generated."


- name: Generate artifacts
uses: actions/upload-artifact@v4
with:
name: license-results-${{ matrix.NO_SLASH_NAME }}
path: |
missing_report.yaml
patch.txt


- name: How to edit artifacts and apply patch
run: |
echo "Artifacts generated. To resolve the missing licenses, please edit 'patch.txt' manually, making sure you follow the following format: "
echo ""
echo "<package_name>:"
echo " <version_id>:"
echo " License: <license_info>"
echo " Permission to redistribute: <true/false>"
echo " Retrieved from: <source_link>"
echo ""
echo " Once edited, you can apply the patch automatically using the patch command from the licenses directory: "

echo " patch < <path/to/patch.txt> "
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.pyc
*.pyo
venv/
3 changes: 3 additions & 0 deletions licenses/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
see https://spdx.org/licenses

Python function to download SPDX list of licenses is available in `spdx.py`
Loading
Loading