From 34dee52d177d0fe829dc3f499bfb99d89aacdb4b Mon Sep 17 00:00:00 2001 From: Killian Delarue Date: Wed, 2 Apr 2025 11:00:12 +0200 Subject: [PATCH 1/4] Grafazos, CI: Rename [grafazos_ci.ml] to [common.ml] --- ci/bin/code_verification.ml | 9 ++++++--- ci/bin/release_tag.ml | 2 +- grafazos/ci/{grafazos_ci.ml => common.ml} | 0 3 files changed, 7 insertions(+), 4 deletions(-) rename grafazos/ci/{grafazos_ci.ml => common.ml} (100%) diff --git a/ci/bin/code_verification.ml b/ci/bin/code_verification.ml index e112e360a6e9..d1a35d456cb1 100644 --- a/ci/bin/code_verification.ml +++ b/ci/bin/code_verification.ml @@ -826,18 +826,21 @@ let jobs pipeline_type = let job_build_grafazos = match pipeline_type with | Merge_train | Before_merging -> - Grafazos_ci.job_build_grafazos + Grafazos_ci.Common.job_build_grafazos ~rules: [ job_rule ~when_:Always - ~changes:(Changeset.encode Grafazos_ci.changeset_grafazos) + ~changes: + (Changeset.encode Grafazos_ci.Common.changeset_grafazos) (); job_rule ~when_:Manual (); ] () | Schedule_extended_test -> - Grafazos_ci.job_build_grafazos ~rules:[job_rule ~when_:Always ()] () + Grafazos_ci.Common.job_build_grafazos + ~rules:[job_rule ~when_:Always ()] + () in let job_build_teztale ~arch = Teztale.job_build diff --git a/ci/bin/release_tag.ml b/ci/bin/release_tag.ml index 16d6d8080ea3..33e9aadc4128 100644 --- a/ci/bin/release_tag.ml +++ b/ci/bin/release_tag.ml @@ -50,7 +50,7 @@ let monitoring_child_pipeline = ~jobs: [ job_datadog_pipeline_trace; - Grafazos_ci.job_build_grafazos (); + Grafazos_ci.Common.job_build_grafazos (); job_build_layer1_profiling ~expire_in:Never (); Teztale.job_build ~expire_in:Never ~arch:Arm64 (); Teztale.job_build ~expire_in:Never ~arch:Amd64 (); diff --git a/grafazos/ci/grafazos_ci.ml b/grafazos/ci/common.ml similarity index 100% rename from grafazos/ci/grafazos_ci.ml rename to grafazos/ci/common.ml -- GitLab From 2dcd8d2e57d3e3575bb7080398933caa7ebb94f0 Mon Sep 17 00:00:00 2001 From: Killian Delarue Date: Thu, 27 Mar 2025 14:25:20 +0100 Subject: [PATCH 2/4] Grafazos, Releases: Create [release.ml] file and [jobs] --- grafazos/ci/release.ml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 grafazos/ci/release.ml diff --git a/grafazos/ci/release.ml b/grafazos/ci/release.ml new file mode 100644 index 000000000000..c51cdb01d5d1 --- /dev/null +++ b/grafazos/ci/release.ml @@ -0,0 +1,8 @@ +(*****************************************************************************) +(* *) +(* SPDX-License-Identifier: MIT *) +(* Copyright (c) 2025 Nomadic Labs. *) +(* *) +(*****************************************************************************) + +let jobs = [Common.job_build_grafazos ()] -- GitLab From a5f5673b0991977a270ffd8db46abc75477912bb Mon Sep 17 00:00:00 2001 From: Killian Delarue Date: Wed, 2 Apr 2025 10:58:02 +0200 Subject: [PATCH 3/4] CI: Grafazos test release pipeline --- .gitlab-ci.yml | 14 ++++++ .../pipelines/grafazos_release_tag_test.yml | 46 +++++++++++++++++++ ci/bin/main.ml | 16 ++++++- 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 .gitlab/ci/pipelines/grafazos_release_tag_test.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8e237fccdfc9..9e2cc7441742 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -51,6 +51,11 @@ workflow: variables: PIPELINE_TYPE: octez_release_tag_test when: always + - if: $CI_PROJECT_NAMESPACE != "tezos" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG + =~ /^grafazos-v\d+\.\d+$/ + variables: + PIPELINE_TYPE: grafazos_release_tag_test + when: always - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^octez-evm-node-v\d+\.\d+(?:\-rc\d+)?$/ variables: PIPELINE_TYPE: octez_evm_node_release_tag @@ -58,12 +63,14 @@ workflow: - if: $CI_PROJECT_NAMESPACE == "tezos" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG != null && $CI_COMMIT_TAG !~ /^octez-v\d+\.\d+(?:\-rc\d+)?$/ && $CI_COMMIT_TAG !~ /^octez-v\d+\.\d+\-beta\d*$/ && $CI_COMMIT_TAG !~ /^octez-evm-node-v\d+\.\d+(?:\-rc\d+)?$/ + && $CI_COMMIT_TAG !~ /^grafazos-v\d+\.\d+$/ variables: PIPELINE_TYPE: non_release_tag when: always - if: $CI_PROJECT_NAMESPACE != "tezos" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG != null && $CI_COMMIT_TAG !~ /^octez-v\d+\.\d+(?:\-rc\d+)?$/ && $CI_COMMIT_TAG !~ /^octez-v\d+\.\d+\-beta\d*$/ && $CI_COMMIT_TAG !~ /^octez-evm-node-v\d+\.\d+(?:\-rc\d+)?$/ + && $CI_COMMIT_TAG !~ /^grafazos-v\d+\.\d+$/ variables: PIPELINE_TYPE: non_release_tag_test when: always @@ -185,6 +192,11 @@ include: - if: $CI_PROJECT_NAMESPACE != "tezos" && $CI_PIPELINE_SOURCE == "push" && ($CI_COMMIT_TAG =~ /^octez-v\d+\.\d+(?:\-rc\d+)?$/ || $CI_COMMIT_TAG =~ /^octez-v\d+\.\d+\-beta\d*$/) when: always +- local: .gitlab/ci/pipelines/grafazos_release_tag_test.yml + rules: + - if: $CI_PROJECT_NAMESPACE != "tezos" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG + =~ /^grafazos-v\d+\.\d+$/ + when: always - local: .gitlab/ci/pipelines/octez_evm_node_release_tag.yml rules: - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^octez-evm-node-v\d+\.\d+(?:\-rc\d+)?$/ @@ -194,12 +206,14 @@ include: - if: $CI_PROJECT_NAMESPACE == "tezos" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG != null && $CI_COMMIT_TAG !~ /^octez-v\d+\.\d+(?:\-rc\d+)?$/ && $CI_COMMIT_TAG !~ /^octez-v\d+\.\d+\-beta\d*$/ && $CI_COMMIT_TAG !~ /^octez-evm-node-v\d+\.\d+(?:\-rc\d+)?$/ + && $CI_COMMIT_TAG !~ /^grafazos-v\d+\.\d+$/ when: always - local: .gitlab/ci/pipelines/non_release_tag_test.yml rules: - if: $CI_PROJECT_NAMESPACE != "tezos" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG != null && $CI_COMMIT_TAG !~ /^octez-v\d+\.\d+(?:\-rc\d+)?$/ && $CI_COMMIT_TAG !~ /^octez-v\d+\.\d+\-beta\d*$/ && $CI_COMMIT_TAG !~ /^octez-evm-node-v\d+\.\d+(?:\-rc\d+)?$/ + && $CI_COMMIT_TAG !~ /^grafazos-v\d+\.\d+$/ when: always - local: .gitlab/ci/pipelines/schedule_extended_test.yml rules: diff --git a/.gitlab/ci/pipelines/grafazos_release_tag_test.yml b/.gitlab/ci/pipelines/grafazos_release_tag_test.yml new file mode 100644 index 000000000000..dffc9517e94d --- /dev/null +++ b/.gitlab/ci/pipelines/grafazos_release_tag_test.yml @@ -0,0 +1,46 @@ +# This file was automatically generated, do not edit. +# Edit file ci/bin/main.ml instead. + +stages: +- images +- build + +oc.docker:jsonnet:amd64: + image: ${GCP_REGISTRY}/tezos/docker-images/ci-docker:v1.12.0 + stage: images + tags: + - gcp + dependencies: [] + timeout: 60 minutes + before_script: + - ./scripts/ci/docker_initialize.sh + script: + - ./scripts/ci/docker_jsonnet_build.sh + services: + - docker:${DOCKER_VERSION}-dind + variables: + DOCKER_VERSION: 24.0.7 + CI_DOCKER_HUB: "false" + artifacts: + reports: + dotenv: jsonnet_image_tag.env + +build_grafazos_dashboards: + image: ${jsonnet_image_name}:${jsonnet_image_tag} + stage: build + tags: + - gcp + dependencies: + - oc.docker:jsonnet:amd64 + timeout: 60 minutes + before_script: + - cd grafazos/ + - jb install github.com/grafana/grafonnet/gen/grafonnet-v11.1.0@1ce5aec + script: + - make + artifacts: + name: grafazos-dashboards + expire_in: 1 day + paths: + - grafazos/output/**/*.json + when: on_success diff --git a/ci/bin/main.ml b/ci/bin/main.ml index ba241730a219..88fc28024c9e 100644 --- a/ci/bin/main.ml +++ b/ci/bin/main.ml @@ -144,6 +144,8 @@ let () = let octez_evm_node_release_tag_re = "/^octez-evm-node-v\\d+\\.\\d+(?:\\-rc\\d+)?$/" in + (* Matches Grafazos release tags, e.g. [grafazos-v1.2]. *) + let grafazos_release_tag_re = "/^grafazos-v\\d+\\.\\d+$/" in let open Rules in let open Pipeline in (* Matches either Octez release tags or Octez beta release tags, @@ -157,7 +159,8 @@ let () = If.( Predefined_vars.ci_commit_tag != null && (not has_any_octez_release_tag) - && not (has_tag_match octez_evm_node_release_tag_re)) + && (not (has_tag_match octez_evm_node_release_tag_re)) + && not (has_tag_match grafazos_release_tag_re)) in let release_description = "\n\n\ @@ -222,6 +225,17 @@ let () = intended, without publishing any release. Developers or release \ managers can create this pipeline by pushing a tag to a fork of \ 'tezos/tezos', e.g. to the 'nomadic-labs/tezos' project." ; + (* TODO: We should be able to register this pipeline in [grafazos/ci]. *) + register + "grafazos_release_tag_test" + If.(not_on_tezos_namespace && push && has_tag_match grafazos_release_tag_re) + ~jobs:Grafazos_ci.Release.jobs + ~description: + "Test release pipeline for Grafazos.\n\n\ + This pipeline checks that 'grafazos_release_tag' pipelines work as \ + intended, without publishing any release. Developers or release \ + managers can create this pipeline by pushing a tag to a fork of \ + 'tezos/tezos', e.g. to the 'nomadic-labs/tezos' project." ; register "octez_evm_node_release_tag" If.(push && has_tag_match octez_evm_node_release_tag_re) -- GitLab From 630aec88706ed790fad0513433516dfcb1239a06 Mon Sep 17 00:00:00 2001 From: Killian Delarue Date: Thu, 3 Apr 2025 10:28:27 +0200 Subject: [PATCH 4/4] Grafazos, Releases: Add [datadog_pipeline_trace] to release pipeline --- ci/bin/main.ml | 2 +- grafazos/ci/release.ml | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ci/bin/main.ml b/ci/bin/main.ml index 88fc28024c9e..64fc03267b6b 100644 --- a/ci/bin/main.ml +++ b/ci/bin/main.ml @@ -229,7 +229,7 @@ let () = register "grafazos_release_tag_test" If.(not_on_tezos_namespace && push && has_tag_match grafazos_release_tag_re) - ~jobs:Grafazos_ci.Release.jobs + ~jobs:(Grafazos_ci.Release.jobs ~test:true ()) ~description: "Test release pipeline for Grafazos.\n\n\ This pipeline checks that 'grafazos_release_tag' pipelines work as \ diff --git a/grafazos/ci/release.ml b/grafazos/ci/release.ml index c51cdb01d5d1..7fa88a674326 100644 --- a/grafazos/ci/release.ml +++ b/grafazos/ci/release.ml @@ -5,4 +5,22 @@ (* *) (*****************************************************************************) -let jobs = [Common.job_build_grafazos ()] +open Tezos_ci + +let job_datadog_pipeline_trace : tezos_job = + job + ~__POS__ + ~allow_failure:Yes + ~name:"datadog_pipeline_trace" + ~image:Images.datadog_ci + ~before_script:[". ./scripts/ci/datadog_send_job_info.sh"] + ~stage:Stages.start + [ + "CI_MERGE_REQUEST_IID=${CI_MERGE_REQUEST_IID:-none}"; + "DATADOG_SITE=datadoghq.eu datadog-ci tag --level pipeline --tags \ + pipeline_type:$PIPELINE_TYPE --tags mr_number:$CI_MERGE_REQUEST_IID"; + ] + +let jobs ~test () = + (if test then [] else [job_datadog_pipeline_trace]) + @ [Common.job_build_grafazos ()] -- GitLab