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
50214580
Commit
50214580
authored
1 year ago
by
Ashwin Kumar Karnad
Browse files
Options
Downloads
Patches
Plain Diff
update log message
parent
4f68c8c6
No related branches found
No related tags found
1 merge request
!77
Skip logging script commit hash
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mpsd_software_manager/mpsd_software.py
+5
-30
5 additions, 30 deletions
src/mpsd_software_manager/mpsd_software.py
with
5 additions
and
30 deletions
src/mpsd_software_manager/mpsd_software.py
+
5
−
30
View file @
50214580
...
...
@@ -580,10 +580,9 @@ def record_script_execution_summary(
"""
# Write to the log file with the following format
# --------------------------------------------------
# 2023-02-29T23:32:01, install-software-environment.py --release 23b --install ALL
# Software environment installer branch: script_branch (commit hash: \
# script_commit_hash)
# Spack environments branch: dev-23a (commit hash: spe_commit_hash)
# 2023-06-20T15:30:37.965370, src/mpsd_software_manager/mpsd_software.py prepare dev-23a
# MPSD Software manager version: 2023.6.16
# Spack environments branch: dev-23a (commit hash: 8eac43476b2fd9a3a044f5562f3f7c2bccfe384a)
# MSGs
with
os_chdir
(
root_dir
):
with
open
(
config_vars
[
"
cmd_log_file
"
],
"
a
"
)
as
f
:
...
...
@@ -597,39 +596,15 @@ def record_script_execution_summary(
# Gather data to log
# call statement:
cmd_line
=
"
"
.
join
(
sys
.
argv
)
# script branch and commit hash
with
os_chdir
(
root_dir
):
try
:
script_branch
=
(
run
(
[
"
git
"
,
"
rev-parse
"
,
"
--abbrev-ref
"
,
"
HEAD
"
],
stdout
=
subprocess
.
PIPE
,
check
=
True
,
)
.
stdout
.
decode
()
.
strip
()
)
script_commit_hash
=
(
run
(
[
"
git
"
,
"
rev-parse
"
,
"
--short
"
,
"
HEAD
"
],
stdout
=
subprocess
.
PIPE
,
check
=
True
,
)
.
stdout
.
decode
()
.
strip
()
)
except
subprocess
.
CalledProcessError
:
script_branch
=
"
unknown
"
script_commit_hash
=
"
unknown
"
# spack-environments branch and commit hash from kwargs
spe_branch
=
kwargs
.
get
(
"
spe_branch
"
,
None
)
spe_commit_hash
=
kwargs
.
get
(
"
spe_commit_hash
"
,
None
)
# Write to log file
f
.
write
(
f
"
{
datetime
.
datetime
.
now
().
isoformat
()
}
,
{
cmd_line
}
\n
"
)
# logs script version
f
.
write
(
f
"
Software environment installer branch:
{
script_branch
}
"
f
"
(commit hash:
{
script_commit_hash
}
)
\n
"
f
"
MPSD Software manager version:
{
__version__
}
\n
"
)
f
.
write
(
f
"
Spack environments branch:
{
spe_branch
}
"
...
...
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