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
7d04c38a
Commit
7d04c38a
authored
1 year ago
by
Ashwin Kumar Karnad
Browse files
Options
Downloads
Patches
Plain Diff
add required interface
parent
ef654f1d
No related branches found
Branches containing commit
No related tags found
2 merge requests
!19
Move linux-debian11 into main
,
!1
Resolve "First draft for user interface for top level install command"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
install-mpsd-software-environment.py
+46
-6
46 additions, 6 deletions
install-mpsd-software-environment.py
with
46 additions
and
6 deletions
install-mpsd-software-environment.py
+
46
−
6
View file @
7d04c38a
...
...
@@ -4,7 +4,13 @@ import subprocess
import
time
import
argparse
about_tool
=
"""
Build toolchains using Spack.
This function builds toolchains for toolchains at the appropriate directory for the current system architecture
and MPSD software stack version.
The toolchains are built using the bash script spack_setup.sh, and the results are logged.
"""
# Helper class to change directory via context manager
class
os_chdir
:
def
__init__
(
self
,
new_dir
):
...
...
@@ -25,13 +31,7 @@ def build_toolchains(
skip_build_cache
=
False
,
skip_dir_check
=
False
,
):
"""
Build toolchains using Spack.
This function builds toolchains for toolchains at the appropriate directory for the current system architecture
and MPSD software stack version.
The toolchains are built using the bash script spack_setup.sh, and the results are logged.
"""
mpsd_os
=
os
.
environ
[
"
MPSD_OS
"
]
mpsd_microarch
=
os
.
environ
[
"
MPSD_MICROARCH
"
]
current_branch
=
(
...
...
@@ -103,3 +103,43 @@ def build_toolchains(
)
# copy the octopus configs to the toolchain directory
# subprocess.run(f"cp -r {current_dir}/octopus
def
main
():
parser
=
argparse
.
ArgumentParser
(
description
=
about_tool
)
parser
.
add_argument
(
'
--release
'
,
type
=
str
,
required
=
True
,
help
=
'
Specify the release version to install
'
)
parser
.
add_argument
(
'
--target-directory
'
,
type
=
str
,
help
=
'
Specify the target directory for installation (use DEFAULT to use /opt_mpsd/<MPSD_OS>/<MPSD_RELEASE>/<MPSD_MICROARCH)
'
)
parser
.
add_argument
(
'
--install
'
,
nargs
=
'
+
'
,
help
=
'
Specify toolchain(s) to install eg foss2021a-mpi (use ALL to install all available toolchains)
'
)
parser
.
add_argument
(
'
--remove
'
,
type
=
str
,
help
=
'
Specify toolchain to remove
'
)
parser
.
add_argument
(
'
--set-up
'
,
type
=
str
,
help
=
'
Start a new software environment version, must specify --from <release>
'
)
parser
.
add_argument
(
'
--from
'
,
dest
=
'
from_release
'
,
type
=
str
,
help
=
'
Specify the release version to start from
'
)
parser
.
add_argument
(
'
--force-reinstall
'
,
action
=
'
store_true
'
,
help
=
'
Delete and reinstall an existing toolchain directory
'
)
parser
.
add_argument
(
'
--skip-build-cache
'
,
action
=
'
store_true
'
,
help
=
'
Skip Spack build cache during installation
'
)
parser
.
add_argument
(
'
--skip-dir-check
'
,
action
=
'
store_true
'
,
help
=
'
Skip checking if the target directory already exists
'
)
args
=
parser
.
parse_args
()
if
args
.
remove
:
remove_toolchain
(
args
.
release
,
args
.
remove
)
elif
args
.
set_up
:
start_new_env
(
args
.
set_up
,
args
.
from_release
)
else
:
target_dir
=
args
.
target_directory
if
args
.
install
:
install_toolchains
(
args
.
release
,
args
.
install
,
target_dir
,
args
.
force_reinstall
,
args
.
skip_build_cache
,
args
.
skip_dir_check
)
else
:
prepare_env
(
args
.
release
,
target_dir
)
if
__name__
==
"
__main__
"
:
main
()
\ No newline at end of file
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