Skip to content
This repository has been archived by the owner on Jan 31, 2022. It is now read-only.

[feature] templated rpc methods #143

Merged
merged 56 commits into from
Mar 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
46549c2
Add core functionnality for the templated RPC calls
lpetre-ulb Jul 3, 2019
284010f
Add support for `std::array` of integral types
lpetre-ulb Jul 10, 2019
4d8223b
Add support of `std::map<std::uint32_t, T>`
lpetre-ulb Jul 10, 2019
2a96da9
Add support for `std::map<std:string, T>`
lpetre-ulb Jul 10, 2019
cb19bda
Add support for custom types
lpetre-ulb Jul 10, 2019
cdb1f63
Relax namespace constraints for custom type serializers
lpetre-ulb Jul 22, 2019
a7e82c0
Catch exceptions thrown by RPC methods
lmoureaux Jul 20, 2019
9f878c8
Handle the error key in call()
lmoureaux Jul 20, 2019
3c50086
Handle RPCMsg and RPCSvc exceptions in call()
lmoureaux Aug 6, 2019
19dac69
Clean up Makefiles -- Fixes #128
jsturdy Aug 8, 2019
7c6cbe1
Compile rpc/exceptions.cpp into libxhal.so
lmoureaux Aug 10, 2019
b68124c
Fix typo in rpc/register.h header guard
lmoureaux Aug 10, 2019
6257c5e
Add lmdb++.h to xhalcore
lmoureaux Aug 25, 2019
8f7459d
Add a class to guard access to the LMDB database
lmoureaux Aug 25, 2019
a390dbd
add CI templates
jsturdy Aug 12, 2019
6ea7306
Compiling with SONAMEs
jsturdy Aug 18, 2019
672cf00
Only rebuild packages when required
jsturdy Aug 19, 2019
a876ae1
Fixup in gitlab-ci
jsturdy Aug 19, 2019
114a65b
Update CI process
jsturdy Sep 9, 2019
162081b
[refactor] Move `xhalcore` to `xhal`
jsturdy Sep 16, 2019
dc0624b
[refactor] Move `xhalarm` `postinstall.sh` script to `xhal`, and remo…
jsturdy Sep 16, 2019
271c614
[refactor] Move `extern` headers to `xhal/extern`
jsturdy Sep 16, 2019
1798acc
[refactor] Migrate headers for `client` package
jsturdy Sep 16, 2019
0b83821
[refactor] Migrate sources for `client/rpc_manager` package
jsturdy Sep 16, 2019
9dac421
[refactor] Migrate sources for `client/python_wrappers` package
jsturdy Sep 16, 2019
c9218c2
[refactor] Migrate sources for `client` interfaces
jsturdy Sep 16, 2019
0a78bea
[refactor] Migrate headers for `common/rpc` package
jsturdy Sep 16, 2019
cda8aae
[refactor] Migrate headers for `common/utils` package
jsturdy Sep 16, 2019
d731769
[refactor] Migrate headers for `server` package
jsturdy Sep 16, 2019
1f35f81
[refactor] Migrate sources for `server` package
jsturdy Sep 16, 2019
1cc4148
[refactor] Update bolierplate for new structure
jsturdy Sep 16, 2019
31dad83
[refactor] Adapt `common/rpc` for new structure
jsturdy Sep 16, 2019
aff3201
[refactor] Adapt `common` for new structure
jsturdy Sep 16, 2019
d9a128c
[refactor] Adapt `server` for new structure
jsturdy Sep 16, 2019
1519762
[refactor] Adapt `client` interfaces for new structure
jsturdy Sep 16, 2019
26460ff
[refactor] Adapt `client/rpcman` for new structure
jsturdy Sep 16, 2019
699da3d
[refactor] Adapt `client/python_wrappers` for new structure
jsturdy Sep 16, 2019
42b6b9b
[style] Standardize Doxygen comment style
jsturdy Sep 16, 2019
dc5c2ad
[style] Standardize source file namespace style
jsturdy Sep 16, 2019
27fab7b
[style] Standardize Doxygen comment style
jsturdy Sep 16, 2019
323da32
[style] Standardize whitespace and brace style in `client` header files
jsturdy Sep 16, 2019
a1079b0
[style] Standardize whitespace and brace style in `client` source files
jsturdy Sep 16, 2019
68aaa65
[style] Standardize whitespace and brace style in `common/utils` files
jsturdy Sep 16, 2019
510d5f6
[style] Standardize whitespace and brace style in `common/rpc` files
jsturdy Sep 16, 2019
0b50edd
[style] Standardize whitespace and brace style in `server` files
jsturdy Sep 16, 2019
1bd8441
[bugfix] Fix incorrect namespaces after migration
jsturdy Oct 10, 2019
ca76352
[packaging] migrate ModuleManager from ctp7_modules to xhal
jsturdy Dec 21, 2019
4862552
[refactor] Update boilerplate for new structure
jsturdy Sep 16, 2019
aae03c1
[packaging] Ensure that `install` target puts cross-compilation libra…
jsturdy Oct 10, 2019
ce741d2
[packaging] Update `config` subodule and packaging requirements
jsturdy Oct 10, 2019
6d8d337
[build-system] Generic python scriptlets
jsturdy Nov 14, 2019
4ff8258
[build-system] Add cross-compile (un)install targets
jsturdy Dec 20, 2019
7a47c98
[ci] CI pipeline updates
jsturdy Dec 21, 2019
fe43ae6
Update the config submodule
lpetre-ulb Feb 29, 2020
0682249
Compile against C++14
lpetre-ulb Feb 29, 2020
bea638d
Fix invalid use of strcat
lpetre-ulb Feb 29, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
355 changes: 355 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,355 @@
## GitLab Continuous Integration YAML file

