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
fe0d2dd2
Commit
fe0d2dd2
authored
1 year ago
by
Ashwin Kumar Karnad
Browse files
Options
Downloads
Patches
Plain Diff
update prepare env to include checks to update the branch
parent
7acc797e
No related branches found
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
+20
-22
20 additions, 22 deletions
install-mpsd-software-environment.py
with
20 additions
and
22 deletions
install-mpsd-software-environment.py
+
20
−
22
View file @
fe0d2dd2
...
@@ -66,49 +66,47 @@ def setup_log_cmd(shared_var, msg=None):
...
@@ -66,49 +66,47 @@ def setup_log_cmd(shared_var, msg=None):
f
"
Spack environments branch:
{
shared_var
[
'
spe_branch
'
]
}
(commit hash:
{
shared_var
[
'
spe_commit_hash
'
]
}
)
\n
"
f
"
Spack environments branch:
{
shared_var
[
'
spe_branch
'
]
}
(commit hash:
{
shared_var
[
'
spe_commit_hash
'
]
}
)
\n
"
)
)
def
prepare_environment
(
mpsd_release
,
toolchain_base
_dir
):
def
prepare_environment
(
mpsd_release
,
script
_dir
):
if
not
os
.
path
.
exists
(
toolchain_base_dir
):
release_base_dir
=
os
.
path
.
join
(
script_dir
,
mpsd_release
)
os
.
makedirs
(
toolchain_base_dir
)
if
not
os
.
path
.
exists
(
release_base_dir
):
os
.
makedirs
(
release_base_dir
)
else
:
else
:
if
not
skip_dir_check
:
# Warn that the target directory already exists.
raise
ValueError
(
print
(
"
>Target directory already exists. Continuing...
"
)
f
"
Error: Target directory
{
toolchain_base_dir
}
already exists.
\n\
with
os_chdir
(
release_base_dir
):
Please remove it and try again.
"
# Clone the spack-environments repo if it doesn't exist
)
if
not
os
.
path
.
exists
(
"
spack-environments
"
):
with
os_chdir
(
toolchain_base_dir
):
subprocess
.
run
(
[
"
git
"
,
"
clone
"
,
config_vars
[
'
spack_environments_repo
'
],
]
)
with
os_chdir
(
"
spack-environments
"
):
subprocess
.
run
(
subprocess
.
run
(
[
[
"
git
"
,
"
git
"
,
"
c
heckout
"
,
"
c
lone
"
,
mpsd_release
,
config_vars
[
'
spack_environments_repo
'
]
,
]
]
)
)
with
os_chdir
(
"
spack-environments
"
):
# Git fetch and checkout the release branch and git pull to be sure that the resulting repo is up to date
subprocess
.
run
([
"
git
"
,
"
fetch
"
,
"
--all
"
])
subprocess
.
run
([
"
git
"
,
"
checkout
"
,
mpsd_release
])
subprocess
.
run
([
"
git
"
,
"
pull
"
])
# Get the branch and commit hash of the spack-environments repo and store them in shared_var
# Get the branch and commit hash of the spack-environments repo and store them in shared_var
shared_var
[
'
spe_commit_hash
'
]
=
(
spe_commit_hash
=
(
subprocess
.
run
(
subprocess
.
run
(
[
"
git
"
,
"
rev-parse
"
,
"
HEAD
"
],
stdout
=
subprocess
.
PIPE
[
"
git
"
,
"
rev-parse
"
,
"
HEAD
"
],
stdout
=
subprocess
.
PIPE
)
)
.
stdout
.
decode
()
.
stdout
.
decode
()
.
strip
()
.
strip
()
)
)
shared_var
[
'
spe_branch
'
]
=
(
spe_branch
=
(
subprocess
.
run
(
subprocess
.
run
(
[
"
git
"
,
"
rev-parse
"
,
"
--abbrev-ref
"
,
"
HEAD
"
],
stdout
=
subprocess
.
PIPE
[
"
git
"
,
"
rev-parse
"
,
"
--abbrev-ref
"
,
"
HEAD
"
],
stdout
=
subprocess
.
PIPE
)
)
.
stdout
.
decode
()
.
stdout
.
decode
()
.
strip
()
.
strip
()
)
)
shared_var
[
'
available_toolchains
'
]
=
os
.
listdir
(
"
toolchains
"
)
available_toolchains
=
os
.
listdir
(
"
toolchains
"
)
setup_log_cmd
(
shared_var
)
setup_log_cmd
(
shared_var
)
return
shared_var
return
shared_var
...
...
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