Skip to content

Commit c013f7a

Browse files
committed
Multiple minor corrections.
1 parent d4d7165 commit c013f7a

6 files changed

Lines changed: 107 additions & 76 deletions

File tree

docs/2022-CSC_and_LO/2_Using/2_02_creating_easyconfig_files.md

Lines changed: 85 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ Reasons to consider implementing a software-specific easyblock rather than using
4545

4646
- 'critical' values for easyconfig parameters required to make installation succeed;
4747
*For example, the [easyblock for bowtie2](https://github.com/easybuilders/easybuild-easyblocks/blob/develop/easybuild/easyblocks/b/bowtie2.py)
48-
defines a number of variables used in the Makefile are specified on the make command line to ensure that the right
49-
compilers are used.*
48+
defines a number of variables used in the Makefile on the make command line to ensure that the right
49+
compilers are used (look for the `build_step` in the easyblock).*
5050
- toolchain-specific aspects of the build and installation procedure (e.g., configure options);
5151
*For example, the [easyblock for CP2K](https://github.com/easybuilders/easybuild-easyblocks/blob/develop/easybuild/easyblocks/c/cp2k.py)
5252
will add several compiler options when compiling with gcc and gfortran, including the infamous
@@ -172,58 +172,6 @@ We will cover the most commonly used ones here, but keep in mind that these are
172172
A full overview of all known easyconfig parameters can be obtained via "`eb --avail-easyconfig-params`"
173173
or just "`eb -a`" for short, or can be consulted in the [EasyBuild documentation](https://docs.easybuild.io/en/latest/version-specific/easyconfig_parameters.html).
174174

175-
#### Sources, patches, and checksums
176-
177-
In most easyconfig files you will see that a list of source files is specified via the `sources`
178-
easyconfig parameter, usually combined
179-
with one or more URLs where these sources can be downloaded specified via `source_urls`.
180-
There also may be patch files listed (specified via `patches`),
181-
and checksums for both the source files and patches (specified via `checksums`).
182-
183-
The `sources` easyconfig parameter is commonly defined but it is *not* mandatory,
184-
because some easyconfig files only specify bundles of software packages and hence only
185-
serve to generate a module file.
186-
187-
Here is an example of how these easyconfig parameters can be specified:
188-
189-
```python
190-
source_urls = [
191-
'https://example.org/download/',
192-
'https://example.org/download/archive/',
193-
]
194-
sources = ['example-1.0-src.tar.gz']
195-
patches = ['example-fix.patch']
196-
checksums = [
197-
'9febae18533d035ac688d977cb2ca050e6ca8379311d7a14490ad1ef948d45fa',
198-
'864395d648ad9a5b75d1a745c8ef82b78421d571584037560a22a581ed7a261c',
199-
]
200-
```
201-
202-
Each of these require a *list* of values, so even if there is only a single source file or download URL
203-
you must use square brackets as shown in the example. The default value for each of these is an empty list (`[]`).
204-
205-
Some things worth pointing out here:
206-
207-
* The download URLs specified via `source_urls` do *not* include the name of the file, that is added
208-
automatically by EasyBuild when it tries to download the file (only if it's not available already.)
209-
* If multiple download URLs are specified, they are each tried once in order until the download of the source file was
210-
successful. This can be useful to include backup locations where source files can be downloaded from.
211-
* Names of source files and patches should not include hardcoded software versions, they usually use a
212-
template value like `%(version)s` instead:
213-
```python
214-
sources = ['example-%(version)s-src.tar.gz']
215-
```
216-
EasyBuild will use the value of the `version` easyconfig parameter to determine the actual name of the source
217-
file. This way the software version is only specified in one place and the easyconfig file is easier to
218-
update to other software versions. A list of template values can be consulted via the EasyBuild command
219-
line via the `--avail-easyconfig-templates` option, or in the [EasyBuild documentation](https://docs.easybuild.io/en/latest/version-specific/easyconfig_templates.html).
220-
* Source files can also be specified in ways other than just using a filename, see the
221-
[EasyBuild documentation](https://docs.easybuild.io/en/latest/Writing_easyconfig_files.html#common-easyconfig-param-sources-alt) for more information.
222-
It is also possible to download a given commit from a GitHub repository.
223-
* Specified checksums are usually SHA256 checksum values, but
224-
[other types are also supported](https://docs.easybuild.io/en/latest/Writing_easyconfig_files.html?highlight=checksums#checksums).
225-
226-
227175
#### Easyblock
228176

229177
The easyblock that should be used for the installation can be specified via the `easyblock` easyconfig parameter.
@@ -277,6 +225,58 @@ prefix_opt* Prefix command line option for configure script ('--pref
277225
tar_config_opts* Override tar settings as determined by configure. [default: False]
278226
```
279227
228+
#### Sources, patches, and checksums
229+
230+
In most easyconfig files you will see that a list of source files is specified via the `sources`
231+
easyconfig parameter, usually combined
232+
with one or more URLs where these sources can be downloaded specified via `source_urls`.
233+
There also may be patch files listed (specified via `patches`),
234+
and checksums for both the source files and patches (specified via `checksums`).
235+
236+
The `sources` easyconfig parameter is commonly defined but it is *not* mandatory,
237+
because some easyconfig files only specify bundles of software packages and hence only
238+
serve to generate a module file.
239+
240+
Here is an example of how these easyconfig parameters can be specified:
241+
242+
```python
243+
source_urls = [
244+
'https://example.org/download/',
245+
'https://example.org/download/archive/',
246+
]
247+
sources = ['example-1.0-src.tar.gz']
248+
patches = ['example-fix.patch']
249+
checksums = [
250+
'9febae18533d035ac688d977cb2ca050e6ca8379311d7a14490ad1ef948d45fa',
251+
'864395d648ad9a5b75d1a745c8ef82b78421d571584037560a22a581ed7a261c',
252+
]
253+
```
254+
255+
Each of these require a *list* of values, so even if there is only a single source file or download URL
256+
you must use square brackets as shown in the example. The default value for each of these is an empty list (`[]`).
257+
258+
Some things worth pointing out here:
259+
260+
* The download URLs specified via `source_urls` do *not* include the name of the file, that is added
261+
automatically by EasyBuild when it tries to download the file (only if it's not available already.)
262+
* If multiple download URLs are specified, they are each tried once in order until the download of the source file was
263+
successful. This can be useful to include backup locations where source files can be downloaded from.
264+
* Names of source files and patches should not include hardcoded software versions, they usually use a
265+
template value like `%(version)s` instead:
266+
```python
267+
sources = ['example-%(version)s-src.tar.gz']
268+
```
269+
EasyBuild will use the value of the `version` easyconfig parameter to determine the actual name of the source
270+
file. This way the software version is only specified in one place and the easyconfig file is easier to
271+
update to other software versions. A list of template values can be consulted via the EasyBuild command
272+
line via the `--avail-easyconfig-templates` option, or in the [EasyBuild documentation](https://docs.easybuild.io/en/latest/version-specific/easyconfig_templates.html).
273+
* Source files can also be specified in ways other than just using a filename, see the
274+
[EasyBuild documentation](https://docs.easybuild.io/en/latest/Writing_easyconfig_files.html#common-easyconfig-param-sources-alt) for more information.
275+
It is also possible to download a given commit from a GitHub repository.
276+
* Specified checksums are usually SHA256 checksum values, but
277+
[other types are also supported](https://docs.easybuild.io/en/latest/Writing_easyconfig_files.html?highlight=checksums#checksums).
278+
279+
280280
#### Dependencies
281281
282282
You will often need to list one or more [dependencies](../../1_Intro/1_05_terminology/#dependencies) that are required
@@ -306,24 +306,21 @@ builddependencies = [
306306
]
307307
308308
dependencies = [
309-
('Python', '3.8.2'),
310-
('HDF5', '1.10.6'),
311-
('SciPy-bundle', '2020.03', '-Python-%(pyver)s'),
309+
('cray-hdf5', EXTERNAL_MODULE),
310+
('cray-netcdf', EXTERNAL_MODULE),
311+
('GSL', '2.7''),
312+
('ANTLR', '2.7.7', '-python3'),
312313
]
313314
```
314315
315316
Both `builddependencies` and `dependencies` require a list of tuples,
316317
each of which specifying one dependency.
317318
The name and version of a dependency is specified with a 2-tuple (a tuple with two string values).
318319
319-
In some cases additional information may have to be provided, as is shown in the example above for the `SciPy-bundle`
320+
In some cases additional information may have to be provided, as is shown in the example above for the `ANTLR`
320321
dependency where a 3rd value is specified corresponding to the `versionsuffix` value of this dependency.
321322
If this is not specified, it is assumed to be the empty string (`''`).
322323
323-
Note how we use the '`%(pyver)s'` template value in the `SciPy-bundle` dependency
324-
specification, to avoid hardcoding the Python version in different places. (Though this
325-
specific parameter is less useful on LUMI as we currently try to build on top of `cray-python`.)
326-
327324
The `buildtools` build dependency shows that there is a fourth parameter specifying the toolchain
328325
used for that dependency and is needed if that toolchain is different from the one used in the example.
329326
As it is not possible to load several Cray toolchains together (they are not in a hierarchical relation)
@@ -332,10 +329,34 @@ toolchain. Here also we use a template, `%(toolchain_version)s` which - as its n
332329
to the version of the toolchain, as we version our `buildtools` modules after the version of the Cray
333330
toolchains for which they are intended.
334331
332+
When using the HPE Cray PE based toolchains, another type of dependency comes in:
333+
[external modules](../2_03_external_modules) (discussed in the next section) that
334+
are used to interface with modules provided by the HPE Cray PE but could also be
335+
used to interfact with other modules that do not contain the metadata that EasyBuild
336+
includes in module files that it generates. (EasyBuild sets a number of EasyBuild-specific
337+
environment variables in each module, including one pointing to the installation directory
338+
and one specifying the version of the packages.)
339+
340+
Another example (with modules taken from the EasyBuild common toolchains, not from a repository
341+
on LUMI) is
342+
343+
```python
344+
dependencies = [
345+
('Python', '3.9.6'),
346+
('HDF5', '1.12.1'),
347+
('SciPy-bundle', '2021.10', '-Python-%(pyver)s'),
348+
]
349+
```
350+
351+
Note how we use the '`%(pyver)s'` template value in the `SciPy-bundle` dependency
352+
specification, to avoid hardcoding the Python version in different places. (Though this
353+
specific parameter is less useful on LUMI as we currently try to build on top of `cray-python`.)
354+
335355
See also the [EasyBuild documentation](https://docs.easybuild.io/en/latest/Writing_easyconfig_files.html#dependencies)
336356
for additional options on specifying dependencies. That page specifies two more dependency types:
337357
338-
* `hiddendependencies` are currently not used on LUMI, and if we would use them in the future, it will likely
358+
* `hiddendependencies` are currently not used on LUMI nor in the easyconfigs included with EasyBuild,
359+
and if we would use them in the future, it will likely
339360
be through a way that does not require this parameter.
340361
* `osdependencies` can be used to let EasyBuild check if certain needed OS packages are installed.
341362
See, e.g., the [easyconfigs for the `buildtools` package](https://github.com/Lumi-supercomputer/LUMI-SoftwareStack/tree/main/easybuild/easyconfigs/b/buildtools)
@@ -910,7 +931,7 @@ $ eb eb-tutorial.eb --inject-checksums
910931
Finally, we should consider changing the name of the easyconfig that we just developed
911932
to align with the EasyBuild conventions as otherwise it would not be found when used as
912933
a dependency of another package. In this case, the name should be
913-
`eb-tutorial-1.0.0-cpeCray-21.12.eb`. In fact, EasyBuild stored a processed version
934+
`eb-tutorial-1.0.1-cpeCray-21.12.eb`. In fact, EasyBuild stored a processed version
914935
of our easyconfig with that name in the repository:
915936
916937
```

docs/2022-CSC_and_LO/2_Using/2_04_implementing_easyblocks.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,14 +231,18 @@ If want to *add* to the existing value however, you *must* use the ``self.cfg.up
231231
self.cfg.update('some_list', 'example')
232232
```
233233

234-
This will ***not*** work (because ``self.cfg['some_list']`` does not return a reference to the original value,
235-
but to a *temporary copy* thereof):
234+
One could be tempted to use
236235

237236
```python
238237
# anti-pattern, this does NOT work as expected!
239238
self.cfg['some_list'].append('example')
240239
```
241240

241+
instead, but this will ***not*** work because ``self.cfg['some_list']`` does not return a reference to the original value,
242+
but to a *temporary copy* thereof.
243+
244+
245+
242246
### Custom parameters
243247

244248
Additional custom easyconfig parameters can be defined in an easyblock to steer its behaviour.

docs/2022-CSC_and_LO/3_Advanced/3_02_hooks.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ community:
2929

3030
- Enforce some site policies on easyconfig files. A practical example for LUMI could be imposing
3131
the use of the `whatis` parameter and ensuring that it contains a `Description` line to have a
32-
more consistent format for module files.
32+
more consistent format for module files (or, alternatively, imposing this if the mandatory
33+
`description` parameter is to long to be good for a `whatis` line).
3334
- Ensuring that some information is always in the module file. E.g., on LUMI the `site_contacts`
3435
parameter is added automatically when installing in the central stack if it is not already in
3536
the easyconfig file to refer to the LUST support pages.
@@ -39,6 +40,7 @@ community:
3940
adapt, e.g., the easyconfig files for Open MPI to work on LUMI.
4041

4142
Some site have really large hook files to implement policies and modify standard EasyBuild build recipes, e.g.,
43+
4244
- [The hooks file from Jülich Supercomputing Centre](https://github.com/easybuilders/JSC/blob/2022/Custom_Hooks/eb_hooks.py)
4345
- ComputeCanada [cc_hooks_common.py](https://github.com/ComputeCanada/easybuild-computecanada-config/blob/main/cc_hooks_common.py)
4446
and [cc_hooks_gento.py](https://github.com/ComputeCanada/easybuild-computecanada-config/blob/main/cc_hooks_gentoo.py)

docs/2022-CSC_and_LO/3_Advanced/3_03_slurm_jobs.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ This implies that any EasyBuild configuration files or ``$EASYBUILD_*`` environm
4444
that are in place in the job environment are most likely *irrelevant*, since configuration settings
4545
they specify they will most likely be overruled by the corresponding command line options.
4646
It does also imply however that the EasyBuild configuration that is in place when ``eb --job`` is used
47-
does also work on the compute nodes to which the job is submitted.
47+
should also work on the compute nodes to which the job is submitted as EasyBuild will generate the command
48+
line options used in the job script based on that configuration.
4849

4950

5051
## Using ``eb --job``
@@ -90,7 +91,7 @@ using the ``sbatch`` command.
9091

9192
EasyBuild currently doesn't provide away to customize the Slurm submission options,
9293
for example to submit to a particular partition, or to use a particular account,
93-
build you can set the corresponding ``$SBATCH_*`` environment variables prior to running ``eb --job``.
94+
build you can set the corresponding ``SBATCH_*`` environment variables prior to running ``eb --job``.
9495

9596
For example, to specify a particular account that should be used for the jobs submitted by EasyBuild
9697
(equivalent with using the ``-A`` or ``--account`` command line option for ``sbatch``):
@@ -105,14 +106,14 @@ Or to submit to a particular Slurm partition (equivalent with the ``-p`` or ``--
105106
export SBATCH_PARTITION='small'
106107
```
107108

108-
For more information about supported ``$SBATCH_*`` environment variables,
109+
For more information about supported ``SBATCH_*`` environment variables,
109110
see the [Slurm documentation](https://slurm.schedmd.com/sbatch.html#lbAJ).
110111

111112
## Combining ``--job`` and ``--robot``
112113

113114
If one or more dependencies are still missing for the software you want to install,
114115
you can combine ``--job`` and ``--robot`` to get EasyBuild to submit a *separate* job
115-
for each of the installations. These jobs will *not* ``--robot``, they will each only
116+
for each of the installations. These jobs will *not* use ``--robot``, they will each only
116117
perform a single installation.
117118

118119
Dependencies between jobs will be "registered" at submission time, so Slurm will put jobs
@@ -218,9 +219,10 @@ module load LUMI/21.12
218219
module load partition/C
219220
module load EasyBuild-user
220221

221-
# use ramdisk for build directories
222-
export EASYBUILD_BUILDPATH=/dev/shm/$USER/build
223-
export EASYBUILD_TMPDIR=/dev/shm/$USER/tmp
222+
# use /tmp for build directories and temporary directories as we have those
223+
# on login and compute nodes.
224+
export EASYBUILD_BUILDPATH=/tmp/$USER/build
225+
export EASYBUILD_TMPDIR=/tmp/$USER/tmp
224226

225227
# use Slurm as job backend
226228
export EASYBUILD_JOB_BACKEND=Slurm

docs/2022-CSC_and_LO/3_Advanced/3_04_module_naming_schemes.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ There are a couple of advantages to this approach:
9393
However, the are some minor disadvantages too:
9494

9595
* not all existing modules are directly visible, so users have to learn how to find
96-
modules using ``module spider`` etc.;
96+
modules using ``module spider`` etc. (but that is not an issue on LUMI as users
97+
also need to use this command anyway to discover software that may not be in all
98+
software stacks);
9799
* gateway modules may have little meaning to end users;
98100

99101
#### Length of module names

docs/2022-CSC_and_LO/3_Advanced/3_05_github_integration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
---
66

7-
!!! Warning "Preliminary not for LUMI and many other Cray systems"
7+
!!! Warning "Preliminary note for LUMI and many other Cray systems"
88

99
Not everything in this section is as useful for EasyBuild installations that build
1010
on the Cray Programming Environment. E.g., the default easyconfig repository does

0 commit comments

Comments
 (0)