Skip to content

first ci test yaml #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# tmp files
*~

# netbeans project files
/nbproject/

# Code::Blocks project files
/*.cbp
/*.layout

# Visual Studio Code configuration files
.vscode

# JetBrains project files
.idea/

# python byte code
*.pyc

# original backup files
*.orig

# doxygen output
docs/xml/
docs/doxygen_sqlite3.db
docs/html/
# sphinx & breathe output
docs/build/
167 changes: 167 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@

include:
- local: '/share/ci/compiler_clang.yml'
- local: '/share/ci/compiler_gcc.yml'
- local: '/share/ci/compiler_nvcc_cuda.yml'
- local: '/share/ci/compiler_clang_cuda.yml'

stages:
- rebase
- generate
- compile
- status

# hidden base job to generate the test matrix
# required variables (space separated lists):
# PIC_INPUTS - path to examples relative to share/picongpu
# e.g.
# "examples" starts one gitlab job per director in `examples/*`
# "examples/" compile all directories in `examples/*` within one gitlab job
# "examples/KelvinHelmholtz" compile all cases within one gitlab job
# GITLAB_BASES - name of the hidden gitlab base job desctption `/share/ci/compiler_*`
# CXX_VERSIONS - name of the compiler to use see `/share/ci/compiler_*` `e.g. "g++-8 g++-6"
# BOOST_VERSIONS - boost version to check e.g. "1.70.0"
# 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}
# PIC_ACCS - PIConGPU backend names see `pic-build --help`
# e.g. "cuda cuda:35 serial"
.base_generator:
stage: generate
script:
- $CI_PROJECT_DIR/share/ci/git_rebase.sh
- $CI_PROJECT_DIR/share/ci/generate.sh > compile.yml
- cat compile.yml
artifacts:
paths:
- compile.yml

.base_generator_pairwise:
stage: generate
script:
- apt update
- apt install -y python3-pip
- pip3 install allpairspy
- $CI_PROJECT_DIR/share/ci/git_rebase.sh
- $CI_PROJECT_DIR/share/ci/generate_pairwise.sh -n ${TUPLE_NUM_ELEM} > compile.yml
- cat compile.yml
artifacts:
paths:
- compile.yml

.base_nightly:
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'

# && $CI_COMPLEXITY == "nightly"'

test-rebase-to-mainline:
stage: rebase
script:
- source $CI_PROJECT_DIR/share/ci/git_rebase.sh

matrix-pair:
variables:
PIC_INPUTS: "examples"
TUPLE_NUM_ELEM: 1
extends: ".base_generator_pairwise"

compile-matrix-pair:
stage: compile
trigger:
include:
- artifact: compile.yml
job: matrix-pair
# strategy: depend

matrix-pair-nightly:
variables:
PIC_INPUTS: "examples"
TUPLE_NUM_ELEM: 2
extends:
- .base_generator_pairwise
- .base_nightly

compile-matrix-pair-nightly:
stage: compile
trigger:
include:
- artifact: compile.yml
job: matrix-pair-nightly
# strategy: depend
extends:
- .base_nightly

status-check:
stage: status
script:
- echo "Wait for previous stages"


# gcc matrix
# test simples setup to cover compatibility issues with boost
#matrix-gcc-simple:
# variables:
# PIC_INPUTS: "examples/Empty"
# GITLAB_BASES: ".base_gcc"
# CXX_VERSIONS: "g++-9"
# BOOST_VERSIONS: "1.65.1"
# PIC_ACCS: "omp2b"
# extends: ".base_generator"
#
#compile-matrix-gcc-simple:
# stage: compile
# trigger:
# include:
# - artifact: compile.yml
# job: matrix-gcc-simple
# strategy: depend
#
## clang matrix
## test simples setup to cover compatibility issues with boost
#matrix-clang-simple:
# variables:
# PIC_INPUTS: "examples/Empty"
# GITLAB_BASES: ".base_clang"
# CXX_VERSIONS: "clang++-5.0"
# BOOST_VERSIONS: "1.65.1"
# PIC_ACCS: "omp2b"
# extends: ".base_generator"
#
#compile-matrix-clang-simple:
# stage: compile
# trigger:
# include:
# - artifact: compile.yml
# job: matrix-clang-simple
# strategy: depend
#
#
#status-check:
# stage: status
# script:
# - echo "Wait for previous stages"
# dependencies:
# - compile-matrix-clang-simple
# - compile-matrix-gcc-simple
# - compile-matrix-pair
#
## nightly build
#matrix-gcc-simple-nightly:
# variables:
# PIC_INPUTS: "examples/Empty"
# GITLAB_BASES: ".base_gcc"
# CXX_VERSIONS: "g++-9"
# BOOST_VERSIONS: "1.65.1"
# PIC_ACCS: "omp2b"
# extends:
# - .base_generator
# - .base_nightly
#
#compile-matrix-gcc-simple-nightly:
# stage: compile
# trigger:
# include:
# - artifact: compile.yml
# job: matrix-gcc-simple-nightly
# strategy: depend
# extends:
# - .base_nightly
16 changes: 16 additions & 0 deletions share/ci/compiler_clang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
################################################################################
# [clang++-X] : X = {4.0, 5.0, 6.0, 7, 8, 9, 10}

.base_clang:
image: registry.gitlab.com/hzdr/crp/alpaka-group-container/alpaka-ci:clang
variables:
GIT_SUBMODULE_STRATEGY: normal
PIC_CMAKE_ARGS: "-DALPAKA_CUDA_COMPILER=clang"
script:
- apt update
- apt install -y curl
- $CI_PROJECT_DIR/share/ci/git_rebase.sh
- source share/ci/run_test.sh
# x86_64 tag is used to get a multi-core CPU for the tests
tags:
- x86_64
28 changes: 28 additions & 0 deletions share/ci/compiler_clang_cuda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
################################################################################
# [clang++-X] : X = {4.0, 5.0, 6.0, 7, 8, 9, 10}
# cuda9.2Clang is not supporting clang-7

.base_cuda_clang:
variables:
GIT_SUBMODULE_STRATEGY: normal
PIC_CMAKE_ARGS: "-DALPAKA_CUDA_COMPILER=clang"
script:
- apt update
- apt install -y curl
- $CI_PROJECT_DIR/share/ci/git_rebase.sh
- source share/ci/run_test.sh
tags:
- cuda
- x86_64

.base_clangCuda_cuda_9.2:
image: registry.gitlab.com/hzdr/crp/alpaka-group-container/alpaka-ci:cuda9.2Clang
extends: .base_cuda_clang

.base_clangCuda_cuda_10.0:
image: registry.gitlab.com/hzdr/crp/alpaka-group-container/alpaka-ci:cuda10.0Clang
extends: .base_cuda_clang

.base_clangCuda_cuda_10.1:
image: registry.gitlab.com/hzdr/crp/alpaka-group-container/alpaka-ci:cuda10.1Clang
extends: .base_cuda_clang
15 changes: 15 additions & 0 deletions share/ci/compiler_gcc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
################################################################################
# [g++-X] : X = {5, 6, 7, 8, 9}

.base_gcc:
image: registry.gitlab.com/hzdr/crp/alpaka-group-container/alpaka-ci:gcc
variables:
GIT_SUBMODULE_STRATEGY: normal
script:
- apt update
- apt install -y curl
- $CI_PROJECT_DIR/share/ci/git_rebase.sh
- source share/ci/run_test.sh
# x86_64 tag is used to get a multi-core CPU for the tests
tags:
- x86_64
33 changes: 33 additions & 0 deletions share/ci/compiler_nvcc_cuda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
################################################################################
# [g++-X] : X = {5, 6, 7, 8, 9}

.base_nvcc:
variables:
GIT_SUBMODULE_STRATEGY: normal
before_script:
- nvidia-smi
- nvcc --version
script:
- apt update
- apt install -y curl
- $CI_PROJECT_DIR/share/ci/git_rebase.sh
- source share/ci/run_test.sh
tags:
- cuda
- x86_64

.base_nvcc_cuda_9.2:
image: registry.gitlab.com/hzdr/crp/alpaka-group-container/alpaka-ci:cuda9.2gcc
extends: .base_nvcc

.base_nvcc_cuda_10.0:
image: registry.gitlab.com/hzdr/crp/alpaka-group-container/alpaka-ci:cuda10.0gcc
extends: .base_nvcc

.base_nvcc_cuda_10.1:
image: registry.gitlab.com/hzdr/crp/alpaka-group-container/alpaka-ci:cuda10.1gcc
extends: .base_nvcc

.base_nvcc_cuda_10.2:
image: registry.gitlab.com/hzdr/crp/alpaka-group-container/alpaka-ci:cuda10.2gcc
extends: .base_nvcc
38 changes: 38 additions & 0 deletions share/ci/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

set -e
set -o pipefail

# generate a job matrix based on the environment variable lists (space separated)
# variables: GITLAB_BASES CXX_VERSIONS BOOST_VERSIONS PIC_INPUTS PIC_ACCS

export picongpu_DIR=$CI_PROJECT_DIR
cd $picongpu_DIR/share/picongpu/

echo "include:"
echo " - local: '/share/ci/compiler_clang.yml'"
echo " - local: '/share/ci/compiler_gcc.yml'"
echo " - local: '/share/ci/compiler_nvcc_cuda.yml'"
echo " - local: '/share/ci/compiler_clang_cuda.yml'"
echo ""

for base_job in $GITLAB_BASES; do
for CXX_VERSION in $CXX_VERSIONS; do
for BOOST_VERSION in ${BOOST_VERSIONS}; do
for CASE in ${PIC_INPUTS}; do
for ACC in ${PIC_ACCS}; do
test_case_folder=$CASE
job_name="${CXX_VERSION}_${ACC}_${BOOST_VERSION}_$(echo $test_case_folder | tr '/' '.')"
echo "${job_name}:"
echo " variables:"
echo " PIC_TEST_CASE_FOLDER: \"${test_case_folder}\""
echo " CXX_VERSION: \"${CXX_VERSION}\""
echo " PIC_BACKEND: \"${ACC}\""
echo " BOOST_VERSION: \"${BOOST_VERSION}\""
echo " extends: $base_job"
echo ""
done
done
done
done
done
43 changes: 43 additions & 0 deletions share/ci/generate_pairwise.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash

set -e
set -o pipefail

# generate a job matrix based on the environment variable lists (space separated)
# variables: PIC_INPUTS

export PATH=$CI_PROJECT_DIR/share/ci:$PATH
export picongpu_DIR=$CI_PROJECT_DIR

cd $picongpu_DIR/share/picongpu/

echo "include:"
echo " - local: '/share/ci/compiler_clang.yml'"
echo " - local: '/share/ci/compiler_gcc.yml'"
echo " - local: '/share/ci/compiler_nvcc_cuda.yml'"
echo " - local: '/share/ci/compiler_clang_cuda.yml'"
echo ""
echo "stages:"
echo " - test"
echo " - wait"
echo ""

folders=()
for CASE in ${PIC_INPUTS}; do
if [ "$CASE" == "examples" ] || [ "$CASE" == "tests" ] ; then
all_cases=$(find ${CASE}/* -maxdepth 0 -type d)
else
all_cases=$(find $CASE -maxdepth 0 -type d)
fi
for test_case_folder in $all_cases ; do
folders+=($test_case_folder)
done
done

echo "${folders[@]}" | tr " " "\n" | pair_generator.py $@
echo ""
echo "finish_downstream_pipeline:"
echo " stage: wait"
echo " script:"
echo " - env"
echo ""
Loading