Skip to content

Commit

Permalink
Backport PR coq#17246: Tagged runner system
Browse files Browse the repository at this point in the history
  • Loading branch information
Zimmi48 committed Mar 31, 2023
2 parents 686e934 + ee1760a commit cbd4daf
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ include:
rules:
- if: $CI_COMMIT_BRANCH != "master" && $CI_COMMIT_BRANCH !~ /^v.*\..*$/

- local: "/dev/ci/gitlab-modes/tagged-runners.yml"
rules:
- if: $TAGGED_RUNNERS

- local: "/dev/ci/gitlab-modes/untagged-runners.yml"
rules:
- if: $TAGGED_RUNNERS == null

- local: '/dev/bench/gitlab-bench.yml'

stages:
Expand Down Expand Up @@ -55,6 +63,7 @@ before_script:
.build-template:
stage: build
interruptible: true
extends: .auto-use-tags
variables:
COQIDE: "opt"
artifacts:
Expand Down Expand Up @@ -92,6 +101,7 @@ before_script:
.build-template:dev:
stage: build
interruptible: true
extends: .auto-use-tags
script:
# flambda can be pretty stack hungry, specially with -O3
# See also https://github.com/ocaml/ocaml/issues/7842#issuecomment-596863244
Expand All @@ -117,6 +127,7 @@ before_script:
.dev-ci-template:
stage: build
interruptible: true
extends: .auto-use-tags
needs:
- build:edge+flambda:dev
script:
Expand All @@ -139,6 +150,7 @@ before_script:
.test-suite-template:
stage: build
interruptible: true
extends: .auto-use-tags
needs:
- not-a-real-job
script:
Expand All @@ -161,6 +173,7 @@ before_script:
.validate-template:
stage: build
interruptible: true
extends: .auto-use-tags
needs:
- not-a-real-job
script:
Expand All @@ -183,6 +196,7 @@ before_script:
.ci-template:
stage: build
interruptible: true
extends: .auto-use-tags
script:
- ulimit -S -s 16384 # For flambda + native
- make -f Makefile.ci -j "$NJOBS" "${CI_JOB_NAME#*:}"
Expand All @@ -207,6 +221,7 @@ before_script:

.deploy-template:
stage: deploy
extends: .auto-use-tags
before_script:
- which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
- eval $(ssh-agent -s)
Expand All @@ -219,6 +234,7 @@ before_script:
.pkg:opam-template:
stage: build
interruptible: true
extends: .auto-use-tags
# OPAM will build out-of-tree so no point in importing artifacts
script:
- opam pin add --kind=path coq-core.dev .
Expand All @@ -235,6 +251,7 @@ before_script:
needs: []
interruptible: true
image: nixos/nix:latest
extends: .auto-use-tags
variables:
GIT_STRATEGY: none # Required because we don't have git
USER: root # Variable required by Cachix
Expand Down Expand Up @@ -345,6 +362,7 @@ build:vio:
lint:
stage: build
script: dev/lint-repository.sh
extends: .auto-use-tags
variables:
GIT_DEPTH: "" # we need an unknown amount of history for per-commit linting
OPAM_SWITCH: "edge"
Expand Down Expand Up @@ -493,6 +511,7 @@ test-suite:edge+flambda:
test-suite:edge:dev:
stage: build
interruptible: true
extends: .auto-use-tags
needs:
- build:edge+flambda:dev
script:
Expand Down Expand Up @@ -847,6 +866,7 @@ plugin:ci-perennial:
plugin:plugin-tutorial:
stage: build
interruptible: true
extends: .auto-use-tags
script:
- ./configure -prefix "$(pwd)/_install_ci" -warn-error yes
- make -j "$NJOBS" plugin-tutorial
Expand Down
2 changes: 2 additions & 0 deletions dev/ci/gitlab-modes/normal-mode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
default:
interruptible: true
timeout: 1h
tags:
- not-a-real-tag
2 changes: 2 additions & 0 deletions dev/ci/gitlab-modes/protected-mode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
default:
interruptible: false
timeout: 1h
tags:
- not-a-real-tag
3 changes: 3 additions & 0 deletions dev/ci/gitlab-modes/tagged-runners.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.auto-use-tags:
tags:
- $TAGGED_RUNNERS
2 changes: 2 additions & 0 deletions dev/ci/gitlab-modes/untagged-runners.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.auto-use-tags:
tags: []

0 comments on commit cbd4daf

Please sign in to comment.