Commit 70bcc0ec authored by Ben Couturier's avatar 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
......@@ -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"])
......
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment