Skip to content

Commit 1adfa66

Browse files
authored
Merge pull request #214 from EESSI/main
Branch is behind
2 parents 0b6c2e8 + 7636881 commit 1adfa66

File tree

357 files changed

+10994
-166
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

357 files changed

+10994
-166
lines changed

.github/workflows/scorecards.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,11 @@
44

55
name: Scorecards supply-chain security
66
on:
7-
# For Branch-Protection check. Only the default branch is supported. See
8-
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
9-
branch_protection_rule:
107
# To guarantee Maintained check is occasionally updated. See
118
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
129
schedule:
1310
- cron: '25 15 * * 3'
1411
push:
15-
branches: [ "main" ]
16-
pull_request:
1712
branches:
1813
- main
1914

@@ -36,12 +31,12 @@ jobs:
3631

3732
steps:
3833
- name: "Checkout code"
39-
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
34+
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
4035
with:
4136
persist-credentials: false
4237

4338
- name: "Run analysis"
44-
uses: ossf/scorecard-action@99c53751e09b9529366343771cc321ec74e9bd3d # v2.0.6
39+
uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3
4540
with:
4641
results_file: results.sarif
4742
results_format: sarif
@@ -63,14 +58,14 @@ jobs:
6358
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
6459
# format to the repository Actions tab.
6560
- name: "Upload artifact"
66-
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
61+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
6762
with:
6863
name: SARIF file
6964
path: results.sarif
7065
retention-days: 5
7166

7267
# Upload the results to GitHub's code scanning dashboard.
7368
- name: "Upload to code-scanning"
74-
uses: github/codeql-action/upload-sarif@807578363a7869ca324a79039e6db9c843e0e100 # v2.1.27
69+
uses: github/codeql-action/upload-sarif@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
7570
with:
7671
sarif_file: results.sarif

.github/workflows/script_module_list.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Module overview script (lint + test)
33
on:
44
push:
55
paths:
6-
- 'scripts/README.mds/**'
6+
- 'scripts/**'
77
- './.github/**'
88
pull_request:
99
paths:
@@ -25,7 +25,7 @@ jobs:
2525
with:
2626
python-version: "3.6"
2727
- name: Run flake8
28-
uses: py-actions/flake8@v2
28+
uses: py-actions/flake8@84ec6726560b6d5bd68f2a5bed83d62b52bb50ba # v2.3.0
2929
with:
3030
max-line-length: "120"
3131
path: "scripts/available_software"

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ jobs:
1919
uses: codespell-project/actions-codespell@22ff5a2e4b591290baf82d47c9feadac31c65441 # v1.0
2020
with:
2121
check_filenames: true
22-
skip: '*.pdf,.git'
22+
# MarkDown files in docs/available_software/detail are skipped because they are auto-generated
23+
skip: '*.pdf,.git,*.json,./docs/available_software/detail/*.md'
2324

2425
# - name: Markdown Linting Action
2526
# uses: avto-dev/[email protected]
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Update overview of available software in EESSI
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
# run every 4 hours
6+
- cron: '0 */4 * * *'
7+
jobs:
8+
update_available_software:
9+
if: github.repository_owner == 'EESSI' # Prevent running on forks
10+
runs-on: ubuntu-20.04
11+
steps:
12+
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
13+
14+
- name: set up Python
15+
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
16+
with:
17+
python-version: '3.10'
18+
architecture: x64
19+
20+
- name: Mount EESSI
21+
uses: eessi/github-action-eessi@e1f8f20638ea417a18d23ab29443ee34794ff900 # v3.1.0
22+
with:
23+
eessi_stack_version: '2023.06'
24+
25+
- name: update overview of available software
26+
id: update_available_software
27+
run: |
28+
# install required Python packages in virtual environment
29+
python -m venv venv
30+
. venv/bin/activate
31+
pip install -r scripts/available_software/requirements.txt
32+
33+
# copy current JSON data, so we can compare after updating it
34+
cp docs/available_software/data/json_data.json docs/available_software/data/json_data.json.orig
35+
cp docs/available_software/data/json_data_detail.json docs/available_software/data/json_data_detail.json.orig
36+
37+
python scripts/available_software/available_software.py
38+
git status
39+
40+
# determine whether pull request should be opened:
41+
# if JSON files in docs/available_software/data have been updated, then a PR should be opened
42+
json_data_changed=$(python scripts/available_software/check_json_updates.py docs/available_software/data/json_data.json.orig docs/available_software/data/json_data.json)
43+
json_data_detail_changed=$(python scripts/available_software/check_json_updates.py docs/available_software/data/json_data_detail.json.orig docs/available_software/data/json_data_detail.json)
44+
if [[ ${json_data_changed} == "no changes" ]] && [[ ${json_data_detail_changed} == "no changes" ]]; then
45+
echo "JSON files in docs/available_software/data have not been changed, no need to open PR"
46+
echo "json_data_changed=no" >> $GITHUB_OUTPUT
47+
else
48+
echo "JSON files in docs/available_software/data have been changed, PR should be opened"
49+
echo "json_data_changed=yes" >> $GITHUB_OUTPUT
50+
fi
51+
52+
# remove original JSON files, or they'll end up in the PR being opened
53+
rm -f docs/available_software/data/json_data.json.orig docs/available_software/data/json_data_detail.json.orig
54+
55+
- name: create pull request
56+
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5
57+
if: steps.update_available_software.outputs.json_data_changed == 'yes'
58+
with:
59+
add-paths: docs/available_software
60+
branch: update-software-overview
61+
branch-suffix: timestamp
62+
commit-message: update overview of available software
63+
title: update overview of available software
64+
body: ''
65+
token: ${{ secrets.EESSIBOT_GITHUB_TOKEN }}
66+
push-to-fork: EESSIbot/docs

