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
f3cd36a4
Commit
f3cd36a4
authored
2 years ago
by
Ashwin Kumar Karnad
Browse files
Options
Downloads
Patches
Plain Diff
add outlines of all functions
parent
7d04c38a
Branches
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
+29
-2
29 additions, 2 deletions
install-mpsd-software-environment.py
with
29 additions
and
2 deletions
install-mpsd-software-environment.py
+
29
−
2
View file @
f3cd36a4
...
@@ -3,6 +3,7 @@ import os
...
@@ -3,6 +3,7 @@ import os
import
subprocess
import
subprocess
import
time
import
time
import
argparse
import
argparse
import
sys
about_tool
=
"""
about_tool
=
"""
Build toolchains using Spack.
Build toolchains using Spack.
...
@@ -104,10 +105,31 @@ def build_toolchains(
...
@@ -104,10 +105,31 @@ def build_toolchains(
# copy the octopus configs to the toolchain directory
# copy the octopus configs to the toolchain directory
# subprocess.run(f"cp -r {current_dir}/octopus
# subprocess.run(f"cp -r {current_dir}/octopus
def
prepare_env
(
release
,
target_dir
,
skip_dir_check
):
if
target_dir
==
"
DEFAULT
"
:
target_dir
=
f
"
/opt_mpsd/
{
os
.
environ
[
'
MPSD_OS
'
]
}
/
{
release
}
/
{
os
.
environ
[
'
MPSD_MICROARCH
'
]
}
"
if
not
os
.
path
.
exists
(
target_dir
):
os
.
makedirs
(
target_dir
)
else
:
if
not
skip_dir_check
:
raise
ValueError
(
f
"
Error: Target directory
{
target_dir
}
already exists.
\n\
Please remove it and try again.
"
)
with
os
.
chdir
(
target_dir
):
subprocess
.
run
(
"
git clone https://gitlab.gwdg.de/mpsd-cs/spack-environments.git
"
)
subprocess
.
run
(
f
"
git checkout
{
release
}
"
)
def
install_toolchains
(
release
,
install
,
target_dir
,
force_reinstall
,
skip_build_cache
,
skip_dir_check
):
prepare_env
(
release
,
target_dir
,
skip_dir_check
)
def
start_new_env
(
set_up
,
from_release
):
pass
def
remove_toolchain
(
release
,
remove
):
pass
def
main
():
def
main
():
parser
=
argparse
.
ArgumentParser
(
description
=
about_tool
)
parser
=
argparse
.
ArgumentParser
(
description
=
about_tool
)
parser
.
add_argument
(
'
--release
'
,
type
=
str
,
required
=
True
,
parser
.
add_argument
(
'
--release
'
,
type
=
str
,
help
=
'
Specify the release version to install
'
)
help
=
'
Specify the release version to install
'
)
parser
.
add_argument
(
'
--target-directory
'
,
type
=
str
,
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)
'
)
help
=
'
Specify the target directory for installation (use DEFAULT to use /opt_mpsd/<MPSD_OS>/<MPSD_RELEASE>/<MPSD_MICROARCH)
'
)
...
@@ -128,6 +150,10 @@ def main():
...
@@ -128,6 +150,10 @@ def main():
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
if
args
.
release
is
None
:
parser
.
print_help
()
sys
.
exit
(
1
)
if
args
.
remove
:
if
args
.
remove
:
remove_toolchain
(
args
.
release
,
args
.
remove
)
remove_toolchain
(
args
.
release
,
args
.
remove
)
elif
args
.
set_up
:
elif
args
.
set_up
:
...
@@ -139,7 +165,8 @@ def main():
...
@@ -139,7 +165,8 @@ def main():
install_toolchains
(
args
.
release
,
args
.
install
,
target_dir
,
args
.
force_reinstall
,
install_toolchains
(
args
.
release
,
args
.
install
,
target_dir
,
args
.
force_reinstall
,
args
.
skip_build_cache
,
args
.
skip_dir_check
)
args
.
skip_build_cache
,
args
.
skip_dir_check
)
else
:
else
:
prepare_env
(
args
.
release
,
target_dir
)
prepare_env
(
args
.
skip_dir_check
,
args
.
release
,
target_dir
)
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
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