You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/pkg-reframe.md
+52-40
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
# ReFrame Testing Tutorial
2
2
3
-
When ReFrame tests are enabled for a uenv, they are automatically run:
3
+
When [ReFrame] tests are enabled for a uenv, they are automatically run:
4
4
5
5
* in the CI/CD pipeline after the image has been built;
6
6
* in daily/weekly testing of individual vClusters;
7
7
* and when upgrading and updating vClusters.
8
8
9
-
This page is a tutorial, that will guide you through the process of enabling testing in your uenv, and on writing portable tests that will run on any uenv-enabled system on Alps.
9
+
This page is a tutorial that will guide you through the process of enabling testing for your uenv, and on writing portable tests that will run on any uenv-enabled system on [Alps].
10
10
11
11
!!! info
12
12
@@ -18,7 +18,7 @@ This page is a tutorial, that will guide you through the process of enabling tes
18
18
19
19
## How uenv ReFrame testing works
20
20
21
-
CSCS maintains a set of ReFrame tests in the CSCS ReFrame tests repository [eth-cscs/cscs-reframe-tests].
21
+
CSCS maintains a set of [ReFrame] tests in the CSCS ReFrame tests repository [eth-cscs/cscs-reframe-tests].
22
22
These tests cover a very wide range of features, including application tests, login node health and Slurm, and can be run on any vCluster on Alps.
23
23
24
24
!!! info
@@ -27,15 +27,15 @@ These tests cover a very wide range of features, including application tests, lo
27
27
28
28
Setting up tests for a uenv requires making changes to two repositories:
29
29
30
-
*[eth-cscs/alps-uenv]**adding meta data to the uenv** to be used by ReFrame to:
30
+
*[eth-cscs/alps-uenv]**adding metadata to the uenv** to be used by ReFrame to:
31
31
* load the uenv and configure the environment so that it is ready to run tests;
32
32
* and, choose which tests from the test suite are used to test the uenv.
33
33
*[eth-cscs/cscs-reframe-tests]**updating and adding tests** in the that are relevant to the uenv.
34
34
* might not be necessary if the tests already exist.
35
35
36
36
### uenv recipe meta data
37
37
38
-
To enable ReFrame tests in your uenv, and yaml file `extra/reframe.yaml` should be added to the recipe.
38
+
To enable ReFrame tests in your uenv, a yaml file `extra/reframe.yaml` should be added to the recipe.
39
39
40
40
Below is an example `reframe.yaml` file:
41
41
@@ -57,21 +57,21 @@ This configuration defines a single _environment_ named `develop`, which corresp
57
57
* `features`: a list of ReFrame features that are provided by the environment.
58
58
* used to decide which tests will be run against the uenv.
59
59
* in this case the uenv provides:
60
-
* `cuda`: expect tests that compile and test NVIDIA gpu aware problems.
60
+
* `cuda`: expect tests that compile and test NVIDIA GPU aware problems.
61
61
* `mpi`: expect basic MPI tests that compile and validate MPI to be run. When combined with `cuda` above, tests for GPU-aware MPI will be run.
62
62
* `arbor-dev`: a specific feature that specifies that _the environment provides everything required to build and run arbor_.
63
63
* `cc`, `cxx`, `ftn`: define the compiler aliases
64
64
* see the [ReFrame environment]s documentation.
65
65
* `views`: **(optional)** a list of views to load.
66
66
* in this case `develop` view is to be loaded.
67
67
68
-
Uenv can provide multiple views, for different use cases.
68
+
A uenv can provide multiple views, for different use cases.
69
69
The most common example is a uenv that provides two views: one that provides an application, and another that provides the tools used to build the application. Another example is the `modules` and `spack` views, that expose a module interface or useful configuration for using Spack with the uenv.
70
70
71
71
Similarly, it is possible to create multiple environments to test.
72
72
The example below defines two environments that provide the same features, i.e. the same tests will be run on each.
73
73
The first example is the one above, and the second sets up an equivalent environment using modules.
74
-
This would be useful for a uenv that has some users who insist on using modules to set up their build enviroment.
74
+
This would be useful for a uenv that has some users who insist on using modules to set up their build environment.
75
75
76
76
```yaml title="extra/reframe.yaml for multiple environments to test"
77
77
develop:
@@ -105,25 +105,25 @@ modules:
105
105
106
106
!!! question "What is an environment?"
107
107
108
-
What is the difference between using `module load`, activating a python venv, loading a spack environment, or a uenv view?
108
+
What is the difference between using `module load`, activating a python venv, loading a Spack environment, or a uenv view?
109
109
110
110
Nothing!
111
111
112
112
They all do the same thing - set environment variables.
113
113
114
114
The main variables that change the behavior of the system are `PATH` and `LD_LIBRARY_PATH`, though there are many others like `PKG_CONFIG_PATH`, `CUDA_HOME`, `MODULEPATH` etc that will have more subtle effects on configuring and building software.
115
115
116
-
Configur an environment for running tests requires specifying the commands that will **modify and set environment variables** such that the tests can run. For example, a view or module might be loaded to make the executable of a scientific code be in `PATH`, or to add tools like `cmake`, `nvcc` and `gcc` to `PATH` so that we can run a test that builds an application.
116
+
Configuring an environment for running tests requires specifying the commands that will **modify and set environment variables** such that the tests can run. For example, a view or module might be loaded to make the executable of a scientific code be in `PATH`, or to add tools like `cmake`, `nvcc` and `gcc` to `PATH` so that we can run a test that builds an application.
117
117
118
118
## Creating uenv tests
119
119
120
120
The final objective for adding tests to a uenv is to have:
121
121
122
-
1. a uenv deployed with an `meta/extra/reframe.yaml` file;
122
+
1. a uenv deployed with an `extra/reframe.yaml` file;
123
123
2. and tests in the [eth-cscs/cscs-reframe-tests] repository
124
124
125
125
In this second half of the tutorial, a workflow for doing this that minimises the amount of time spent
126
-
waiting in job and ci/cd queues is provided.
126
+
waiting in job and CI/CD queues is provided.
127
127
Before starting, you will need the following:
128
128
129
129
* a working uenv squashfs image with corresponding meta data path;
@@ -133,26 +133,26 @@ Before starting, you will need the following:
133
133
134
134
```bash
135
135
# pull the image that you want to start developing tests for, e.g.:
# check the path - your location will be different
142
142
$ echo ${meta}
143
143
144
-
# create the reframe meta data eile
144
+
# create the reframe meta data file
145
145
$ mkdir -p ${meta}/extra
146
146
$ vim ${meta}/extra/reframe.yaml
147
147
```
148
148
149
-
The `meta` path is the meta data for the uenv for the image.
149
+
The `meta` path is the metadata for the uenv for the image.
150
150
151
151
??? note "why create reframe.yaml in this location?"
152
152
153
153
We inject the `reframe.yaml` file into the meta data in the uenv repo to create a "development environment", where it can be modified while developing the tests in an interactive shell.
154
154
155
-
The `reframe.yaml` file will be added to the recipe later, once it is time to start testing in a ci/cd pipeline.
155
+
The `reframe.yaml` file will be added to the recipe later, once it is time to start testing in a CI/CD pipeline.
156
156
157
157
158
158
### Step 2: set up the CSCS reframe tests
@@ -161,11 +161,11 @@ The next step is to check out and setup ReFrame and the CSCS ReFrame test suite.
161
161
162
162
It might be a good idea to create a path for this work, and cloning the ReFrame and CSCS test suite repos as sub-directories.
163
163
164
-
### set up ReFrame
164
+
### Set up ReFrame
165
165
166
166
The first step is to download and set up ReFrame:
167
167
168
-
* clone from GitHub;
168
+
* clone from [ReFrame GitHub repository](https://github.com/reframe-hpc/reframe)
169
169
* run the bootstrap process that installs ReFrame's dependencies;
170
170
* then add reframe to `PATH`.
171
171
@@ -174,14 +174,15 @@ The first step is to download and set up ReFrame:
Building is handled by a test, in this case called `arbor_build`, that derives from `rfm.CompileOnlyRegressionTest`.
252
+
Building is handled by a test, in this case called [`arbor_build`](https://github.com/eth-cscs/cscs-reframe-tests/blob/alps/checks/apps/arbor/arbor-dev.py#L47-L93), that derives from `rfm.CompileOnlyRegressionTest`.
254
253
255
254
!!! info
256
255
257
-
Points of interest are annotated in the code below with :heavy_plus_sign: symbols, click on them to expand.
256
+
Points of interest are annotated in the code below with :material-plus-circle: symbols, click on them to expand.
258
257
259
258
``` { .python .annotate }
260
259
class arbor_build(rfm.CompileOnlyRegressionTest):
@@ -305,7 +304,7 @@ class arbor_build(rfm.CompileOnlyRegressionTest):
305
304
1. Restrict this test to only run in environments that provide the `arbor-dev` feature.
306
305
This can be a list of environments, e.g. `['+arbor-dev+cuda', '+python']` would run the test in environments that provide both `arbor-dev` and `cuda`, or environments that provide `python`.
307
306
2. `arbor_download` is a [ReFrame fixture](https://reframe-hpc.readthedocs.io/en/v4.5.0/tutorial_fixtures.html), that handles downloading the source for Arbor.
308
-
3. The build stage is performed on a compute node using an sbatch job.
307
+
3. The build stage is performed on a compute node using a sbatch job.
309
308
Required so that the environment is configured properly, by adding the
310
309
correct flags to the script:
311
310
```
@@ -330,7 +329,7 @@ class arbor_build(rfm.CompileOnlyRegressionTest):
330
329
331
330
The new approach of parameterising over uarch means that the test can be configured for _any_ vCluster with gh200 nodes.
332
331
333
-
### test: run the unit tests
332
+
### Test: run the unit tests
334
333
335
334
The C++ Arbor library provides GoogleTest unit tests that are bundled in a single executable `unit`.
336
335
The tests are not MPI enabled, and take less than 30 seconds to run 1000 individual tests.
@@ -360,11 +359,11 @@ class arbor_unit(rfm.RunOnlyRegressionTest):
360
359
1. This is the first time that we have added an annotation to a test.
361
360
This is a "leaf" in our set of test dependencies, run after the download
362
361
and build stages that are its dependencies have run.
363
-
2. The unit tests run quickly - so set a short time limit for higher priority queueing
362
+
2. The unit tests run quickly - so set a short time limit for higher priority queuing
364
363
3. The `arbor_build` stage has to be run before this test, to build the unit tests.
365
364
4. Just check that the tests passed - performance checks are implemented elsewhere
366
365
367
-
### test: single GPU benchmark
366
+
### Test: single GPU benchmark
368
367
369
368
Use the `miniring` benchmark provided by Arbor to check both correctness and performance.
370
369
@@ -397,8 +396,8 @@ arbor_references = {
397
396
}
398
397
```
399
398
400
-
1. Currently we only have Arbor performance targets for gh200, fields for `zen2` would be added for Eiger testing.
401
-
2. These are labelled reference targes. A link will be added when it is found in ReFrame's "documentation".
399
+
1. Currently, we only have Arbor performance targets for `gh200`, fields for `zen2` would be added for Eiger testing.
400
+
2. These are labelled reference targets. A link will be added when it is found in ReFrame's "documentation".
402
401
403
402
The test itself:
404
403
@@ -449,7 +448,7 @@ class arbor_busyring(rfm.RunOnlyRegressionTest):
449
448
In other words - the performance target is set dynamically based on the architecture of the node,
450
449
instead of being hard coded using if-else statements in the test itself.
451
450
452
-
* `self.uarch` is one of the alps arch: `"gh200"`, `"zen2"`, `"a100"`, ... etc, or `None`
451
+
* `self.uarch` is one of the alps arch: `"gh200"`, `"zen2"`, `"a100"`, ... etc., or `None`
453
452
* `self.current_partition.fullname` is the `vcluster:partition` string, for example `"daint:normal"` or `"todi:debug"`.
454
453
455
454
!!! note
@@ -458,7 +457,7 @@ class arbor_busyring(rfm.RunOnlyRegressionTest):
458
457
does not provide values for the current uarch.
459
458
However, in such cases, no comparison is made and the test will pass.
460
459
461
-
### test: MPI tests
460
+
### Test: MPI tests
462
461
463
462
``` { .python .annotate }
464
463
slurm_config = { #(1)
@@ -519,16 +518,23 @@ $ export UENV=arbor/v0.9:v1
519
518
It will be a hard requirement that the meta data path will be in the same path
520
519
as the `store.squashfs` file.
521
520
521
+
!!! warning
522
+
If the `UENV` variable is not set proprely, the `reframe.yaml` file can't be found and you will see an error:
523
+
```
524
+
ERROR: failed to load configuration: problem loading the metadata from 'extra/reframe.yaml'
0 commit comments