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
de698eeb
Commit
de698eeb
authored
1 year ago
by
Ashwin Kumar Karnad
Browse files
Options
Downloads
Patches
Plain Diff
refactor main with subparsers
parent
ee52ca10
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
+9
-65
9 additions, 65 deletions
install-mpsd-software-environment.py
with
9 additions
and
65 deletions
install-mpsd-software-environment.py
+
9
−
65
View file @
de698eeb
...
...
@@ -113,71 +113,15 @@ def prepare_env(toolchain_base_dir, mpsd_spack_ver, skip_dir_check, shared_var):
def
main
():
parser
=
argparse
.
ArgumentParser
(
description
=
about_tool
)
parser
.
add_argument
(
"
--release
"
,
type
=
str
,
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
.
release
is
None
:
parser
.
print_help
()
sys
.
exit
(
1
)
if
args
.
remove
:
cmd
=
"
remove
"
elif
args
.
set_up
:
cmd
=
"
start_new
"
else
:
if
args
.
install
:
cmd
=
"
install
"
else
:
cmd
=
"
prepare_env
"
run
=
builder
(
release
=
args
.
release
,
cmd
=
cmd
,
toolchain_list
=
args
.
install
,
target_dir
=
args
.
target_directory
,
# force_reinstall=args.force_reinstall,
skip_build_cache
=
args
.
skip_build_cache
,
)
run
.
run
()
# Add subparsers for different actions
subparsers
=
parser
.
add_subparsers
(
dest
=
'
action
'
,
title
=
'
actions
'
,
description
=
'
valid actions
'
,
required
=
True
)
# Add parser for "install" action
parser_install
=
subparsers
.
add_parser
(
'
install
'
,
help
=
'
Install a software environment
'
)
parser_install
.
add_argument
(
'
--release
'
,
type
=
str
,
required
=
True
,
help
=
'
Release version to install
'
)
parser_install
.
add_argument
(
'
--target-dir
'
,
type
=
str
,
help
=
'
Target directory for installation (use DEFAULT to install to default directory)
'
)
parser_install
.
add_argument
(
'
--force-reinstall
'
,
action
=
'
store_true
'
,
help
=
'
Force reinstall an existing toolchain directory
'
)
parser_install
.
add_argument
(
'
--skip-build-cache
'
,
action
=
'
store_true
'
,
help
=
'
Skip Spack build cache during installation
'
)
if
__name__
==
"
__main__
"
:
...
...
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