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
Commits
ee8d8578
Commit
ee8d8578
authored
1 year ago
by
Ashwin Kumar Karnad
Browse files
Options
Downloads
Patches
Plain Diff
add comments and docs to remove_spack_environment
parent
f10e95db
No related branches found
No related tags found
1 merge request
!82
Remove cmd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mpsd_software_manager/mpsd_software.py
+14
-2
14 additions, 2 deletions
src/mpsd_software_manager/mpsd_software.py
with
14 additions
and
2 deletions
src/mpsd_software_manager/mpsd_software.py
+
14
−
2
View file @
ee8d8578
...
@@ -1153,11 +1153,23 @@ def remove_environment(mpsd_release, root_dir, package_sets="NONE", force_remove
...
@@ -1153,11 +1153,23 @@ def remove_environment(mpsd_release, root_dir, package_sets="NONE", force_remove
def
remove_spack_environment
(
spack_dir
,
environment_name
):
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
}
"
)
logging
.
warning
(
f
"
Removing spack environment
{
environment_name
}
"
)
spack_env
=
spack_dir
/
"
share
"
/
"
spack
"
/
"
setup-env.sh
"
spack_env
=
spack_dir
/
"
share
"
/
"
spack
"
/
"
setup-env.sh
"
commands_to_execute
=
[
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
}
"
,
f
"
spack env activate
{
environment_name
}
"
,
f
"
spack env activate
{
environment_name
}
"
,
f
"
for spec in $(spack -e
{
environment_name
}
find
"
# this line continues
f
"
for spec in $(spack -e
{
environment_name
}
find
"
# this line continues
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment