Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mpsd-software-manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MPSD Computational Science
mpsd-software-manager
Merge requests
!82
Remove cmd
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Remove cmd
continue-with-remove-cmd
into
main
Overview
21
Commits
34
Pipelines
18
Changes
1
3 unresolved threads
Hide all comments
Merged
Ashwin Kumar Karnad
requested to merge
continue-with-remove-cmd
into
main
1 year ago
Overview
21
Commits
34
Pipelines
18
Changes
1
3 unresolved threads
Hide all comments
Expand
0
0
Merge request reports
Viewing commit
ee8d8578
Prev
Next
Show latest version
1 file
+
14
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
ee8d8578
add comments and docs to remove_spack_environment
· ee8d8578
Ashwin Kumar Karnad
authored
1 year ago
src/mpsd_software_manager/mpsd_software.py
+
14
−
2
Options
@@ -1153,11 +1153,23 @@ def remove_environment(mpsd_release, root_dir, package_sets="NONE", force_remove
def
remove_spack_environment
(
spack_dir
,
environment_name
):
"""
Remove spack environment.
"""
"""
Remove spack environment including packages exclusive to it.
First activate the environment,
then uninstall all packages exclusive to the environment,
then deactivate the environment,
and finally remove the environment.
Parameters
----------
spack_dir : pathlib.Path
A Path object representing the path to the spack directory.
environment_name : str
A string representing the name of the spack environment to remove.
"""
logging
.
warning
(
f
"
Removing spack environment
{
environment_name
}
"
)
spack_env
=
spack_dir
/
"
share
"
/
"
spack
"
/
"
setup-env.sh
"
commands_to_execute
=
[
f
"
export SPACK_DIR=
{
spack_dir
}
"
,
f
"
export SPACK_DIR=
{
spack_dir
}
"
,
# need to set SPACK_DIR in dash and sh
f
"
.
{
spack_env
}
"
,
f
"
spack env activate
{
environment_name
}
"
,
f
"
for spec in $(spack -e
{
environment_name
}
find
"
# this line continues
Loading