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/config_reference.rst
+60-3Lines changed: 60 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,22 @@ ReFrame's behavior can be configured through its configuration file, environment
6
6
An option can be specified via multiple paths (e.g., a configuration file parameter and an environment variable), in which case command-line options precede environment variables, which in turn precede configuration file options.
7
7
This section provides a complete reference guide of the configuration options of ReFrame that can be set in its configuration file or specified using environment variables.
8
8
9
-
ReFrame's configuration is in JSON syntax.
10
-
The full schema describing it can be found in |schemas/config.json|_ file.
11
-
The final configuration for ReFrame is validated against this schema.
9
+
ReFrame's configuration is a JSON object that is stored in either a Python, JSON or YAML file.
10
+
In case of Python configuration, the configuration object must be stored in the special ``site_configuration`` variable:
11
+
12
+
.. code-block:: python
13
+
14
+
site_configuration = {
15
+
.. # The configuration details.
16
+
}
17
+
18
+
The final configuration is validated against the schema |schemas/config.json|_.
19
+
See also :ref:`manpage-configuration` for understanding how ReFrame builds its final configuration.
20
+
21
+
.. warning::
22
+
.. versionchanged:: 4.8
23
+
24
+
Raw JSON configuration files are deprecated.
12
25
13
26
The syntax we use to describe the different configuration objects follows the convention: ``OBJECT[.OBJECT]*.PROPERTY``.
14
27
Even if a configuration object contains a list of other objects, this is not reflected in the above syntax, as all objects in a certain list are homogeneous.
@@ -83,6 +96,10 @@ It consists of the following properties, which we also call conventionally *conf
83
96
2. Shell commands: Any string not prefixed with ``py::`` will be treated as a shell command and will be executed *during auto-detection* to retrieve the hostname.
84
97
The standard output of the command will be used.
85
98
99
+
.. note::
100
+
101
+
For YAML configuration files the ``py::`` prefixed strings cannot refer to user-defined functions.
102
+
86
103
If the :option:`--system` option is not passed, ReFrame will try to autodetect the current system trying the methods in this list successively, until one of them succeeds.
87
104
The resulting name will be matched against the :attr:`~config.systems.hostnames` patterns of each system and the system that matches first will be used as the current one.
88
105
@@ -2288,3 +2305,43 @@ A *device info object* in ReFrame's configuration is used to hold information ab
2288
2305
:default: ``None``
2289
2306
2290
2307
Number of devices of this type inside the system partition.
2308
+
2309
+
2310
+
Dynamic configuration
2311
+
=====================
2312
+
2313
+
One advantage of ReFrame's configuration is that it is programmable, especially if you are using the Python files.
2314
+
Since the configuration is loaded as a Python module, you can generate parts of the configuration dynamically.
2315
+
2316
+
The YAML configuration on the other hand is more static, although not fully.
2317
+
Code generation can still be used with the YAML configuration as it is treated as a Jinja2 template, where ReFrame provides the following bindings:
2318
+
2319
+
- ``getenv(<envvar>)``: Retrieve an environment variable.
2320
+
- ``gid``: The real group id of the ReFrame process.
2321
+
- ``group``: The group name of the ReFrame process.
2322
+
- ``hostname``: The local host's hostname.
2323
+
- ``uid``: The real user id of the ReFrame process.
2324
+
- ``user``: The user name of the ReFrame process.
2325
+
2326
+
These are two examples of YAML logging configuration that uses one of those bindings:
ReFrame's configuration can be stored in one or multiple configuration files.
2265
+
Two configuration file types are supported: Python and YAML.
2266
+
2267
+
.. note::
2268
+
2269
+
.. versionchanged:: 4.8
2270
+
2271
+
The JSON configuration files are deprecated.
2272
+
2273
+
The configuration of ReFrame defines the systems and environments to test as well as parameters controlling the framework's behavior.
2262
2274
2263
-
The configuration file of ReFrame defines the systems and environments to test as well as parameters controlling the framework's behavior.
2275
+
To determine its final configuration, ReFrame executes the following steps:
2264
2276
2265
-
ReFrame loads multiple configuration files to determine its final configuration.
2266
-
First, it loads unconditionally its builtin configuration which is located in ``${RFM_INSTALL_PREFIX}/reframe/core/settings.py``.
2267
-
If the :envvar:`RFM_CONFIG_PATH` environment variable is defined, ReFrame will look for configuration files named either ``settings.py`` or ``settings.json`` (in that order) in every location in the path and will load them.
2268
-
Finally, the :option:`--config-file` option is processed and any configuration files specified will also be loaded.
2277
+
- First, it unconditionally loads the builtin configuration which is located in ``${RFM_INSTALL_PREFIX}/reframe/core/settings.py``.
2278
+
- Second, if the :envvar:`RFM_CONFIG_PATH` environment variable is defined, ReFrame will look for configuration files named either ``settings.py`` or ``settings.yaml`` or ``settings.json`` (in that order) in every location in the path and will load them.
2279
+
- Finally, the :option:`--config-file` option is processed and any configuration files specified will also be loaded.
2269
2280
2270
2281
For a complete reference of the available configuration options, please refer to the :doc:`reframe.settings(8) <config_reference>` man page.
Copy file name to clipboardExpand all lines: docs/tutorial.rst
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -458,6 +458,25 @@ Note also that the system and environment specification in the test run output i
458
458
ReFrame has determined that the ``default`` partition and the ``baseline`` environment satisfy the test constraints and thus it has run the test with this partition/environment combination.
459
459
460
460
461
+
YAML configuration
462
+
------------------
463
+
464
+
.. versionadded:: 4.8
465
+
466
+
Apart from Python, ReFrame's configuration can be specified in a YAML file.
467
+
The advantage is a more compact configuration, but it's not fully programmable as is the Python configuration.
468
+
Below is the same configuration file presented above, but in YAML:
If you are using multiple configuration files, ReFrame allows you to "mix and match" the configuration file types: some of them can be in Python, others in YAML.
476
+
477
+
Note that YAML configuration files offer a minimal programmability as they are essentially `Jinja2 <https://jinja.palletsprojects.com/>`__ templates where a few variables are substituted by ReFrame.
478
+
Check the configuration reference for more information.
0 commit comments