From patchwork Wed Jun 1 18:05:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 577814 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:8f0c:0:0:0:0 with SMTP id mq12csp853701mab; Wed, 1 Jun 2022 11:24:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOy+OqLMA+HAlFFxCXLpGBneUBrsYdn4j2gzkPfQtHkgJQ4fSAU9vbp+KWqbeNukTYyGOP X-Received: by 2002:ad4:5d4b:0:b0:464:6c5d:f525 with SMTP id jk11-20020ad45d4b000000b004646c5df525mr3694941qvb.122.1654107850112; Wed, 01 Jun 2022 11:24:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654107850; cv=none; d=google.com; s=arc-20160816; b=glxVQtJzyQtCgCU+oJq4TBRoF7Mzy8K/NPLQIhJoRfYCvXW45qulZWvNLI6b5yA56j xiuKAXYKb8oQkuqB6Jtct9tZ/SqLI5cyz4kuyDP43nGi9djbup4NZ7SeWqY5YR2K/jnz pKMxHRfbBIG1U0U3WQ0dnFYtrjBfS3pqYMYymaAmVcf1M/lWx8TBGqulk1vdmUxvdkQ0 HwGi/kv9Xw4xvR0Qv41/moBEF9Na7ms8eqf3U4opf84mESfh8ArJUbGrnhKhbmpARUrj 3ZAfHo53Zdzbp1w3JIZTZUU6xJR00LQJd9oYRk4+AWCjCjGvAqBcmi104mkWxZN3uSZ3 M3NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9ZI6PLSlRMEqMQdx3EhC/9GDtUUl7MXmj9n2SWhz5Ng=; b=ll39sLea+oqjuzkucAiPkV3SdAJbqpZbDjQlC2duRpCTX158c5L7VqS7djJfU2uNph I5e1sGxxn++eGVWndmuz0yXeFBZzdQNNgdu01DNpBJ/BorM3Hp38M8zhMvZ7PI4fKQCz nz9CKu4j6WPcFQBoAEqOTf99ak/EFUSrOcyMDTjkP6NKFBd4eIYbFlsnqrC7R3GX+ET3 F5asRmiG3qGWk59Bl/GDxnbX/zltNIYUpW5JT6xHS7nsdfoJcxcOJrl229989k1pocah +N7UZaOaYTk63OyNze9tlYaWfzL9+KbybzU0AoJvSjwyy0dg5x8uMDohRkBoOp1MFD2C CxEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=E8vuohhh; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id hu2-20020a056214234200b00461eff5f9b8si1143207qvb.250.2022.06.01.11.24.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Jun 2022 11:24:10 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=E8vuohhh; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nwT0r-0003DY-Le for patch@linaro.org; Wed, 01 Jun 2022 14:24:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52742) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nwSr7-0001k9-5n for qemu-devel@nongnu.org; Wed, 01 Jun 2022 14:14:05 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]:33667) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nwSr4-0006Yw-4U for qemu-devel@nongnu.org; Wed, 01 Jun 2022 14:14:04 -0400 Received: by mail-ed1-x530.google.com with SMTP id h19so3338607edj.0 for ; Wed, 01 Jun 2022 11:14:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9ZI6PLSlRMEqMQdx3EhC/9GDtUUl7MXmj9n2SWhz5Ng=; b=E8vuohhhmAy7a2UNMUOrrfeqyyYV/Jg84aEk/WjGE+ZbcbK1oWGJ4I0xVWlnbV5oI1 1eiAItuSUR6LCf1IaWjUPzcMY0K/rgzCqyXJdxs5fe6fiDg1JrHiE5g3Twb6FKrhlRWp UvmU4GGErrhfTgNrgnVvKRdqtYhN4+d9mgT8widtsHYZw2n8iRzn8MJ+1PH3vF+EZUBA /sJX5AMgKNfAyIVjC+5mnyNvLxDXdplcE+e91zFpiEsd2Kff85qCDITB5Me2VSiKlrHP LmRnLvbdatJTn/OSQzEqwTSh9ImjFZR6FxRbfi9RU44gOXplkQtHKUCdJjJCfqj3La+U j9Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9ZI6PLSlRMEqMQdx3EhC/9GDtUUl7MXmj9n2SWhz5Ng=; b=x9a5cR/iymXJSqOSF5XvWUAzRLm0dxPRpWWF9ZAM3iVCU5LvJ6lDdween126vp9Sqc v00BeVnu1oY3Or5sP44YWlv1Q4GAMMTEUW6B8/5Dn4+ip1UbZV228kv+gWJHMVNYTNsV FHwvgdCkH4Keubl1vqJokdhCNo79T5Em0S2AHkk7+njKwNLvvuwqqfcy535p8KSBkuPf OXf8CJKXNGjdxXuZfWunHmZq25Gs7DNLY/GXpTga4HrKbnytpd0P0bRbThvhNuViMg2e A7KWJOgv0jGEtn0/IzKBVMPp2bUQPw4kh3BTIjNX1sb9e5LqZUswXaSMuoxWsX2NLHFh 0HFw== X-Gm-Message-State: AOAM531wGXMw8eXFkvfN+swfvgB/LAJXBv+8h12Smesf7Vzoel0mP4+i 39N7dcF4JK35vXF6/IQO/LL8cg== X-Received: by 2002:a50:9b11:0:b0:42a:c1b2:b2ca with SMTP id o17-20020a509b11000000b0042ac1b2b2camr1027447edi.313.1654107240650; Wed, 01 Jun 2022 11:14:00 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a8-20020a170906368800b006f4c557b7d2sm957712ejc.203.2022.06.01.11.13.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 11:13:57 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 621D71FFD3; Wed, 1 Jun 2022 19:05:40 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, richard.henderson@linaro.org Cc: qemu-devel@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PULL 28/33] gitlab: introduce a common base job template Date: Wed, 1 Jun 2022 19:05:32 +0100 Message-Id: <20220601180537.2329566-29-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220601180537.2329566-1-alex.bennee@linaro.org> References: <20220601180537.2329566-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x530.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Daniel P. Berrangé Currently job rules are spread across the various templates and jobs, making it hard to understand exactly what runs in what scenario. This leads to inconsistency in the rules and increased maint burden. The intent is that we introduce a common '.base_job_template' which will have a general purpose 'rules:' block. No other template or job should define 'rules:', but instead they must rely on the inherited rules. To allow behaviour to be tweaked, rules will be influenced by a number of variables with the naming scheme 'QEMU_JOB_nnnn'. Signed-off-by: Daniel P. Berrangé Message-Id: <20220526110705.59952-2-berrange@redhat.com> Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth Message-Id: <20220527153603.887929-29-alex.bennee@linaro.org> diff --git a/docs/devel/ci-jobs.rst.inc b/docs/devel/ci-jobs.rst.inc index 92e25872aa..eb6a9e6122 100644 --- a/docs/devel/ci-jobs.rst.inc +++ b/docs/devel/ci-jobs.rst.inc @@ -28,7 +28,35 @@ For further information about how to set these variables, please refer to:: https://docs.gitlab.com/ee/user/project/push_options.html#push-options-for-gitlab-cicd -Here is a list of the most used variables: +Variable naming and grouping +---------------------------- + +The variables used by QEMU's CI configuration are grouped together +in a handful of namespaces + + * QEMU_JOB_nnnn - variables to be defined in individual jobs + or templates, to influence the shared rules defined in the + .base_job_template. + + * QEMU_CI_nnn - variables to be set by contributors in their + repository CI settings, or as git push variables, to influence + which jobs get run in a pipeline + + * nnn - other misc variables not falling into the above + categories, or using different names for historical reasons + and not yet converted. + +Maintainer controlled job variables +----------------------------------- + +The following variables may be set when defining a job in the +CI configuration file. + +Contributor controlled runtime variables +---------------------------------------- + +The following variables may be set by contributors to control +job execution QEMU_CI_AVOCADO_TESTING ~~~~~~~~~~~~~~~~~~~~~~~ @@ -38,6 +66,12 @@ these artifacts are not already cached, downloading them make the jobs reach the timeout limit). Set this variable to have the tests using the Avocado framework run automatically. +Other misc variables +-------------------- + +These variables are primarily to control execution of jobs on +private runners + AARCH64_RUNNER_AVAILABLE ~~~~~~~~~~~~~~~~~~~~~~~~ If you've got access to an aarch64 host that can be used as a gitlab-CI diff --git a/.gitlab-ci.d/base.yml b/.gitlab-ci.d/base.yml new file mode 100644 index 0000000000..10eb6ab8bc --- /dev/null +++ b/.gitlab-ci.d/base.yml @@ -0,0 +1,28 @@ + +# The order of rules defined here is critically important. +# They are evaluated in order and first match wins. +# +# Thus we group them into a number of stages, ordered from +# most restrictive to least restrictive +# +.base_job_template: + rules: + ############################################################# + # Stage 1: exclude scenarios where we definitely don't + # want jobs to run + ############################################################# + + + ############################################################# + # Stage 2: fine tune execution of jobs in specific scenarios + # where the catch all logic is inapprorpaite + ############################################################# + + + ############################################################# + # Stage 3: catch all logic applying to any job not matching + # an earlier criteria + ############################################################# + + # Jobs can run if any jobs they depend on were successfull + - when: on_success diff --git a/.gitlab-ci.d/qemu-project.yml b/.gitlab-ci.d/qemu-project.yml index 871262fe0e..691d9bf5dc 100644 --- a/.gitlab-ci.d/qemu-project.yml +++ b/.gitlab-ci.d/qemu-project.yml @@ -2,6 +2,7 @@ # https://gitlab.com/qemu-project/qemu/-/pipelines include: + - local: '/.gitlab-ci.d/base.yml' - local: '/.gitlab-ci.d/stages.yml' - local: '/.gitlab-ci.d/edk2.yml' - local: '/.gitlab-ci.d/opensbi.yml'