From f00bca13ea0e8e24e084edbdc4795367d60438ed Mon Sep 17 00:00:00 2001 From: Pietro Abate Date: Fri, 7 Jun 2024 10:07:17 +0200 Subject: [PATCH 1/5] tests: remove redundant compilation tests --- .gitlab/ci/pipelines/before_merging.yml | 47 +---------------- .../ci/pipelines/schedule_extended_test.yml | 24 ++------- ci/bin/code_verification.ml | 52 ++++++++++++------- ci/bin/common.ml | 4 +- 4 files changed, 40 insertions(+), 87 deletions(-) diff --git a/.gitlab/ci/pipelines/before_merging.yml b/.gitlab/ci/pipelines/before_merging.yml index 4fd80535c231..49e94e778239 100644 --- a/.gitlab/ci/pipelines/before_merging.yml +++ b/.gitlab/ci/pipelines/before_merging.yml @@ -2629,51 +2629,8 @@ oc.install_opam_jammy: variables: OPAMJOBS: "4" -oc.compile_release_sources_bullseye: - image: ocaml/opam:debian-11 - stage: test - tags: - - gcp - rules: - - changes: - - docs/introduction/compile*.sh - - docs/introduction/install*.sh - when: on_success - - when: manual - allow_failure: true - needs: - - trigger - dependencies: [] - script: - - ./docs/introduction/compile-sources.sh tezos/tezos latest-release - variables: - CARGO_HOME: /home/opam/.cargo - CARGO_NET_OFFLINE: "false" - -oc.compile_sources_bullseye: - image: ocaml/opam:debian-11 - stage: test - tags: - - gcp - rules: - - changes: - - docs/introduction/compile*.sh - - docs/introduction/install*.sh - when: on_success - - when: manual - allow_failure: true - needs: - - trigger - dependencies: [] - script: - - ./docs/introduction/compile-sources.sh ${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH:-tezos/tezos} - ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-master} - variables: - CARGO_HOME: /home/opam/.cargo - CARGO_NET_OFFLINE: "false" - -oc.compile_sources_mantic: - image: ocaml/opam:ubuntu-23.10 +oc.compile_sources_doc_bookworm: + image: ocaml/opam:debian-12 stage: test tags: - gcp diff --git a/.gitlab/ci/pipelines/schedule_extended_test.yml b/.gitlab/ci/pipelines/schedule_extended_test.yml index 2821f30bbfd0..28d2848925fa 100644 --- a/.gitlab/ci/pipelines/schedule_extended_test.yml +++ b/.gitlab/ci/pipelines/schedule_extended_test.yml @@ -2267,8 +2267,8 @@ oc.install_opam_jammy: variables: OPAMJOBS: "4" -oc.compile_release_sources_bullseye: - image: ocaml/opam:debian-11 +oc.compile_sources_doc_bookworm: + image: ocaml/opam:debian-12 stage: test tags: - gcp @@ -2281,22 +2281,7 @@ oc.compile_release_sources_bullseye: CARGO_HOME: /home/opam/.cargo CARGO_NET_OFFLINE: "false" -oc.compile_sources_bullseye: - image: ocaml/opam:debian-11 - stage: test - tags: - - gcp - rules: - - when: always - dependencies: [] - script: - - ./docs/introduction/compile-sources.sh ${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH:-tezos/tezos} - ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-master} - variables: - CARGO_HOME: /home/opam/.cargo - CARGO_NET_OFFLINE: "false" - -oc.compile_sources_mantic: +oc.compile_sources_doc_mantic: image: ocaml/opam:ubuntu-23.10 stage: test tags: @@ -2305,8 +2290,7 @@ oc.compile_sources_mantic: - when: always dependencies: [] script: - - ./docs/introduction/compile-sources.sh ${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH:-tezos/tezos} - ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-master} + - ./docs/introduction/compile-sources.sh tezos/tezos latest-release variables: CARGO_HOME: /home/opam/.cargo CARGO_NET_OFFLINE: "false" diff --git a/ci/bin/code_verification.ml b/ci/bin/code_verification.ml index 8b5ad4c891bf..db94755a752a 100644 --- a/ci/bin/code_verification.ml +++ b/ci/bin/code_verification.ml @@ -1285,27 +1285,39 @@ let jobs pipeline_type = Debian_bookworm; (* Test installing through opam *) job_install_opam_jammy; - (* Test compiling the [latest-release] branch on Bullseye *) - job_compile_sources - ~__POS__ - ~name:"oc.compile_release_sources_bullseye" - ~image:Images.opam_debian_bullseye - ~project:"tezos/tezos" - ~branch:"latest-release"; - (* Test compiling the [master] branch on Bullseye *) - job_compile_sources - ~__POS__ - ~name:"oc.compile_sources_bullseye" - ~image:Images.opam_debian_bullseye - ~project:"${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH:-tezos/tezos}" - ~branch:"${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-master}"; - job_compile_sources - ~__POS__ - ~name:"oc.compile_sources_mantic" - ~image:Images.opam_ubuntu_mantic - ~project:"${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH:-tezos/tezos}" - ~branch:"${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-master}"; ] + @ + match pipeline_type with + (* These tests make sure that the compilation instructions + in master are still valid for the latest-release branch *) + | Schedule_extended_test -> + [ + job_compile_sources + ~__POS__ + ~name:"oc.compile_sources_doc_bookworm" + ~image:Images.opam_debian_bookworm + ~project:"tezos/tezos" + ~branch:"latest-release"; + job_compile_sources + ~__POS__ + ~name:"oc.compile_sources_doc_mantic" + ~image:Images.opam_ubuntu_mantic + ~project:"tezos/tezos" + ~branch:"latest-release"; + ] + (* Test compiling the [master] branch on Bookworm, to make sure + that the compilation instructions in this branch are still + valid. + *) + | _ -> + [ + job_compile_sources + ~__POS__ + ~name:"oc.compile_sources_doc_bookworm" + ~image:Images.opam_debian_bookworm + ~project:"${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH:-tezos/tezos}" + ~branch:"${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-master}"; + ] in (* Tezt jobs. diff --git a/ci/bin/common.ml b/ci/bin/common.ml index b1479fea293b..e9d948350b55 100644 --- a/ci/bin/common.ml +++ b/ci/bin/common.ml @@ -117,8 +117,8 @@ module Images_external = struct let opam_ubuntu_mantic = Image.mk_external ~image_path:"ocaml/opam:ubuntu-23.10" - let opam_debian_bullseye = - Image.mk_external ~image_path:"ocaml/opam:debian-11" + let opam_debian_bookworm = + Image.mk_external ~image_path:"ocaml/opam:debian-12" let ci_release = Image.mk_external -- GitLab From be8a0770f4ff7ed290896d096c51fc3260b338de Mon Sep 17 00:00:00 2001 From: Pietro Abate Date: Fri, 7 Jun 2024 10:08:49 +0200 Subject: [PATCH 2/5] tests: update tests to run on bookworm instead of bullseyes --- .gitlab/ci/pipelines/before_merging.yml | 4 ++-- .gitlab/ci/pipelines/schedule_extended_test.yml | 4 ++-- ci/bin/code_verification.ml | 4 ++-- ci/bin/common.ml | 2 -- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.gitlab/ci/pipelines/before_merging.yml b/.gitlab/ci/pipelines/before_merging.yml index 49e94e778239..fa9be332cfad 100644 --- a/.gitlab/ci/pipelines/before_merging.yml +++ b/.gitlab/ci/pipelines/before_merging.yml @@ -3243,8 +3243,8 @@ oc.install_python_jammy: - ./docs/developer/install-python-debian-ubuntu.sh ${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH:-tezos/tezos} ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-master} -oc.install_python_bullseye: - image: debian:bullseye +oc.install_python_bookworm: + image: debian:bookworm stage: doc tags: - gcp diff --git a/.gitlab/ci/pipelines/schedule_extended_test.yml b/.gitlab/ci/pipelines/schedule_extended_test.yml index 28d2848925fa..6021ec083f5a 100644 --- a/.gitlab/ci/pipelines/schedule_extended_test.yml +++ b/.gitlab/ci/pipelines/schedule_extended_test.yml @@ -2717,8 +2717,8 @@ oc.install_python_jammy: - ./docs/developer/install-python-debian-ubuntu.sh ${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH:-tezos/tezos} ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-master} -oc.install_python_bullseye: - image: debian:bullseye +oc.install_python_bookworm: + image: debian:bookworm stage: doc tags: - gcp diff --git a/ci/bin/code_verification.ml b/ci/bin/code_verification.ml index db94755a752a..397a0c98b028 100644 --- a/ci/bin/code_verification.ml +++ b/ci/bin/code_verification.ml @@ -1691,8 +1691,8 @@ let jobs pipeline_type = ~image:Images.ubuntu_jammy; job_install_python ~__POS__ - ~name:"oc.install_python_bullseye" - ~image:Images.debian_bullseye; + ~name:"oc.install_python_bookworm" + ~image:Images.debian_bookworm; ] in let jobs_documentation : tezos_job list = diff --git a/ci/bin/common.ml b/ci/bin/common.ml index e9d948350b55..bf7496f01b0a 100644 --- a/ci/bin/common.ml +++ b/ci/bin/common.ml @@ -99,8 +99,6 @@ module Images_external = struct let debian_bookworm = Image.mk_external ~image_path:"debian:bookworm" - let debian_bullseye = Image.mk_external ~image_path:"debian:bullseye" - let ubuntu_focal = Image.mk_external ~image_path:"public.ecr.aws/lts/ubuntu:20.04_stable" -- GitLab From 04cf372d8220690ebebbe84729fdd369a5c2dcf7 Mon Sep 17 00:00:00 2001 From: Pietro Abate Date: Fri, 7 Jun 2024 10:23:07 +0200 Subject: [PATCH 3/5] tests: refine changeset rules for compile tests --- .gitlab/ci/pipelines/before_merging.yml | 9 +-------- ci/bin/code_verification.ml | 17 +++++++++++------ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.gitlab/ci/pipelines/before_merging.yml b/.gitlab/ci/pipelines/before_merging.yml index fa9be332cfad..234c0e9250b0 100644 --- a/.gitlab/ci/pipelines/before_merging.yml +++ b/.gitlab/ci/pipelines/before_merging.yml @@ -2505,7 +2505,6 @@ oc.install_bin_ubuntu_focal: - gcp rules: - changes: - - docs/introduction/compile*.sh - docs/introduction/install*.sh when: on_success - when: manual @@ -2524,7 +2523,6 @@ oc.install_bin_ubuntu_jammy: - gcp rules: - changes: - - docs/introduction/compile*.sh - docs/introduction/install*.sh when: on_success - when: manual @@ -2543,7 +2541,6 @@ oc.install_bin_rc_ubuntu_focal: - gcp rules: - changes: - - docs/introduction/compile*.sh - docs/introduction/install*.sh when: on_success - when: manual @@ -2562,7 +2559,6 @@ oc.install_bin_rc_ubuntu_jammy: - gcp rules: - changes: - - docs/introduction/compile*.sh - docs/introduction/install*.sh when: on_success - when: manual @@ -2581,7 +2577,6 @@ oc.install_bin_debian_bookworm: - gcp rules: - changes: - - docs/introduction/compile*.sh - docs/introduction/install*.sh when: on_success - when: manual @@ -2600,7 +2595,6 @@ oc.install_bin_rc_debian_bookworm: - gcp rules: - changes: - - docs/introduction/compile*.sh - docs/introduction/install*.sh when: on_success - when: manual @@ -2636,8 +2630,7 @@ oc.compile_sources_doc_bookworm: - gcp rules: - changes: - - docs/introduction/compile*.sh - - docs/introduction/install*.sh + - docs/introduction/compile-sources.sh when: on_success - when: manual allow_failure: true diff --git a/ci/bin/code_verification.ml b/ci/bin/code_verification.ml index 397a0c98b028..5a5ee1f5159b 100644 --- a/ci/bin/code_verification.ml +++ b/ci/bin/code_verification.ml @@ -1191,12 +1191,17 @@ let jobs pipeline_type = in (* The set of installation test jobs *) let jobs_install_octez : tezos_job list = - let changeset_install_jobs = - Changeset.make - ["docs/introduction/install*.sh"; "docs/introduction/compile*.sh"] - in let install_octez_rules = - make_rules ~changes:changeset_install_jobs ~manual:Yes () + make_rules + ~changes:(Changeset.make ["docs/introduction/install*.sh"]) + ~manual:Yes + () + in + let compile_octez_rules = + make_rules + ~changes:(Changeset.make ["docs/introduction/compile-sources.sh"]) + ~manual:Yes + () in (* Test installation of the current deb binary packages. *) let job_install_bin ~__POS__ ~name @@ -1245,7 +1250,7 @@ let jobs pipeline_type = ~name ~image ~dependencies:dependencies_needs_start - ~rules:install_octez_rules + ~rules:compile_octez_rules ~stage:Stages.test (* This job uses a CARGO_HOME different from {!Common.cargo_home}. That CARGO_HOME used is outside the -- GitLab From e2c519fe6e956ae2635197215e7406ca4f4dfeae Mon Sep 17 00:00:00 2001 From: Nic Volanschi Date: Tue, 18 Jun 2024 17:21:45 +0200 Subject: [PATCH 4/5] doc: change example Linux version in doc page howtoget --- docs/introduction/howtoget.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/introduction/howtoget.rst b/docs/introduction/howtoget.rst index 508b5882b9a5..fa7cca23f537 100644 --- a/docs/introduction/howtoget.rst +++ b/docs/introduction/howtoget.rst @@ -417,7 +417,7 @@ If you plan to contribute to the Octez codebase, the way to go is to set up a complete development environment, by cloning the repository and compiling the sources using the provided makefile. -**TL;DR**: From a fresh Debian Bullseye or Ubuntu Mantic x86_64, you typically want to select a source branch in the Octez repository, e.g.: +**TL;DR**: From a fresh Debian Bookworm x86_64, you typically want to select a source branch in the Octez repository, e.g.: .. literalinclude:: compile-sources.sh :language: shell -- GitLab From 380da640f31cb37912240a4fa9105687965622f8 Mon Sep 17 00:00:00 2001 From: Pietro Abate Date: Wed, 19 Jun 2024 08:53:16 +0200 Subject: [PATCH 5/5] tests: move python installation tests in schedule pipelines --- .gitlab/ci/pipelines/before_merging.yml | 40 ------------- .../ci/pipelines/schedule_extended_test.yml | 9 +-- ci/bin/code_verification.ml | 58 +++++++++++++------ 3 files changed, 42 insertions(+), 65 deletions(-) diff --git a/.gitlab/ci/pipelines/before_merging.yml b/.gitlab/ci/pipelines/before_merging.yml index 234c0e9250b0..7a81b154ba7c 100644 --- a/.gitlab/ci/pipelines/before_merging.yml +++ b/.gitlab/ci/pipelines/before_merging.yml @@ -3196,46 +3196,6 @@ oc.unified_coverage: expose_as: Coverage report coverage: '/Coverage: ([^%]+%)/' -oc.install_python_focal: - image: public.ecr.aws/lts/ubuntu:20.04_stable - stage: doc - tags: - - gcp - rules: - - if: $CI_MERGE_REQUEST_LABELS =~ /(?:^|,)ci--docs(?:$|,)/ - when: on_success - - changes: - - docs/developer/install-python-debian-ubuntu.sh - when: on_success - - when: manual - allow_failure: true - needs: - - trigger - dependencies: [] - script: - - ./docs/developer/install-python-debian-ubuntu.sh ${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH:-tezos/tezos} - ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-master} - -oc.install_python_jammy: - image: public.ecr.aws/lts/ubuntu:22.04_stable - stage: doc - tags: - - gcp - rules: - - if: $CI_MERGE_REQUEST_LABELS =~ /(?:^|,)ci--docs(?:$|,)/ - when: on_success - - changes: - - docs/developer/install-python-debian-ubuntu.sh - when: on_success - - when: manual - allow_failure: true - needs: - - trigger - dependencies: [] - script: - - ./docs/developer/install-python-debian-ubuntu.sh ${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH:-tezos/tezos} - ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-master} - oc.install_python_bookworm: image: debian:bookworm stage: doc diff --git a/.gitlab/ci/pipelines/schedule_extended_test.yml b/.gitlab/ci/pipelines/schedule_extended_test.yml index 6021ec083f5a..1d79828a397c 100644 --- a/.gitlab/ci/pipelines/schedule_extended_test.yml +++ b/.gitlab/ci/pipelines/schedule_extended_test.yml @@ -2702,8 +2702,7 @@ oc.install_python_focal: - when: always dependencies: [] script: - - ./docs/developer/install-python-debian-ubuntu.sh ${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH:-tezos/tezos} - ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-master} + - ./docs/developer/install-python-debian-ubuntu.sh tezos/tezos latest-release oc.install_python_jammy: image: public.ecr.aws/lts/ubuntu:22.04_stable @@ -2714,8 +2713,7 @@ oc.install_python_jammy: - when: always dependencies: [] script: - - ./docs/developer/install-python-debian-ubuntu.sh ${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH:-tezos/tezos} - ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-master} + - ./docs/developer/install-python-debian-ubuntu.sh tezos/tezos latest-release oc.install_python_bookworm: image: debian:bookworm @@ -2726,8 +2724,7 @@ oc.install_python_bookworm: - when: always dependencies: [] script: - - ./docs/developer/install-python-debian-ubuntu.sh ${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH:-tezos/tezos} - ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-master} + - ./docs/developer/install-python-debian-ubuntu.sh tezos/tezos latest-release documentation:odoc: image: ${ci_image_name}/test:${ci_image_tag} diff --git a/ci/bin/code_verification.ml b/ci/bin/code_verification.ml index 5a5ee1f5159b..b17c53fbd0d0 100644 --- a/ci/bin/code_verification.ml +++ b/ci/bin/code_verification.ml @@ -1663,7 +1663,7 @@ let jobs pipeline_type = let doc = let jobs_install_python = (* Creates a job that tests installation of the python environment in [image] *) - let job_install_python ~__POS__ ~name ~image = + let job_install_python ~__POS__ ~name ~image ~project ~branch = job ~__POS__ ~name @@ -1679,26 +1679,46 @@ let jobs pipeline_type = ~label:"ci--docs" ()) [ - "./docs/developer/install-python-debian-ubuntu.sh \ - ${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH:-tezos/tezos} \ - ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-master}"; + sf + "./docs/developer/install-python-debian-ubuntu.sh %s %s" + project + branch; ] in - (* The set of python installation test jobs. *) - [ - job_install_python - ~__POS__ - ~name:"oc.install_python_focal" - ~image:Images.ubuntu_focal; - job_install_python - ~__POS__ - ~name:"oc.install_python_jammy" - ~image:Images.ubuntu_jammy; - job_install_python - ~__POS__ - ~name:"oc.install_python_bookworm" - ~image:Images.debian_bookworm; - ] + (* The set of python installation test jobs. Since python is + today less used, we do the bulk of the tests in scheduled pipelines + and we only test debian_bookworm in a merge pipeline *) + match pipeline_type with + | Schedule_extended_test -> + [ + job_install_python + ~__POS__ + ~name:"oc.install_python_focal" + ~image:Images.ubuntu_focal + ~project:"tezos/tezos" + ~branch:"latest-release"; + job_install_python + ~__POS__ + ~name:"oc.install_python_jammy" + ~image:Images.ubuntu_jammy + ~project:"tezos/tezos" + ~branch:"latest-release"; + job_install_python + ~__POS__ + ~name:"oc.install_python_bookworm" + ~image:Images.debian_bookworm + ~project:"tezos/tezos" + ~branch:"latest-release"; + ] + | Before_merging -> + [ + job_install_python + ~__POS__ + ~name:"oc.install_python_bookworm" + ~image:Images.debian_bookworm + ~project:"${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH:-tezos/tezos}" + ~branch:"${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-master}"; + ] in let jobs_documentation : tezos_job list = let rules = -- GitLab