Skip to content

Commit aceca92

Browse files
first ci test yaml
first ci test yaml
1 parent aa3760c commit aceca92

9 files changed

+324
-0
lines changed

.gitignore

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# tmp files
2+
*~
3+
4+
# netbeans project files
5+
/nbproject/
6+
7+
# Code::Blocks project files
8+
/*.cbp
9+
/*.layout
10+
11+
# Visual Studio Code configuration files
12+
.vscode
13+
14+
# JetBrains project files
15+
.idea/
16+
17+
# python byte code
18+
*.pyc
19+
20+
# original backup files
21+
*.orig
22+
23+
# doxygen output
24+
docs/xml/
25+
docs/doxygen_sqlite3.db
26+
docs/html/
27+
# sphinx & breathe output
28+
docs/build/

.gitlab-ci.yml

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
2+
include:
3+
- local: '/share/ci/compiler_clang.yml'
4+
- local: '/share/ci/compiler_gcc.yml'
5+
- local: '/share/ci/compiler_nvcc_cuda.yml'
6+
- local: '/share/ci/compiler_clang_cuda.yml'
7+
8+
stages:
9+
- rebase
10+
- generate
11+
- compile
12+
- status
13+
14+
# hidden base job to generate the test matrix
15+
# required variables (space separated lists):
16+
# PIC_INPUTS - path to examples relative to share/picongpu
17+
# e.g.
18+
# "examples" starts one gitlab job per director in `examples/*`
19+
# "examples/" compile all directories in `examples/*` within one gitlab job
20+
# "examples/KelvinHelmholtz" compile all cases within one gitlab job
21+
# GITLAB_BASES - name of the hidden gitlab base job desctption `/share/ci/compiler_*`
22+
# CXX_VERSIONS - name of the compiler to use see `/share/ci/compiler_*` `e.g. "g++-8 g++-6"
23+
# BOOST_VERSIONS - boost version to check e.g. "1.70.0"
24+
# supported version: {1.65.1, 1.66.0, 1.67.0, 1.68.0, 1.69.0, 1.70.0, 1.71.0, 1.72.0, 1.73.0}
25+
# PIC_ACCS - PIConGPU backend names see `pic-build --help`
26+
# e.g. "cuda cuda:35 serial"
27+
.base_generator:
28+
stage: generate
29+
script:
30+
- $CI_PROJECT_DIR/share/ci/generate.sh > compile.yml
31+
- cat compile.yml
32+
artifacts:
33+
paths:
34+
- compile.yml
35+
36+
.base_nightly:
37+
rules:
38+
- if: '$CI_PIPELINE_SOURCE == "schedule" && $CI_COMPLEXITY == "nightly"'
39+
40+
test-rebase-to-mainline:
41+
stage: rebase
42+
script:
43+
- $CI_PROJECT_DIR/share/ci/git_rebase.sh
44+
45+
# gcc matrix
46+
# test simples setup to cover compatibility issues with boost
47+
matrix-gcc-simple:
48+
variables:
49+
PIC_INPUTS: "examples/Empty"
50+
GITLAB_BASES: ".base_gcc"
51+
CXX_VERSIONS: "g++-9"
52+
BOOST_VERSIONS: "1.65.1"
53+
PIC_ACCS: "omp2b"
54+
extends: ".base_generator"
55+
56+
compile-matrix-gcc-simple:
57+
stage: compile
58+
trigger:
59+
include:
60+
- artifact: compile.yml
61+
job: matrix-gcc-simple
62+
strategy: depend
63+
64+
# clang matrix
65+
# test simples setup to cover compatibility issues with boost
66+
matrix-clang-simple:
67+
variables:
68+
PIC_INPUTS: "examples/Empty"
69+
GITLAB_BASES: ".base_clang"
70+
CXX_VERSIONS: "clang++-5.0"
71+
BOOST_VERSIONS: "1.65.1"
72+
PIC_ACCS: "omp2b"
73+
extends: ".base_generator"
74+
75+
compile-matrix-clang-simple:
76+
stage: compile
77+
trigger:
78+
include:
79+
- artifact: compile.yml
80+
job: matrix-clang-simple
81+
strategy: depend
82+
83+
84+
status-check:
85+
stage: status
86+
script:
87+
- echo "Wait for previous stages"
88+
dependencies:
89+
- compile-matrix-clang-simple
90+
- compile-matrix-gcc-simple
91+
92+
# nightly build
93+
matrix-gcc-simple-nightly:
94+
variables:
95+
PIC_INPUTS: "examples/Empty"
96+
GITLAB_BASES: ".base_gcc"
97+
CXX_VERSIONS: "g++-9"
98+
BOOST_VERSIONS: "1.65.1"
99+
PIC_ACCS: "omp2b"
100+
extends:
101+
- .base_generator
102+
- .base_nightly
103+
104+
compile-matrix-gcc-simple-nightly:
105+
stage: compile
106+
trigger:
107+
include:
108+
- artifact: compile.yml
109+
job: matrix-gcc-simple-nightly
110+
strategy: depend
111+
extends:
112+
- .base_nightly

share/ci/compiler_clang.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
################################################################################
2+
# [clang++-X] : X = {4.0, 5.0, 6.0, 7, 8, 9, 10}
3+
4+
.base_clang:
5+
image: registry.gitlab.com/hzdr/crp/alpaka-group-container/alpaka-ci:clang
6+
variables:
7+
GIT_SUBMODULE_STRATEGY: normal
8+
PIC_CMAKE_ARGS: "-DALPAKA_CUDA_COMPILER=clang"
9+
script:
10+
- source share/ci/run_test.sh
11+
# x86_64 tag is used to get a multi-core CPU for the tests
12+
tags:
13+
- x86_64

share/ci/compiler_clang_cuda.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
################################################################################
2+
# [clang++-X] : X = {4.0, 5.0, 6.0, 7, 8, 9, 10}
3+
# cuda9.2Clang is not supporting clang-7
4+
5+
.base_cuda_clang:
6+
variables:
7+
GIT_SUBMODULE_STRATEGY: normal
8+
PIC_CMAKE_ARGS: "-DALPAKA_CUDA_COMPILER=clang"
9+
script:
10+
- source share/ci/run_test.sh
11+
tags:
12+
- cuda
13+
- x86_64
14+
15+
.clang_cuda92:
16+
image: registry.gitlab.com/hzdr/crp/alpaka-group-container/alpaka-ci:cuda9.2Clang
17+
extends: .base_cuda_clang
18+
19+
.clang_cuda100:
20+
image: registry.gitlab.com/hzdr/crp/alpaka-group-container/alpaka-ci:cuda10.0Clang
21+
extends: .base_cuda_clang
22+
23+
.clang_cuda101:
24+
image: registry.gitlab.com/hzdr/crp/alpaka-group-container/alpaka-ci:cuda10.1Clang
25+
extends: .base_cuda_clang

share/ci/compiler_gcc.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
################################################################################
2+
# [g++-X] : X = {5, 6, 7, 8, 9}
3+
4+
.base_gcc:
5+
image: registry.gitlab.com/hzdr/crp/alpaka-group-container/alpaka-ci:gcc
6+
variables:
7+
GIT_SUBMODULE_STRATEGY: normal
8+
script:
9+
- source share/ci/run_test.sh
10+
# x86_64 tag is used to get a multi-core CPU for the tests
11+
tags:
12+
- x86_64

share/ci/compiler_nvcc_cuda.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
################################################################################
2+
# [g++-X] : X = {5, 6, 7, 8, 9}
3+
4+
.base_cuda:
5+
variables:
6+
GIT_SUBMODULE_STRATEGY: normal
7+
before_script:
8+
- nvidia-smi
9+
- nvcc --version
10+
script:
11+
- source share/ci/run_test.sh
12+
tags:
13+
- cuda
14+
- x86_64
15+
16+
.nvcc_cuda92:
17+
image: registry.gitlab.com/hzdr/crp/alpaka-group-container/alpaka-ci:cuda9.2gcc
18+
extends: .base_cuda
19+
20+
.nvcc_cuda100:
21+
image: registry.gitlab.com/hzdr/crp/alpaka-group-container/alpaka-ci:cuda10.0gcc
22+
extends: .base_cuda
23+
24+
.nvcc_cuda101:
25+
image: registry.gitlab.com/hzdr/crp/alpaka-group-container/alpaka-ci:cuda10.1gcc
26+
extends: .base_cuda
27+
28+
.nvcc_cuda102:
29+
image: registry.gitlab.com/hzdr/crp/alpaka-group-container/alpaka-ci:cuda10.2gcc
30+
extends: .base_cuda

share/ci/generate.sh

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
3+
# generate a job matrix based on the environment variable lists (space separated)
4+
# variables: GITLAB_BASES CXX_VERSIONS BOOST_VERSIONS PIC_INPUTS PIC_ACCS
5+
6+
export picongpu_DIR=$CI_PROJECT_DIR
7+
cd $picongpu_DIR/share/picongpu/
8+
9+
echo "include:"
10+
echo " - local: '/share/ci/compiler_clang.yml'"
11+
echo " - local: '/share/ci/compiler_gcc.yml'"
12+
echo " - local: '/share/ci/compiler_nvcc_cuda.yml'"
13+
echo " - local: '/share/ci/compiler_clang_cuda.yml'"
14+
echo ""
15+
16+
for base_job in $GITLAB_BASES; do
17+
for CXX_VERSION in $CXX_VERSIONS; do
18+
for BOOST_VERSION in ${BOOST_VERSIONS}; do
19+
for CASE in ${PIC_INPUTS}; do
20+
for ACC in ${PIC_ACCS}; do
21+
test_case_folder=$CASE
22+
job_name="${CXX_VERSION}_${ACC}_${BOOST_VERSION}_$(echo $test_case_folder | tr '/' '.')"
23+
echo "${job_name}:"
24+
echo " variables:"
25+
echo " PIC_TEST_CASE_FOLDER: \"${test_case_folder}\""
26+
echo " CXX_VERSION: \"${CXX_VERSION}\""
27+
echo " PIC_BACKEND: \"${ACC}\""
28+
echo " BOOST_VERSION: \"${BOOST_VERSION}\""
29+
echo " extends: $base_job"
30+
echo ""
31+
done
32+
done
33+
done
34+
done
35+
done

share/ci/git_rebase.sh

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
###################################################
4+
# build an run tests
5+
###################################################
6+
7+
8+
cd $CI_PROJECT_DIR
9+
10+
pr_id=$(echo "$CI_BUILD_REF_NAME" | cut -d"/" -f1 | cut -d"-" -f2)
11+
branch=$(curl -X GET https://api.github.com/repos/ComputationalRadiationPhysics/gitlab-ci-testproject/pulls/${pr_id} 2>/dev/null| python -c 'import json,sys;obj=json.loads(sys.stdin.read());print(obj["base"]["ref"])')
12+
echo "branch=${branch}"
13+
14+
git remote add mainline https://github.com/ComputationalRadiationPhysics/gitlab-ci-testproject.git
15+
git fetch mainline
16+
17+
git config --global user.email "CI-BOT"
18+
git config --global user.name "[email protected]"
19+
20+
git rebase mainline/dev
21+
ls -la
22+
git log
23+
24+
env

share/ci/run_test.sh

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
3+
# the default build type is Release
4+
# if neccesary, you can rerun the pipeline with another build type-> https://docs.gitlab.com/ee/ci/pipelines.html#manually-executing-pipelines
5+
# to change the build type, you must set the environment variable PIC_BUILD_TYPE
6+
if [[ ! -v PIC_BUILD_TYPE ]] ; then
7+
PIC_BUILD_TYPE=Release ;
8+
fi
9+
10+
###################################################
11+
# cmake config builder
12+
###################################################
13+
14+
PIC_CONST_ARGS=""
15+
PIC_CONST_ARGS="${PIC_CONST_ARGS} -DCMAKE_BUILD_TYPE=${PIC_BUILD_TYPE}"
16+
CMAKE_ARGS="${PIC_CONST_ARGS} ${PIC_CMAKE_ARGS} -DCMAKE_CXX_COMPILER=${CXX_VERSION} -DBOOST_ROOT=/opt/boost/${BOOST_VERSION}"
17+
18+
###################################################
19+
# build an run tests
20+
###################################################
21+
22+
# use one build directory for all build configurations
23+
cd $HOME
24+
mkdir buildCI
25+
cd buildCI
26+
27+
export picongpu_DIR=$CI_PROJECT_DIR
28+
export PATH=$picongpu_DIR/bin:$PATH
29+
30+
PIC_PARALLEL_BUILDS=$(nproc)
31+
# limit to 8 parallel builds to avoid out of memory errors
32+
if [ $PIC_PARALLEL_BUILDS -gt 8 ] ; then
33+
PIC_PARALLEL_BUILDS=8
34+
fi
35+
echo -e "\033[0;32m///////////////////////////////////////////////////"
36+
echo "number of processor threads -> $(nproc)"
37+
echo "number of parallel builds -> $PIC_PARALLEL_BUILDS"
38+
echo "cmake version -> $(cmake --version | head -n 1)"
39+
echo "build directory -> $(pwd)"
40+
echo "CMAKE_ARGS -> ${CMAKE_ARGS}"
41+
echo "accelerator -> ${PIC_BACKEND}"
42+
echo "input set -> ${PIC_TEST_CASE_FOLDER}"
43+
echo -e "/////////////////////////////////////////////////// \033[0m \n\n"
44+
45+
sleep 20

0 commit comments

Comments
 (0)