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
7207905c
Commit
7207905c
authored
Feb 22, 2021
by
Ben Couturier
Browse files
Added project list
parent
657c597e
Pipeline
#2338841
passed with stages
in 2 minutes and 8 seconds
Changes
12
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
7207905c
...
...
@@ -53,4 +53,4 @@ generate_stacks:
-
to_release.json
expire_in
:
1 week
script
:
-
lb-stacks-to-release ./stacks /cvmfs/lhcb.cern.ch/lib/ | tee to_release.json
-
lb-stacks-to-release ./
data/
stacks /cvmfs/lhcb.cern.ch/lib/ | tee to_release.json
README.md
View file @
7207905c
...
...
@@ -51,3 +51,12 @@ The project list should contain all *LHCb* project needed in the stack.
The toolchain refers to the release of the external software used by this stack (e.g. LCG 97a in the example).
The
*tags*
list is a free list that can be used by software querying this metadata.
## Validation and development
This packages uses
*pre-commit*
to manage its pre-commit hooks.
Make sure that this python package is installed and to install it in the .git subdirectory just run:
```
pre-commit install
```
data/projects.yml
0 → 100644
View file @
7207905c
###############################################################################
# (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration #
# #
# This software is distributed under the terms of the GNU General Public #
# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". #
# #
# In applying this licence, CERN does not waive the privileges and immunities #
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
defaultSourceURI
:
gitlab-cern:lhcb
projects
:
-
name
:
Alignment
-
name
:
AlignmentOnline
-
name
:
Allen
-
name
:
Analysis
-
name
:
Bender
-
name
:
Boole
-
name
:
Brunel
-
name
:
Castelao
-
name
:
Curie
-
name
:
Davinci
-
name
:
Detector
-
name
:
Erasmus
-
name
:
Ganga
-
name
:
Gaudi
sourceuri
:
gitlab-cern:Gaudi:Gaudi
-
name
:
Gauss
-
name
:
Geant4
-
name
:
GitCondDB
-
name
:
Hlt
-
name
:
Kepler
-
name
:
Lbcom
-
name
:
LCG
-
name
:
LHCb
-
name
:
LHCbIntegrationTests
-
name
:
Lovell
-
name
:
Moore
-
name
:
MooreAnalysis
-
name
:
MooreOnline
-
name
:
Noether
-
name
:
Online
-
name
:
Orwell
-
name
:
Panoptes
-
name
:
Panoramix
-
name
:
Phys
-
name
:
Rec
-
name
:
Run2Support
-
name
:
Stripping
-
name
:
Urania
-
name
:
Vandermeer
-
name
:
Vetra
stacks/Run3Gaudiv35r1Test.yml
→
data/
stacks/Run3Gaudiv35r1Test.yml
View file @
7207905c
File moved
environment.yaml
deleted
100644 → 0
View file @
657c597e
name
:
lhcbstacks-dev
channels
:
-
conda-forge
dependencies
:
-
python =3.8
-
pip
# Required to avoid a bug in CentOS's git
-
git
# Test tools
-
pre-commit
-
pylint
# - pyre-check
-
pytest
-
pytest-cov
setup.cfg
View file @
7207905c
...
...
@@ -38,7 +38,8 @@ testing =
[options.entry_points]
console_scripts =
lb-stacks-to-release = lhcbstacks.cli:main
lb-stacks-to-release = lhcbstacks.cli:stacks_to_release_json
lb-projects = lhcbstacks.cli:projects_json
###############################################################################
# Linting
...
...
src/lhcbstacks/__init__.py
View file @
7207905c
...
...
@@ -176,3 +176,16 @@ class LHCbClassicStack(Stack):
tmplist
+=
[
self
.
get_toolchain
()]
todo
.
append
((
platform
,
tmplist
))
return
todo
def
list_projects
(
projects_data
):
""" Returns the list of known projects """
info
=
None
with
open
(
projects_data
)
as
file
:
info
=
yaml
.
load
(
file
,
Loader
=
yaml
.
FullLoader
)
defaultSourceURI
=
info
[
"defaultSourceURI"
]
projects
=
info
[
"projects"
]
for
p
in
projects
:
if
"sourceuri"
not
in
p
:
p
[
"sourceuri"
]
=
defaultSourceURI
+
"/"
+
p
[
"name"
]
return
projects
src/lhcbstacks/cli.py
View file @
7207905c
...
...
@@ -14,10 +14,18 @@ import json
import
lhcbstacks
def
mai
n
():
def
stacks_to_release_jso
n
():
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"stack_dir"
)
parser
.
add_argument
(
"siteroot"
)
args
=
parser
.
parse_args
()
release
=
lhcbstacks
.
list_stacks_to_release
(
args
.
stack_dir
,
args
.
siteroot
)
print
(
json
.
dumps
(
release
,
indent
=
4
,
sort_keys
=
True
))
def
projects_json
():
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"projects_data"
)
args
=
parser
.
parse_args
()
projects
=
lhcbstacks
.
list_projects
(
args
.
projects_data
)
print
(
json
.
dumps
(
projects
,
indent
=
4
,
sort_keys
=
True
))
tests/data/projects.yml
0 → 100644
View file @
7207905c
###############################################################################
# (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration #
# #
# This software is distributed under the terms of the GNU General Public #
# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". #
# #
# In applying this licence, CERN does not waive the privileges and immunities #
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
defaultSourceURI
:
gitlab-cern:lhcb
projects
:
-
name
:
LHCb
-
name
:
Gaudi
sourceuri
:
gitlab-cern:Gaudi:Gaudi
-
name
:
Gauss
tests/data/CMTStack.yml
→
tests/data/
stacks/
CMTStack.yml
View file @
7207905c
File moved
tests/data/Run3Analysis202008.yml
→
tests/data/
stacks/
Run3Analysis202008.yml
View file @
7207905c
File moved
tests/test_load.py
View file @
7207905c
...
...
@@ -16,7 +16,8 @@ import pytest
import
lhcbstacks
STACK_DIR
=
Path
(
__file__
).
parent
/
"data"
STACK_DIR
=
Path
(
__file__
).
parent
/
"data"
/
"stacks"
PROJECTS_DATA
=
Path
(
__file__
).
parent
/
"data"
/
"projects.yml"
LHCBSITEROOT
=
"/cvmfs/lhcb.cern.ch/lib"
TEST_STACK
=
"Run3Analysis202008"
TEST_PROJECT
=
"DaVinci"
...
...
@@ -105,3 +106,10 @@ def test_stacks_to_release(lhcb_install_area):
result_json
=
json
.
dumps
(
release
,
sort_keys
=
True
)
expected
=
'[{"build_tool": "cmt", "name": "CMTStack", "platforms": ["x86_64-centos7-gcc9-do0", "x86_64-centos7-gcc9-opt"], "projects": [["LHCb", "v1r1"]]}, {"build_tool": "cmake", "name": "Run3Analysis202008", "platforms": ["x86_64+avx2+fma-centos7-gcc9-opt", "x86_64-centos7-gcc9-do0"], "projects": [["Analysis", "v32r0"], ["Phys", "v31r1"], ["Rec", "v31r1"], ["Lbcom", "v31r1"], ["LHCb", "v51r1"], ["Gaudi", "v33r2"], ["Detector", "v0r5"], ["DaVinci", "v52r0"], ["LCG", "97a"]]}, {"build_tool": "cmake", "name": "Run3Analysis202008", "platforms": ["x86_64-centos7-clang8-dbg"], "projects": [["DaVinci", "v52r0"]]}]'
assert
result_json
==
expected
def
test_list_projects
():
release
=
lhcbstacks
.
list_projects
(
PROJECTS_DATA
)
result_json
=
json
.
dumps
(
release
,
sort_keys
=
True
)
expected
=
'[{"name": "LHCb", "sourceuri": "gitlab-cern:lhcb/LHCb"}, {"name": "Gaudi", "sourceuri": "gitlab-cern:Gaudi:Gaudi"}, {"name": "Gauss", "sourceuri": "gitlab-cern:lhcb/Gauss"}]'
assert
result_json
==
expected
Ben Couturier
@bcouturi
mentioned in issue
#1 (closed)
·
Feb 25, 2021
mentioned in issue
#1 (closed)
mentioned in issue #1
Toggle commit list
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