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
Merged
Ashwin Kumar Karnad
requested to merge
continue-with-remove-cmd
into
main
1 year ago
Overview
4
Commits
34
Pipelines
18
Changes
1
Expand
0
0
Merge request reports
Viewing commit
f0ff8ff5
Prev
Next
Show latest version
1 file
+
17
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
f0ff8ff5
add remove_spack_environment
· f0ff8ff5
Ashwin Kumar Karnad
authored
1 year ago
src/mpsd_software_manager/mpsd_software.py
+
17
−
0
Options
@@ -1128,6 +1128,23 @@ def remove_environment(mpsd_release, root_dir, package_sets="NONE", force_remove
pass
def
remove_spack_environment
(
spack_dir
,
environment_name
):
"""
Remove spack environment.
"""
logging
.
warning
(
f
"
Removing spack environment
{
environment_name
}
"
)
spack_env
=
spack_dir
/
"
share
"
/
"
spack
"
/
"
setup-env.sh
"
commands_to_execute
=
[
f
"
source
{
spack_env
}
"
,
f
"
spack env activate
{
environment_name
}
"
,
f
"
for spec in $(spack -e
{
environment_name
}
find
"
# this line continues
r
'
--format
"
{name}@{version}%{compiler.name}@{compiler.version}
"
);do
'
"
spack uninstall -y $spec; done
"
,
"
spack env deactivate
"
,
f
"
spack env remove -y
{
environment_name
}
"
,
]
run
(
"
&&
"
.
join
(
commands_to_execute
),
shell
=
True
,
check
=
True
)
def
start_new_environment
(
release
,
from_release
,
target_dir
):
"""
Start new MPSD software environment version.
"""
msg
=
f
"
Starting new release
{
release
}
from
{
from_release
}
to
{
target_dir
}
"
Loading