## ------------------- used variables: ------------------- ##
# https://gitlab.cern.ch/help/ci/variables/README.md
# CI_COMMIT_TAG
# CI_COMMIT_REF_NAME
# CI_COMMIT_SHA
# CI_MERGE_REQUEST_TARGET_BRANCH_NAME
# CI_MERGE_REQUEST_TARGET_BRANCH_SHA
# GITLAB_USER_EMAIL
# GITLAB_USER_ID
# GITLAB_USER_LOGIN
# GITLAB_USER_NAME

## ------------------- used secure variables: ------------------- ##
# EOS_ACCOUNT_USERNAME: Username of to write in the EOS folder whose path is EOS_PATH
# EOS_ACCOUNT_PASSWORD: Account password
# KRB_PASSWORD: Kerberos account password
# KRB_USERNAME: Kerberos account username
# GPG_SIGNING_KEY_PRIV: GPG private key for signing
# GPG_PASSPHRASE: GPG key passphrase for signing
# CI_DEPLOY_USER:
# CI_DEPLOY_PASSWORD:

## ------------------- Stage definitions ------------------- ##
stages:
- compile # compile the sources, make the docs (if requested)
- docs # compile the docs (if requested)
- package # build the RPMs
- test # test the packages (install, run basic tests)
- publish # publish the RPMs and docs
- release # create release page

## ------------------- Define up anchors for various tasks, shared across all jobs utilizing them ------------------- ##
.common_variables: &common_variables
EOS_SITE_URL: https://cmsgemdaq.cern.ch/cmsgemdaq
BUILD_HOME: /builds/${CI_PROJECT_NAMESPACE}
XDAQ_OS: linux
XDAQ_ROOT: /opt/xdaq
LD_LIBRARY_PATH: /opt/xdaq/lib:/opt/reedmuller/lib:/opt/wiscrpcsvc/lib
PACKAGE_NAME: ${CI_PROJECT_NAME}
ARTIFACTS_DIR: artifacts
XILINX_SDK_PATH: /data/bigdisk/sw/Xilinx/SDK
GIT_SUBMODULE_STRATEGY: normal

variables: *common_variables

## ------------------- Set up images for specified job types ------------------- #
.slc6setup: &slc6setup
image: gitlab-registry.cern.ch/cms-gem-daq-project/gemdaq_ci_worker/extrapy/devtoolsroot:slc6

.cc7setup: &cc7setup
image: gitlab-registry.cern.ch/cms-gem-daq-project/gemdaq_ci_worker/extrapy/devtoolsroot:cc7-xdaq14
# image: gitlab-registry.cern.ch/cms-gem-daq-project/gemdaq_ci_worker/extrapy/devtoolsroot:cc7-xdaq14-6
# image: gitlab-registry.cern.ch/cms-gem-daq-project/gemdaq_ci_worker/extrapy/devtoolsroot:cc7-xdaq15

.cc8setup: &cc8setup
image: gitlab-registry.cern.ch/cms-gem-daq-project/gemdaq_ci_worker/extrapy/devtoolsroot:cc8
# image: gitlab-registry.cern.ch/cms-gem-daq-project/gemdaq_ci_worker/extrapy/devtoolsroot:cc8:python2
# image: gitlab-registry.cern.ch/cms-gem-daq-project/gemdaq_ci_worker/extrapy/devtoolsroot:cc8:python3

### ------------------- Shared setup between stages ------------------- ###
.common_setup: &common_setup |-
mkdir -p ${ARTIFACTS_DIR}
pip install -I --user "pip" "importlib" "codecov" "setuptools<38.2" "sphinxcontrib-napoleon==0.2.9"
sudo yum install -y wiscrpcsvc\* --enablerepo=gemos*
sudo yum install -y reedmuller\* --enablerepo=gemos*

