Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
technical:recipes:emcee-in-virtualenv [2020-07-16 10:25] – created frey | technical:recipes:emcee-in-virtualenv [2021-02-24 23:45] (current) – frey | ||
---|---|---|---|
Line 134: | Line 134: | ||
* pyklip | * pyklip | ||
packages should all be present in the list. | packages should all be present in the list. | ||
+ | |||
+ | Return the shell environment to its original state before proceeding: | ||
+ | |||
+ | <code bash> | ||
+ | $ vpkg_rollback all | ||
+ | </ | ||
===== VALET Package Definition ===== | ===== VALET Package Definition ===== | ||
Line 139: | Line 145: | ||
To simplify the addition of this virtualenv to the runtime environment, | To simplify the addition of this virtualenv to the runtime environment, | ||
- | The package definition file uses [[https:// | + | The package definition file uses the [[https:// |
^Item^Description^Value in this example^ | ^Item^Description^Value in this example^ | ||
|'' | |'' | ||
|'' | |'' | ||
|'' | |'' | ||
+ | |'' | ||
The package definition file should follow this format: | The package definition file should follow this format: | ||
Line 151: | Line 159: | ||
prefix: «prefix»/ | prefix: «prefix»/ | ||
description: | description: | ||
+ | flags: | ||
+ | - no-standard-paths | ||
default-version: | default-version: | ||
actions: | actions: | ||
Line 165: | Line 175: | ||
</ | </ | ||
- | For the virtualenv created in the course of this recipe, the resulting file ('' | + | For the virtualenv created in the course of this recipe, the resulting file '' |
<code yaml> | <code yaml> | ||
Line 171: | Line 181: | ||
prefix: / | prefix: / | ||
description: | description: | ||
+ | flags: | ||
+ | - no-standard-paths | ||
default-version: | default-version: | ||
actions: | actions: | ||
Line 185: | Line 197: | ||
</ | </ | ||
+ | The file can be checked for proper syntax: | ||
+ | |||
+ | <code bash> | ||
+ | $ vpkg_check " | ||
+ | </ | ||
+ | |||
+ | If all is okay, then the virtualenv can be loaded in login sessions or in job scripts as: | ||
+ | |||
+ | <code bash> | ||
+ | $ vpkg_require «env-name»/ | ||
+ | </ | ||
+ | |||
+ | which for this recipe is: | ||
+ | |||
+ | <code bash> | ||
+ | $ vpkg_require mcmc-env/ | ||
+ | Adding dependency `libfabric/ | ||
+ | Adding dependency `openmpi/ | ||
+ | Adding dependency `intel-python/ | ||
+ | Adding package `mcmc-env/ | ||
+ | $ which python3 | ||
+ | / | ||
+ | $ which pip | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | ==== Adding New Instances of the virtualenv ==== | ||
+ | |||
+ | Each new instance of the virtualenv will receive a unique version identifier prior to being created. | ||
+ | |||
+ | <code yaml> | ||
+ | mcmc-env: | ||
+ | prefix: / | ||
+ | description: | ||
+ | flags: | ||
+ | - no-standard-paths | ||
+ | default-version: | ||
+ | actions: | ||
+ | - action: source | ||
+ | script: | ||
+ | sh: anaconda-activate.sh | ||
+ | success: 0 | ||
+ | versions: | ||
+ | " | ||
+ | description: | ||
+ | dependencies: | ||
+ | - openmpi/ | ||
+ | - intel-python/ | ||
+ | " | ||
+ | description: | ||
+ | dependencies: | ||
+ | - openmpi/ | ||
+ | - intel-python/ | ||
+ | </ | ||
+ | |||
+ | where the dependencies will change if different versions of the Open MPI library or Intel distribution for Python were used when creating the virtualenv. | ||
+ | If the new version should be promoted to being the default (e.g. when '' |