docs/adding_software/debugging_failed_builds.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,64 @@ After some time, this build fails while trying to build `Plumed`, and we can acc
238238
!!! Note
239239
While this might be faster than the easystack-based approach, this is _not_ how the bot builds. So why it _may_ reproduce the failure the bot encounters, it may not reproduce the bug _at all_ (no failure) or run into _different_ bugs. If you want to be sure, use the easystack-based approach.
240240

241+
## Rebuilding software
242+
[Rebuilding software](opening_pr.md#rebuilding_software) requires an additional step at the beginning: the software first needs to be removed. We assume you've already [checked out the feature branch](#fetching-the-feature-branch). Then, you need to start the container with the additional `--fakeroot` argument, otherwise you will not be able to remove files from the `/cvmfs` prefix. Make sure to also include the `--save` argument, as we will need the tarball later on. E.g.
243+
```
244+
SINGULARITY_CACHEDIR=${eessi_common_dir}/container_cache ./eessi_container.sh --access rw --nvidia all --host-injections ${eessi_common_dir}/host_injections --save ${eessi_pr_dir} --fakeroot
245+
```
246+
Then, initialize the EESSI environment
247+
```
248+
source ${EESSI_CVMFS_REPO}/versions/${EESSI_VERSION}/init/bash
249+
```
250+
and get the diff file for the corresponding PR, e.g. for PR 123:
251+
```
252+
wget https://github.com/EESSI/software-layer/pull/123.diff
253+
```
254+
Finally, run the `EESSI-remove-software.sh` script
255+
```
256+
./EESSI-remove-software.sh`
257+
```
258+
259+
This should remove any software specified in a [rebuild easystack](opening_pr.md#rebuilding_software) that got added in your current feature branch.
260+
261+
Now, exit the container, paying attention to the instructions that are printed to resume later, e.g.:
262+
263+
```
264+
Saved contents of tmp directory '/tmp/eessi.WZxeFUemH2' to tarball '/home/myuser/pr507/EESSI-1711538681.tgz' (to resume session add '--resume /home/myuser/pr507/EESSI-1711538681.tgz')
265+
```
266+
267+
Now, continue with the original instructions to start the container (i.e. either [here](#starting-a-shell-in-the-eessi-container) or [with this alternate approach](#more-efficient-approach-for-multiplecontinued-debugging-sessions)) and make sure to add the `--resume` flag. This way, you are resuming from the tarball (i.e. with the software removed that has to be rebuilt), but in a new container in which you have regular (i.e. no root) permissions.
268+
269+
## Running the test step
270+
If you are still in the prefix layer (i.e. after previously building something), exit it first:
271+
```
272+
$ exit
273+
logout
274+
Leaving Gentoo Prefix with exit status 0
275+
```
276+
Then, source the EESSI init script (again):
277+
```
278+
Apptainer> source ${EESSI_CVMFS_REPO}/versions/${EESSI_VERSION}/init/bash
279+
Environment set up to use EESSI (2023.06), have fun!
280+
{EESSI 2023.06} Apptainer>
281+
```
282+
283+
!!! Note
284+
If you are in a SLURM environment, make sure to run `for i in $(env | grep SLURM); do unset "${i%=*}"; done` to unset any SLURM environment variables. Failing to do so will cause `mpirun` to pick up on these and e.g. infer how many slots are available. If you run into errors of the form "There are not enough slots available in the system to satisfy the X slots that were requested by the application:", you probably forgot this step.
285+
286+
Then, execute the `run_tests.sh` script. We are assuming you are still in the root of the `software-layer` repository that you cloned earlier:
287+
```
288+
./run_tests.sh
289+
```
290+
if all goes well, you should see (part of) the EESSI test suite being run by ReFrame, finishing with something like
291+
292+
```
293+
[ PASSED ] Ran X/Y test case(s) from Z check(s) (0 failure(s), 0 skipped, 0 aborted)
294+
```
295+
296+
!!! Note
297+
If you are running on a system with hyperthreading enabled, you may still run into the "There are not enough slots available in the system to satisfy the X slots that were requested by the application:" error from `mpirun`, because hardware threads are not considered to be slots by default by OpenMPIs `mpirun`. In this case, run with `OMPI_MCA_hwloc_base_use_hwthreads_as_cpus=1 ./run_tests.sh` (for OpenMPI 4.X) or `PRTE_MCA_rmaps_default_mapping_policy=:hwtcpus ./run_tests.sh` (for OpenMPI 5.X).
298+
241299
## Known causes of issues in EESSI
242300

243301
### The custom system prefix of the compatibility layer

docs/adding_software/opening_pr.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ git checkout -b example_branch
7373
```shell
7474
echo ' - example-1.2.3-GCC-12.3.0.eb' >> easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-4.8.2-2023a.yml
7575
```
76+
Note that the naming scheme is standardized and should be `eessi-<eessi_version>-eb-<eb_version>-<toolchain_version>.yml`. See the [official EasyBuild documentation on easystack files](https://docs.easybuild.io/easystack-files/) for more information on the syntax.
7677

7778
4) Stage and commit the changes into your your branch with a sensible message
7879

@@ -95,3 +96,26 @@ git push koala example_branch
9596

9697
If all goes well, one or more bots :robot: should almost instantly create a comment in your pull request
9798
with an overview of how it is configured - you will need this information when providing build instructions.
99+
100+
### Rebuilding software
101+
We typically do not rebuild software, since (strictly speaking) this breaks reproducibility for anyone using the software. However, there are certain situations in which it is difficult or impossible to avoid.
102+
103+
To do a rebuild, you add the software you want to rebuild to a dedicated easystack file in the `rebuilds` directory. Use the following naming convention: `YYYYMMDD-eb-<EB_VERSION>-<APPLICATION_NAME>-<APPLICATION_VERSION>-<SHORT_DESCRIPTION>.yml`, where `YYYYMMDD` is the opening date of your PR. E.g. `2024.05.06-eb-4.9.1-CUDA-12.1.1-ship-full-runtime.yml` was added in a PR on the 6th of May 2024 and used to rebuild CUDA-12.1.1 using EasyBuild 4.9.1 to resolve an issue with some runtime libraries missing from the initial CUDA 12.1.1 installation.
104+
105+
At the top of your easystack file, please use comments to include a short description, and make sure to include any relevant links to related issues (e.g. from the GitHub repositories of EESSI, EasyBuild, or the software you are rebuilding).
106+
107+
As an example, consider the full easystack file (`2024.05.06-eb-4.9.1-CUDA-12.1.1-ship-full-runtime.yml`) used for the aforementioned CUDA rebuild:
108+
109+
```yaml
110+
# 2024.05.06
111+
# Original matching of files we could ship was not done correctly. We were
112+
# matching the basename for files (e.g., libcudart.so from libcudart.so.12)
113+
# rather than the name stub (libcudart)
114+
# See https://github.com/EESSI/software-layer/pull/559
115+
easyconfigs:
116+
- CUDA-12.1.1.eb:
117+
options:
118+
accept-eula-for: CUDA
119+
```
120+
121+
By separating rebuilds in dedicated files, we still maintain a complete software bill of materials: it is transparent what got rebuilt, for which reason, and when.

0 commit comments

Comments
 (0)