From 33586cc72f65424d59f4202eaa96e78e623f1767 Mon Sep 17 00:00:00 2001 From: Vladimir Istyufeev Date: Wed, 23 Nov 2022 17:31:47 +0000 Subject: [PATCH 1/6] CI: Explicitly unset RUSTC_WRAPPER=sccache environment variable --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8519d0f88fc7c..3eee6ff516f17 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -105,6 +105,8 @@ default: .docker-env: image: "${CI_IMAGE}" before_script: + # TODO: remove unset invocation when we'll be free from 'ENV RUSTC_WRAPPER=sccache' & sccache itself in all images + - unset RUSTC_WRAPPER - !reference [.rust-info-script, script] - !reference [.rusty-cachier, before_script] - !reference [.pipeline-stopper-vars, script] From 7bd12d423b163c084c9792e5d218f22c6131ce04 Mon Sep 17 00:00:00 2001 From: Vladimir Istyufeev Date: Wed, 23 Nov 2022 17:53:13 +0000 Subject: [PATCH 2/6] Try with `rusty-cachier` disabled --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3eee6ff516f17..37291f4ee679c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -51,6 +51,7 @@ variables: BUILDAH_IMAGE: "quay.io/buildah/stable:v1.27" RUSTY_CACHIER_SINGLE_BRANCH: master RUSTY_CACHIER_DONT_OPERATE_ON_MAIN_BRANCH: "true" + RUSTY_CACHIER_SNEAKY_BYPASS: "true" default: retry: From 007afc7d0e3068d52ffea99906ed3e63f1eb613a Mon Sep 17 00:00:00 2001 From: Vladimir Istyufeev Date: Wed, 23 Nov 2022 18:03:17 +0000 Subject: [PATCH 3/6] Re-enable `rusty-cachier` and try with the staging image --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 37291f4ee679c..acd10b5877cff 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,11 +47,10 @@ variables: CARGO_INCREMENTAL: 0 DOCKER_OS: "debian:stretch" ARCH: "x86_64" - CI_IMAGE: "paritytech/ci-linux:production" + CI_IMAGE: "paritytech/ci-linux:staging" BUILDAH_IMAGE: "quay.io/buildah/stable:v1.27" RUSTY_CACHIER_SINGLE_BRANCH: master RUSTY_CACHIER_DONT_OPERATE_ON_MAIN_BRANCH: "true" - RUSTY_CACHIER_SNEAKY_BYPASS: "true" default: retry: From b04f27c9a73b43ff2839f8f36c01c772405e1f13 Mon Sep 17 00:00:00 2001 From: Vladimir Istyufeev Date: Fri, 25 Nov 2022 17:07:23 +0000 Subject: [PATCH 4/6] Bring back `production` image --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index acd10b5877cff..3eee6ff516f17 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,7 +47,7 @@ variables: CARGO_INCREMENTAL: 0 DOCKER_OS: "debian:stretch" ARCH: "x86_64" - CI_IMAGE: "paritytech/ci-linux:staging" + CI_IMAGE: "paritytech/ci-linux:production" BUILDAH_IMAGE: "quay.io/buildah/stable:v1.27" RUSTY_CACHIER_SINGLE_BRANCH: master RUSTY_CACHIER_DONT_OPERATE_ON_MAIN_BRANCH: "true" From fde839183a12a2bd51efc7143ebcddeed81ea6fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Silva=20de=20Souza?= <77391175+joao-paulo-parity@users.noreply.github.com> Date: Thu, 24 Nov 2022 09:09:14 -0300 Subject: [PATCH 5/6] Sort crates before splitting them into groups (+ some improvements) (#12755) * sort crates before splitting them into groups this is useful so that crates always get routed to a specific group for a given version of the source code, which means that jobs for each batch can be reliably retried individually * more verbose output * misc improvements * put uniq after sort uniq filters by adjacent lines * shellcheck * rm useless backlashes * handle edge case of no crates detected --- scripts/ci/gitlab/check-each-crate.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/scripts/ci/gitlab/check-each-crate.sh b/scripts/ci/gitlab/check-each-crate.sh index 27e2cf947787a..24cad67007e73 100755 --- a/scripts/ci/gitlab/check-each-crate.sh +++ b/scripts/ci/gitlab/check-each-crate.sh @@ -8,17 +8,23 @@ set -Eeu -o pipefail shopt -s inherit_errexit -set -x +set -vx target_group="$1" groups_total="$2" readarray -t workspace_crates < <(\ - cargo tree --workspace --depth 0 | \ - awk '{ if (length($1) == 0 || substr($1, 1, 1) == "[") { skip } else { print $1 } }' + cargo tree --workspace --depth 0 --prefix none | + awk '{ if (length($1) == 0 || substr($1, 1, 1) == "[") { skip } else { print $1 } }' | + sort | + uniq ) crates_total=${#workspace_crates[*]} +if [ "$crates_total" -lt 1 ]; then + >&2 echo "No crates detected for $PWD" + exit 1 +fi if [ "$crates_total" -lt "$groups_total" ]; then # `crates_total / groups_total` would result in 0, so round it up to 1 @@ -37,7 +43,9 @@ fi group=1 for ((i=0; i < crates_total; i += crates_per_group)); do if [ $group -eq "$target_group" ]; then - for crate in "${workspace_crates[@]:$i:$crates_per_group}"; do + crates_in_group=("${workspace_crates[@]:$i:$crates_per_group}") + echo "crates in the group: ${crates_in_group[*]}" >/dev/null # >/dev/null due to "set -x" + for crate in "${crates_in_group[@]}"; do cargo check --locked --release -p "$crate" done break From 7261d778c3fbdecc030375d5234841116656597f Mon Sep 17 00:00:00 2001 From: Vladimir Istyufeev Date: Fri, 25 Nov 2022 17:39:35 +0000 Subject: [PATCH 6/6] Revert "Sort crates before splitting them into groups (+ some improvements) (#12755)" This reverts commit fde839183a12a2bd51efc7143ebcddeed81ea6fa. --- scripts/ci/gitlab/check-each-crate.sh | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/scripts/ci/gitlab/check-each-crate.sh b/scripts/ci/gitlab/check-each-crate.sh index 24cad67007e73..27e2cf947787a 100755 --- a/scripts/ci/gitlab/check-each-crate.sh +++ b/scripts/ci/gitlab/check-each-crate.sh @@ -8,23 +8,17 @@ set -Eeu -o pipefail shopt -s inherit_errexit -set -vx +set -x target_group="$1" groups_total="$2" readarray -t workspace_crates < <(\ - cargo tree --workspace --depth 0 --prefix none | - awk '{ if (length($1) == 0 || substr($1, 1, 1) == "[") { skip } else { print $1 } }' | - sort | - uniq + cargo tree --workspace --depth 0 | \ + awk '{ if (length($1) == 0 || substr($1, 1, 1) == "[") { skip } else { print $1 } }' ) crates_total=${#workspace_crates[*]} -if [ "$crates_total" -lt 1 ]; then - >&2 echo "No crates detected for $PWD" - exit 1 -fi if [ "$crates_total" -lt "$groups_total" ]; then # `crates_total / groups_total` would result in 0, so round it up to 1 @@ -43,9 +37,7 @@ fi group=1 for ((i=0; i < crates_total; i += crates_per_group)); do if [ $group -eq "$target_group" ]; then - crates_in_group=("${workspace_crates[@]:$i:$crates_per_group}") - echo "crates in the group: ${crates_in_group[*]}" >/dev/null # >/dev/null due to "set -x" - for crate in "${crates_in_group[@]}"; do + for crate in "${workspace_crates[@]:$i:$crates_per_group}"; do cargo check --locked --release -p "$crate" done break