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
recipes can now select a view that is loaded by default if no view is
provided.
default views are opt-in, so existing recipes will not change their
behavior
---------
Co-authored-by: Rocco Meli <r.meli@bluemail.ch>
* `description`: _optional_ a string that describes the environment (default empty).
39
+
* `default-view`: _default = null_ the name of a uenv view to load if no view is explicitly requested by the user. See the documentation for [default views][ref-recipes-default-view]. If no default view is specified, none will be set.
39
40
* `version`: _default = 1_ the version of the uenv recipe (see below)
Stackinator 6 introduces breaking changes to the uenv recipe format, introduced to support Spack v1.0.
@@ -350,27 +352,34 @@ For example, the `views` description:
350
352
```yaml
351
353
cuda-env:
352
354
views:
353
-
default:
355
+
full:
354
356
no-python:
355
357
exclude:
356
358
- 'python'
357
359
```
358
360
359
361
will configure two views:
360
362
361
-
* `default`: a view of all the software in the environment using the default settings of Spack.
362
-
* `no-python`: everything in the default view, except any versions of `python`.
363
+
* `full`: a view of all the software in the environment using the full settings of Spack.
364
+
* `no-python`: everything in the `full` view, except any versions of `python`.
365
+
366
+
!!! warning "only name views default if they are loaded by default"
367
+
It is possible to name views `default`, and there are uenv images like `prgenv-gnu` that follow this practice for legacy reasons.
368
+
369
+
However the name default can be confusing for users because it implies that the view is loaded by default.
370
+
However, [default views][ref-recipes-default-view] must be explicitly set in [`config.yaml`][ref-recipes-config].
363
371
364
372
Stackinator provides some additional options that are not provided by Spack, to fine tune the view, that can be set in the `uenv:` field:
365
373
366
374
```yaml
367
375
cuda-env:
368
376
views:
369
-
uenv:
370
-
add_compilers: true
371
-
prefix_paths:
372
-
LD_LIBRARY_PATH: [lib, lib64]
373
-
env_vars:
377
+
my-view:
378
+
uenv:
379
+
add_compilers: true
380
+
prefix_paths:
381
+
LD_LIBRARY_PATH: [lib, lib64]
382
+
env_vars:
374
383
set:
375
384
- WOMBAT: null
376
385
- NOCOLOR: "1"
@@ -392,6 +401,18 @@ cuda-env:
392
401
!!! info
393
402
See the [interfaces documentation](interfaces.md#environment-views) for more information about how the environment views are provided.
394
403
404
+
[](){#ref-recipes-default-view}
405
+
#### Setting default views
406
+
407
+
!!! info "available in uenv 9.3 and later"
408
+
Default views are only loaded in recent versions of uenv.
409
+
Older uenv versions will ignore the default view - it is not an error to load a uenv that provides a default view using uenv 9.2 and older.
410
+
411
+
It is possible to specify a view that will be loaded automatically if no view is specified, by setting the `default-view` field in [`config.yaml` file][ref-recipes-config].
412
+
413
+
* a default view is only used if it is explicitly specified in `config.yaml`.
414
+
* if a uenv is started with a view specified, the default view is ignored.
415
+
395
416
#### Setting environment variables with `env_vars`
396
417
397
418
The `views:<view_name>:uenv:env_vars` field can be used to further fine-tune the environment variables that are set when the view is started.
0 commit comments