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
Merge requests
!29
Restructure log location
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Restructure log location
restructure-log-location
into
main
Overview
2
Commits
48
Pipelines
20
Changes
3
Merged
Ashwin Kumar Karnad
requested to merge
restructure-log-location
into
main
1 year ago
Overview
2
Commits
48
Pipelines
20
Changes
2
Expand
Resolves
#7 (closed)
0
0
Merge request reports
Compare
version 1
version 20
704eb33a
1 year ago
version 19
a359f15a
1 year ago
version 18
a07cb0f8
1 year ago
version 17
8dcd350d
1 year ago
version 16
9409f26e
1 year ago
version 15
9ff86f1a
1 year ago
version 14
0ade577b
1 year ago
version 13
451ef739
1 year ago
version 12
fd0bee45
1 year ago
version 11
4cb3d1c7
1 year ago
version 10
cf0f8dd6
1 year ago
version 9
2bdf0df3
1 year ago
version 8
4bf382d0
1 year ago
version 7
d99dbd72
1 year ago
version 6
0293e998
1 year ago
version 5
dfc10e5c
1 year ago
version 4
dfc10e5c
1 year ago
version 3
a0a87584
1 year ago
version 2
ffca8eb2
1 year ago
version 1
2397eb93
1 year ago
main (base)
and
version 3
latest version
f98e85ce
48 commits,
1 year ago
version 20
704eb33a
39 commits,
1 year ago
version 19
a359f15a
22 commits,
1 year ago
version 18
a07cb0f8
21 commits,
1 year ago
version 17
8dcd350d
20 commits,
1 year ago
version 16
9409f26e
19 commits,
1 year ago
version 15
9ff86f1a
18 commits,
1 year ago
version 14
0ade577b
17 commits,
1 year ago
version 13
451ef739
15 commits,
1 year ago
version 12
fd0bee45
14 commits,
1 year ago
version 11
4cb3d1c7
13 commits,
1 year ago
version 10
cf0f8dd6
12 commits,
1 year ago
version 9
2bdf0df3
11 commits,
1 year ago
version 8
4bf382d0
10 commits,
1 year ago
version 7
d99dbd72
6 commits,
1 year ago
version 6
0293e998
6 commits,
1 year ago
version 5
dfc10e5c
5 commits,
1 year ago
version 4
dfc10e5c
21 commits,
1 year ago
version 3
a0a87584
12 commits,
1 year ago
version 2
ffca8eb2
10 commits,
1 year ago
version 1
2397eb93
9 commits,
1 year ago
Show latest version
2 files
+
105
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
mpsd-software-environment.py
+
61
−
2
Options
@@ -12,6 +12,7 @@ import time
from
pathlib
import
Path
from
typing
import
List
,
Tuple
,
Union
import
re
from
string
import
Template
# If 'rich' is available ("pip install rich" or "apt-get install python3-rich"),
# then use coloured output, otherwise proceed as before
@@ -36,15 +37,73 @@ config_vars = {
# kept inside the mpsd_release folder
"
cmd_log_file
"
:
"
install.log
"
,
# Placeholder installer log file name, placed at mpsd_microarch/logs
"
installer_log_file
"
:
f
"
mpsdrelease_microarch_
{
call_date_iso
}
.log
"
,
"
installer_log_template
"
:
Template
(
"
${mpsd_release}_${mpsd_microarch}_${date}_${action}.log
"
),
# Placeholder build log file name, placed at mpsd_microarch/logs
"
build_log_file
"
:
f
"
mpsdrelease_microarch_
{
call_date_iso
}
_specifictoolchain.log
"
,
"
build_log_template
"
:
Template
(
"
${mpsd_release}_${mpsd_microarch}_${date}_${toolchain}_${action}.log
"
),
"
metadata_tag_open
"
:
"
!<meta>
"
,
"
metadata_tag_close
"
:
"
</meta>!
"
,
"
spack_environments_repo
"
:
"
https://gitlab.gwdg.de/mpsd-cs/spack-environments.git
"
,
}
def
create_log_file_names
(
mpsd_release
:
str
,
mpsd_microarch
:
str
,
action
:
str
,
date
:
str
=
call_date_iso
,
toolchain
:
str
=
None
,
)
->
Tuple
[
str
,
str
]:
"""
Create log file names.
This function creates the log file names for the installer and
the build log files.
The installer log file is created
from the output of this script except
the toolchain build log that is handled by the spack_setup.sh script.
The build log `tee`
'
s the output of the spack_setup.sh script to the log file.
The log file names are created using the
template strings defined in config_vars.
Parameters
----------
mpsd_release : str
MPSD software stack version
mpsd_microarch : str
system architecture
date : str
date of the call ins iso format
action : str
action performed (install,remove,reinstall,prepare,status)
only install and remove are valid for build log file.
toolchain : str
toolchain name (only for build log file)
returns : tuple
tuple containing the strings of installer and build log file names
"""
installer_log_file
=
config_vars
[
"
installer_log_template
"
].
substitute
(
mpsd_release
=
mpsd_release
,
mpsd_microarch
=
mpsd_microarch
,
date
=
date
,
action
=
action
,
)
if
toolchain
and
action
in
[
"
install
"
,
"
remove
"
]:
build_log_file
=
config_vars
[
"
build_log_template
"
].
substitute
(
mpsd_release
=
mpsd_release
,
mpsd_microarch
=
mpsd_microarch
,
date
=
date
,
action
=
action
,
toolchain
=
toolchain
,
)
else
:
build_log_file
=
None
logging
.
warning
(
"
Incorrect action or toolchain name.
"
)
return
installer_log_file
,
build_log_file
def
log_metadata
(
key
:
str
,
value
:
str
)
->
None
:
"""
Log metadata to the log file.
Loading