.common_zynq_setup: &common_zynq_setup |-
sudo yum install -y gem-peta-stage-ctp7 --enablerepo=gemos*
sudo yum install -y lmdb\*
# sudo /opt/arm/getarm.sh 4.9-2017.01
export PETA_STAGE=/opt/gem-peta-stage/ctp7
export PATH=/opt/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin:${PATH}
# source ${XILINX_SDK_PATH}/2016.2/settings64.sh

.retry_settings: &retry_settings
retry:
max: 2
when:
- runner_system_failure
- stuck_or_timeout_failure

.common_cache: &common_cache
untracked: true
paths:
- ~/.cache/pip

.common_artifacts: &common_artifacts
name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
expire_in: 1d
paths:
- ${ARTIFACTS_DIR}

##### ------------------- Run compilation ------------------- #####
.compile_artifacts: &compile_artifacts
untracked: true
<<: *common_artifacts

.touch_compile_artifacts: &touch_compile_artifacts |-
find ./ -type f -name '*.d' -print0 -exec touch {} \;
find ./ -type f -name '*.o' -print0 -exec touch {} \;
find ./ -type f -name 'lib*' -print0 -exec touch {} \;
find ./ -type f -name 'xhalpy*' -print0 -exec touch {} \;

# .before_compile: &before_compile |-

.compile_common: &compile_common
only:
- /^issue.*$/
- /^hotfix.*$/
- /^release.*$/
- /^feature.*$/
- /^citest.*$/
- /^develop$/
- /^master$/
- merge_requests
- tags
tags:
# - peta
stage: compile
before_script:
- *common_setup
- *common_zynq_setup
script:
- make all -j8
after_script:
- ls -la ${ARTIFACTS_DIR}
artifacts:
name: ${CI_JOB_STAGE}
<<: *compile_artifacts

compile:cc7:
<<: *cc7setup
<<: *compile_common
environment:
variables:
cache:

##### ------------------- Generate docs ------------------- #####
.docs_artifacts: &docs_artifacts
untracked: true
<<: *common_artifacts

.touch_docs_artifacts: &touch_docs_artifacts |-
find ./python/reg_interface_gem/doc/_build -type f -print0 -exec touch {} \;
# find ./doc/html -type f -print0 -exec touch {} \;
# find ./doc/latex -type f -print0 -exec touch {} \;

# generate docs
docs:
<<: *cc7setup
stage: compile
only:
- /^release.*$/
- /^feature.*$/
- /^citest.*$/
- /^develop$/
- /^master$/
- merge_requests
- tags
dependencies:
before_script:
script:
- make doc
after_script:
- |
mkdir -p ${ARTIFACTS_DIR}/api
mv -t ${ARTIFACTS_DIR}/api/ doc/build/html/*
artifacts:
name: ${CI_JOB_STAGE}
<<: *docs_artifacts
coverage: '/Documentation coverage: \d+\.\d+/'

##### ------------------- Run tests using the compiled binaries ------------------- #####
.test_artifacts: &test_artifacts
untracked: true
<<: *common_artifacts
expire_in: 1w

.before_test: &before_test |-
*common_setup

.before_abi_check: &before_abi_check |-
sudo yum install -y abi-compliance-checker abi-dumper

# run tests using the binary built before
test:cc7:
<<: *cc7setup
stage: test
tags:
dependencies:
- compile:cc7
before_script:
- *common_setup
script:
- echo ./runmytests.sh
after_script:
- 'echo "FIXME: test summary"'
coverage: '/Test coverage: \d+\.\d+/'

test:abi:cc7:
<<: *cc7setup
stage: test
tags:
# - peta
only:
- merge_requests
dependencies:
- compile:cc7
before_script:
- *common_setup
- *common_zynq_setup
- *before_abi_check
script:
- make checkabi
allow_failure: true
after_script:
- find . -type d -iname compat_reports -print0 -exec tar cjf ${CI_PROJECT_NAME}_mr${CI_MERGE_REQUEST_ID}_abi_compat.tbz2 {} \+
- 'echo "FIXME: API/ABI summary"'
artifacts:
name: ${CI_JOB_STAGE}
<<: *test_artifacts
coverage: '/Test coverage: \d+\.\d+/'

##### ------------------- Package generated files into RPMs and tarballs ------------------- #####
.package_artifacts: &package_artifacts
untracked: true
<<: *common_artifacts

.touch_package_artifacts: &touch_package_artifacts |-
find ./python/reg_interface_gem/pkg/xhal -type f -print0 -exec touch {} \;
find ./python/reg_interface_gem/rpm -type f -iname 'setup.py' -print0 -exec touch {} \;
find ./python/reg_interface_gem/rpm -type f -iname 'reg_interface_gem.src.rpm' -print0 -exec touch {} \;
find ./python/reg_interface_gem/rpm -type f -iname 'reg_interface_gem.x86_64.rpm' -print0 -exec touch {} \;
find ./python/reg_interface_gem/rpm -type f -iname 'reg_interface_gem.zip' -print0 -exec touch {} \;
find ./xhal -type f -wholename '*/rpm/xhal*.tbz2' -print0 -exec touch {} \;
find ./xhal -type f -wholename '*/rpm/xhal.spec' -print0 -exec touch {} \;
find ./xhal -type f -wholename '*/rpm/xhal*.src.rpm' -print0 -exec touch {} \;
find ./xhal -type f -wholename '*/rpm/xhal*.arm*.rpm' -print0 -exec touch {} \;
find ./xhal -type f -wholename '*/rpm/xhal*.x86_64.rpm' -print0 -exec touch {} \;

