-
-
Notifications
You must be signed in to change notification settings - Fork 21
[FEATURE]: Add support to deactivate spack environments #1534
Description
Please describe your feature
Currently we have support to create, activate and remove spack environment but not to deactivate environment spack env deactivate. For reference see https://buildtest.readthedocs.io/en/devel/buildspecs/spack.html#spack-environment
We propose to add a new feature to deactivate environment by introducing a keyword deactivate which is a boolean
buildspecs:
spack_env_deactivate_first:
type: spack
executor: generic.local.bash
description: "deactivate a spack environment first prior to activating it"
tags: [spack]
spack:
root: $HOME/spack
env:
deactivate: true
create:
dir: $HOME/spack-envs/m4
activate:
dir: $HOME/spack-envs/m4
specs:
- 'm4'
install:
option: ''
post_cmds: |
spack find
rm -rf $HOME/spack-envs/m4If deactivate: true is set then we should emit spack env deactivate otherwise its not set.
The order of the commands would be the following in this example, so we should see environment created first then we deactivate any active environment and run spack env activate.
spack env create
spack env deactivate
spack env activate
TODO
- Update spack schema to add support for
deactivate - Add implementation of emitting
spack env deactivatecommand in https://github.com/buildtesters/buildtest/blob/devel/buildtest/builders/spack.py. This would be in methodgenerate_scriptseebuildtest/buildtest/builders/spack.py
Line 48 in 58f91fd
def generate_script(self): - Add example buildspec to demonstrate this example in https://github.com/buildtesters/buildtest/tree/devel/examples/spack/example
- Add documentation in https://buildtest.readthedocs.io/en/devel/buildspecs/spack.html add this at bottom of file
Suggest potential solution
No response
Additional Information
No response
Post question in Slack
- I agree that I posted my question in slack before creating this issue
Is there an existing issue
- I confirm there is no existing issue for this issue