Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LHCb Core Software
lhcbstacks
Commits
70bcc0ec
Commit
70bcc0ec
authored
Mar 30, 2021
by
Ben Couturier
Browse files
Added unique ID for each build related to a stack
parent
1b88f073
Pipeline
#2448793
passed with stages
in 2 minutes and 28 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/lhcbstacks/__init__.py
View file @
70bcc0ec
...
...
@@ -77,9 +77,12 @@ def list_stacks_to_release(stack_paths, siteroot):
# 2. Iterate to generate the stack in the exported format
tobuild
=
[]
for
stack
in
inc_stacks
:
for
platform
,
project_list
in
stack
.
builds_to_do
():
stack_number
=
0
for
platform
,
project_list
in
sorted
(
stack
.
builds_to_do
()):
# First checking if another build has the same projects exactly
# Then add platform to it instead of creating a new build
# The sort is to have a stable order in order to keep the stack
# number consistent.
found_matching
=
False
for
d
,
s
in
tobuild
:
if
set
(
project_list
)
==
s
:
...
...
@@ -95,6 +98,7 @@ def list_stacks_to_release(stack_paths, siteroot):
# In this file for the nightlies we list the whole stack config
# and the one already done (so the complement of the info we have)
data
=
dict
()
stack_number
+=
1
data
[
"build_tool"
]
=
stack
.
build_tool
()
data
[
"platforms"
]
=
[
platform
]
data
[
"projects"
]
=
stack
.
projects
(
with_toolchain
=
True
)
...
...
@@ -103,7 +107,7 @@ def list_stacks_to_release(stack_paths, siteroot):
for
p
,
v
in
stack
.
projects
(
with_toolchain
=
True
).
items
()
if
(
p
,
v
)
not
in
project_list
}
data
[
"name"
]
=
stack
.
name
()
data
[
"name"
]
=
f
"
{
stack
.
name
()
}
-
{
stack_number
}
"
tobuild
.
append
((
data
,
set
(
project_list
)))
return
sorted
([
d
for
d
,
_
in
tobuild
],
key
=
lambda
d
:
d
[
"name"
])
...
...
tests/test_load.py
View file @
70bcc0ec
...
...
@@ -116,7 +116,7 @@ def test_incomplete_stacks(lhcb_install_area):
def
test_stacks_to_release
(
lhcb_install_area
):
release
=
lhcbstacks
.
list_stacks_to_release
([
STACK_DIR
],
lhcb_install_area
)
result_json
=
json
.
dumps
(
release
,
sort_keys
=
True
)
expected
=
'[{"build_tool": "cmt", "deployed": {"LCG": "60"}, "name": "CMTStack", "platforms": ["x86_64-centos7-gcc9-do0", "x86_64-centos7-gcc9-opt"], "projects": {"Gaudi": "v1r1", "LCG": "60", "LHCb": "v1r1"}}, {"build_tool": "cmake", "deployed": {"LCG": "97a"}, "name": "Gaudi_v35r2", "platforms": ["x86_64+avx2+fma-centos7-gcc9-opt", "x86_64-centos7-clang8-dbg", "x86_64-centos7-clang8-opt", "x86_64-centos7-gcc9-dbg", "x86_64-centos7-gcc9-do0", "x86_64-centos7-gcc9-opt"], "projects": {"Gaudi": "v35r2", "LCG": "97a"}}, {"build_tool": "cmake", "deployed": {"LCG": "97a"}, "name": "Run3Analysis202008", "platforms": ["x86_64+avx2+fma-centos7-gcc9-opt", "x86_64-centos7-gcc9-do0"], "projects": {"Analysis": "v32r0", "DaVinci": "v52r0", "Detector": "v0r5", "Gaudi": "v33r2", "LCG": "97a", "LHCb": "v51r1", "Lbcom": "v31r1", "Phys": "v31r1", "Rec": "v31r1"}}, {"build_tool": "cmake", "deployed": {"Analysis": "v32r0", "Detector": "v0r5", "Gaudi": "v33r2", "LCG": "97a", "LHCb": "v51r1", "Lbcom": "v31r1", "Phys": "v31r1", "Rec": "v31r1"}, "name": "Run3Analysis202008", "platforms": ["x86_64-centos7-clang8-dbg"], "projects": {"Analysis": "v32r0", "DaVinci": "v52r0", "Detector": "v0r5", "Gaudi": "v33r2", "LCG": "97a", "LHCb": "v51r1", "Lbcom": "v31r1", "Phys": "v31r1", "Rec": "v31r1"}}]'
expected
=
'[{"build_tool": "cmt", "deployed": {"LCG": "60"}, "name": "CMTStack
-1
", "platforms": ["x86_64-centos7-gcc9-do0", "x86_64-centos7-gcc9-opt"], "projects": {"Gaudi": "v1r1", "LCG": "60", "LHCb": "v1r1"}}, {"build_tool": "cmake", "deployed": {"LCG": "97a"}, "name": "Gaudi_v35r2
-1
", "platforms": ["x86_64+avx2+fma-centos7-gcc9-opt", "x86_64-centos7-clang8-dbg", "x86_64-centos7-clang8-opt", "x86_64-centos7-gcc9-dbg", "x86_64-centos7-gcc9-do0", "x86_64-centos7-gcc9-opt"], "projects": {"Gaudi": "v35r2", "LCG": "97a"}}, {"build_tool": "cmake", "deployed": {"LCG": "97a"}, "name": "Run3Analysis202008
-1
", "platforms": ["x86_64+avx2+fma-centos7-gcc9-opt", "x86_64-centos7-gcc9-do0"], "projects": {"Analysis": "v32r0", "DaVinci": "v52r0", "Detector": "v0r5", "Gaudi": "v33r2", "LCG": "97a", "LHCb": "v51r1", "Lbcom": "v31r1", "Phys": "v31r1", "Rec": "v31r1"}}, {"build_tool": "cmake", "deployed": {"Analysis": "v32r0", "Detector": "v0r5", "Gaudi": "v33r2", "LCG": "97a", "LHCb": "v51r1", "Lbcom": "v31r1", "Phys": "v31r1", "Rec": "v31r1"}, "name": "Run3Analysis202008
-2
", "platforms": ["x86_64-centos7-clang8-dbg"], "projects": {"Analysis": "v32r0", "DaVinci": "v52r0", "Detector": "v0r5", "Gaudi": "v33r2", "LCG": "97a", "LHCb": "v51r1", "Lbcom": "v31r1", "Phys": "v31r1", "Rec": "v31r1"}}]'
assert
result_json
==
expected
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment