From 85a2d213876757a06f9eaf63ce2489fbe16c3652 Mon Sep 17 00:00:00 2001 From: Lukas Werner <lks.werner@fau.de> Date: Mon, 16 Aug 2021 09:43:10 +0200 Subject: [PATCH] Added some same .yml files to documentation --- documentation/README.md | 182 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 182 insertions(+) diff --git a/documentation/README.md b/documentation/README.md index 751a261..6ed3716 100644 --- a/documentation/README.md +++ b/documentation/README.md @@ -73,3 +73,185 @@ It contains the build and execution directories and files for your CI jobs. It may happen that your CI job fails if the node is occupied with other jobs for more than 24 hours. In that case, simply restart the CI job. +## Sample `.gitlab-ci.yml` files + +### Build on default node (phinally) with default time limit (120 mins.) + +```yaml +stages: + - build + - test + +build: + stage: build + script: + - export NUM_CORES=$(nproc --all) + - mkdir $CI_PROJECT_DIR/build + - cd $CI_PROJECT_DIR/build + - cmake .. + - make -j $NUM_CORES + tags: + - testcluster + artifacts: + paths: + - build + +test: + stage: test + variables: + SLURM_TIMELIMIT: 30 + script: + - cd $CI_PROJECT_DIR/build + - ./test + tags: + - testcluster +``` + +### Build on default node with default time limit, enable LIKWID (hwperf) and run one job on frontend + +```yaml +variables: + SLURM_CONSTRAINT: "hwperf" + +stages: + - prepare + - build + - test + +prepare: + stage: prepare + script: + - echo "Preparing on frontend node..." + variables: + NO_SLURM_SUBMIT: 1 + tags: + - testcluster + +build: + stage: build + script: + - export NUM_CORES=$(nproc --all) + - mkdir $CI_PROJECT_DIR/build + - cd $CI_PROJECT_DIR/build + - cmake .. + - make -j $NUM_CORES + tags: + - testcluster + artifacts: + paths: + - build + +test: + stage: test + variables: + SLURM_TIMELIMIT: 30 + script: + - cd $CI_PROJECT_DIR/build + - ./test + tags: + - testcluster +``` + +### Build and test stage on a specific node and use a custom default time limit + +```yaml +variables: + SLURM_NODELIST: broadep2 + SLURM_TIMELIMIT: 10 + +stages: + - build + - test + +build: + stage: build + script: + - export NUM_CORES=$(nproc --all) + - mkdir $CI_PROJECT_DIR/build + - cd $CI_PROJECT_DIR/build + - cmake .. + - make -j $NUM_CORES + tags: + - testcluster + artifacts: + paths: + - build + +test: + stage: test + variables: + SLURM_TIMELIMIT: 30 + script: + - cd $CI_PROJECT_DIR/build + - ./test + tags: + - testcluster + +``` + +### Build and benchmark on multiple nodes + + +```yaml +stages: + - build + - benchmark + +.build: + stage: build + script: + - export NUM_CORES=$(nproc --all) + - mkdir $CI_PROJECT_DIR/build + - cd $CI_PROJECT_DIR/build + - cmake .. + - make -j $NUM_CORES + tags: + - testcluster + variables: + SLURM_TIMELIMIT: 10 + artifacts: + paths: + - build + +.benchmark: + stage: benchmark + variables: + SLURM_TIMELIMIT: 20 + script: + - cd $CI_PROJECT_DIR/build + - ./benchmark + tags: + - testcluster + +# broadep2 + +build-broadep2: + extends: .build + variables: + SLURM_NODELIST: broadep2 + +benchmark-broadep2: + extends: .benchmark + dependencies: + - build-broadep2 + variables: + SLURM_NODELIST: broadep2 + +# naples1 + +build-naples1: + extends: .build + variables: + SLURM_NODELIST: naples1 + +benchmark-naples1: + extends: .benchmark + dependencies: + - build-naples1 + variables: + SLURM_NODELIST: naples1 + + +``` + + -- GitLab