From fc024290f079d6dab5bbe0bed398d06d3b5b245f Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Fri, 30 Sep 2022 15:42:07 +0300 Subject: [PATCH 1/2] Makes merge request pipeline interruptible --- .gitlab-ci.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cbd61ad2dc..55d795dbe4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,6 +7,8 @@ variables: OUT_FORMATS_SCENE_BASED: "FOA HOA2 HOA3" OUT_FORMATS_BINAURAL: "BINAURAL BINAURAL_ROOM" +default: + interruptible: true # Make all jobs by default interruptible # This sets when pipelines are created. Jobs have more specific rules to restrict them. workflow: @@ -19,6 +21,7 @@ workflow: - if: $CI_PIPELINE_SOURCE == 'schedule' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Scheduled in main stages: + - .pre - maintenance - build - test @@ -105,6 +108,28 @@ stages: - 123 + +# --------------------------------------------------------------- +# .pre jobs for setting up things +# --------------------------------------------------------------- + +# See: https://gitlab.com/gitlab-org/gitlab/-/issues/194023 +# Solution to make main branch pipelines uninterruptible while all other +# pipelines can be interrupted by default. This works because all jobs +# after uninterruptible jobs will be uninterruptible. Resource group +# setting avoids rare case where two fast merges could still interrupt +# pipeline. This should be revisited if there are updates to Gitlab. +uninterruptible: + stage: .pre + interruptible: false + resource_group: uninterruptible + script: + - echo "$CI_COMMIT_BRANCH is uninterruptible" + rules: + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + when: always + + # --------------------------------------------------------------- # Build jobs # --------------------------------------------------------------- -- GitLab From dec03d7f592d9f6abd4dc7fc67cc9fb9166e14f0 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Wed, 7 Dec 2022 12:37:46 +0000 Subject: [PATCH 2/2] Adds missing tag for the uninterruptible .pre job. --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 55d795dbe4..e834831d51 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -128,6 +128,9 @@ uninterruptible: rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH when: always + tags: + - ivas-linux + # --------------------------------------------------------------- -- GitLab