.before_package: &before_package |-
eval `set | egrep '^(CI|GIT)' | awk -F= '{ print "export " $1 }'`
eval `set | egrep '^(BUILD|REL|PACK|ARTI|XDAQ|CMS|LD)' | awk -F= '{ print "export " $1 }'`

.package_common: &package_common
stage: package
before_script:
- *common_setup
- *common_zynq_setup
- *before_package
script:
## Ensure compile artifacts are more recent than the checkout
- *touch_compile_artifacts
- *touch_docs_artifacts
- make rpm
after_script:
artifacts:
name: ${CI_JOB_STAGE}
<<: *package_artifacts

# generate RPMs
package:cc7:
<<: *cc7setup
only:
- /^release.*$/
- /^feature.*$/
- /^citest.*$/
- /^develop$/
- /^master$/
- merge_requests
- tags
# - triggers ## should go into releases/'testing' or unstable?
# - chat ## should go into releases/'testing' or unstable?
# - api ## should go into releases/'testing' or unstable?
tags:
# - peta
dependencies:
- compile:cc7
- docs
<<: *package_common

##### ------------------- Publish RPMs, docs, and tarballs ------------------- #####
.publish_variables: &publish_variables
EOS_BASE_WEB_DIR: "/eos/project/c/cmsgemdaq/www/ci-test"
EOS_COMMON_WEB_DIR: "cmsgemdaq"
EOS_DOC_NAME: "api"
EOS_REPO_NAME: "repos"
EOS_SITE_WEB_DIR: "${EOS_BASE_WEB_DIR}/${CI_PROJECT_NAME}"
EOS_SW_DIR: "sw/gemos"
EOS_DOCS_DIR: "docs/${CI_PROJECT_NAME}"
EOS_UNSTABLE_DIR: "unstable"
EOS_RELEASE_DIR: "releases"

.before_publish: &before_publish |-
sudo yum install -y rpm-sign

.publish_common: &publish_common
<<: *cc7setup
stage: publish
variables: *publish_variables
before_script:
- *common_setup
- *common_zynq_setup
- *before_publish
script:
- 'echo "FIXME: github_changelog_generator"'
- 'echo "FIXME: cp CHANGELOG.md ${ARTIFACTS_DIR}"'
- *touch_compile_artifacts
- *touch_docs_artifacts
- *touch_package_artifacts
- make release
- cp -rfp release/* ${ARTIFACTS_DIR}
- 'echo "Running as: " $(whoami)'
- ${BUILD_HOME}/${CI_PROJECT_NAME}/config/ci/publish_eos.sh
# - push python packages to pypi/conda
# - push RPMs to packagecloud.io
# - push RPMs to gitlab yum repo, a la xDAQ?
# - push sphinx/rst/md/rtd docs to readthedocs.io
# - push sphinx/rst/md/rtd docs to $EOS_WEB_DIR/docs/${fulltag}, update doc main page index

publish:
<<: *publish_common
only:
- /^release.*$/@cms-gem-daq-project/xhal
- /^feature.*$/@cms-gem-daq-project/xhal
- /^citest.*$/@cms-gem-daq-project/xhal
- /^citest.*$/@sturdy/xhal
- /^develop$/@cms-gem-daq-project/xhal
- /^master$/@cms-gem-daq-project/xhal
- merge_requests@cms-gem-daq-project/xhal
- tags@cms-gem-daq-project/xhal
tags:
dependencies:
- package:cc7
after_script:
- 'echo "FIXME: github_changelog_generator"'
- 'echo "FIXME: generate_release_notes.sh"'
# - notify mattermost
# - send email
# - generate_release.sh pre

release:
only:
- tags@cms-gem-daq-project/xhal
dependencies:
- publish
stage: release
script:
- 'echo "FIXME: github_changelog_generator"'
- 'echo "FIXME: generate_release_notes.sh"'
# - notify mattermost
# - send email
# - generate_release.sh pre
Loading