From 3d558c5c3adc8e7a9fda7a79a87ffe0ee268cf8a Mon Sep 17 00:00:00 2001 From: alvicsam Date: Mon, 30 Jan 2023 14:33:30 +0100 Subject: [PATCH 01/12] [ci] Change runners --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d88e4c27109..349d5bf16f6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,7 +25,6 @@ variables: GIT_STRATEGY: fetch GIT_DEPTH: 100 CARGO_INCREMENTAL: 0 - CARGO_TARGET_DIR: "/ci-cache/${CI_PROJECT_NAME}/targets/${CI_COMMIT_REF_NAME}/${CI_JOB_NAME}" # CI_IMAGE is changed to "-:staging" when the CI image gets rebuilt # read more https://github.com/paritytech/scripts/pull/244 CI_IMAGE: "paritytech/ink-ci-linux:production" @@ -80,7 +79,7 @@ workflow: - sccache -s interruptible: true tags: - - linux-docker + - linux-docker-vm-c2 .kubernetes-env: &kubernetes-env interruptible: true From 7849ac2a7fd35fd852cb60bfd70858e613aa30b8 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Mon, 30 Jan 2023 14:40:02 +0100 Subject: [PATCH 02/12] rm sccache --- .gitlab-ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 349d5bf16f6..ad0bb6baf40 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -75,8 +75,6 @@ workflow: image: "${CI_IMAGE}" before_script: - *rust-info-script - - ./scripts/ci/pre_cache.sh - - sccache -s interruptible: true tags: - linux-docker-vm-c2 From 3f2ad0d8b29e40b6289b1e1b9e2172fdee3082d7 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Mon, 30 Jan 2023 14:41:28 +0100 Subject: [PATCH 03/12] rm sccache --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ad0bb6baf40..eaeea565d52 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -60,7 +60,6 @@ workflow: - cargo +nightly --version - cargo spellcheck --version - bash --version - - sccache -s .test-refs: &test-refs rules: From df27fd30764538c0a25e0bb8900314e48b963b11 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Mon, 30 Jan 2023 16:58:05 +0100 Subject: [PATCH 04/12] run examples-test on old runner --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eaeea565d52..91f08014d0f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -390,6 +390,8 @@ examples-test: cargo test --verbose --manifest-path ./examples/lang-err-integration-tests/${contract}/Cargo.toml --features e2e-tests; done - cargo test --verbose --manifest-path ./examples/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml; + tags: + - linux-docker examples-contract-build: stage: examples From c7f49ef90315e44e752fd905800f2a4f09cd685d Mon Sep 17 00:00:00 2001 From: alvicsam Date: Mon, 30 Jan 2023 17:37:10 +0100 Subject: [PATCH 05/12] disable sccache, debug vm --- .gitlab-ci.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 91f08014d0f..5534ace767e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -39,6 +39,7 @@ variables: # this fix not yet in stable: https://github.com/rust-lang/rust-clippy/issues/8895. # Remove the following line again as soon as `clippy` on stable succeeds again. CLIPPY_ALLOWED: "clippy::extra_unused_lifetimes" + RUSTC_WRAPPER: "" workflow: rules: @@ -393,6 +394,41 @@ examples-test: tags: - linux-docker +# debug, rm me +examples-test-vm: + stage: examples + <<: *docker-env + <<: *test-refs + needs: + - job: clippy-std + artifacts: false + script: + - *start-substrate-contracts-node + - for example in examples/*/; do + if [ "$example" = "examples/upgradeable-contracts/" ]; then continue; fi; + if [ "$example" = "examples/lang-err-integration-tests/" ]; then continue; fi; + if grep -q "e2e-tests = \[\]" "${example}/Cargo.toml"; then + cargo test --verbose --manifest-path ${example}/Cargo.toml --features e2e-tests; + else + cargo test --verbose --manifest-path ${example}/Cargo.toml; + fi; + done + - for contract in ${DELEGATOR_SUBCONTRACTS}; do + cargo test --verbose --manifest-path ./examples/delegator/${contract}/Cargo.toml; + done + - for contract in ${UPGRADEABLE_CONTRACTS}; do + cargo test --verbose --manifest-path ./examples/upgradeable-contracts/${contract}/Cargo.toml; + done + # TODO (#1502): We need to clean before running, otherwise the CI fails with a + # linking error. + - for contract in ${LANG_ERR_INTEGRATION_CONTRACTS}; do + cargo clean --verbose --manifest-path ./examples/lang-err-integration-tests/${contract}/Cargo.toml; + cargo test --verbose --manifest-path ./examples/lang-err-integration-tests/${contract}/Cargo.toml --features e2e-tests; + done + - cargo test --verbose --manifest-path ./examples/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml; + tags: + - linux-docker-vm-c2 + examples-contract-build: stage: examples <<: *docker-env From 1e1ae7358b86823109183ccbf261729594c5b755 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Tue, 31 Jan 2023 09:50:51 +0100 Subject: [PATCH 06/12] fix docs --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5534ace767e..ca112c876bc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -307,7 +307,7 @@ docs: - cargo doc --no-deps --all-features -p ink_metadata - cargo doc --no-deps --all-features -p ink_e2e - cargo doc --no-deps --all-features -p ink_e2e_macro - - mv ${CARGO_TARGET_DIR}/doc ./crate-docs + - mv target/doc ./crate-docs # FIXME: remove me after CI image gets nonroot - chown -R nonroot:nonroot ./crate-docs From 9d2fead75b876784c7fcf9306e2d1f2d555d92ba Mon Sep 17 00:00:00 2001 From: alvicsam Date: Thu, 2 Feb 2023 12:27:14 +0100 Subject: [PATCH 07/12] add debug msg --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ca112c876bc..560dfef6b32 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -408,8 +408,10 @@ examples-test-vm: if [ "$example" = "examples/upgradeable-contracts/" ]; then continue; fi; if [ "$example" = "examples/lang-err-integration-tests/" ]; then continue; fi; if grep -q "e2e-tests = \[\]" "${example}/Cargo.toml"; then + echo ${example}; cargo test --verbose --manifest-path ${example}/Cargo.toml --features e2e-tests; else + echo ${example}; cargo test --verbose --manifest-path ${example}/Cargo.toml; fi; done From 43fe570c835abd38f58a2345f1bbab2bf41512f0 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Thu, 2 Feb 2023 16:27:17 +0100 Subject: [PATCH 08/12] add more debug --- .gitlab-ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 560dfef6b32..7e11c8e25e9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -408,22 +408,25 @@ examples-test-vm: if [ "$example" = "examples/upgradeable-contracts/" ]; then continue; fi; if [ "$example" = "examples/lang-err-integration-tests/" ]; then continue; fi; if grep -q "e2e-tests = \[\]" "${example}/Cargo.toml"; then - echo ${example}; + echo "--------------${example}--------------"; cargo test --verbose --manifest-path ${example}/Cargo.toml --features e2e-tests; else - echo ${example}; + echo "--------------${example}--------------"; cargo test --verbose --manifest-path ${example}/Cargo.toml; fi; done - for contract in ${DELEGATOR_SUBCONTRACTS}; do + echo "--------------debug--------------"; cargo test --verbose --manifest-path ./examples/delegator/${contract}/Cargo.toml; done - for contract in ${UPGRADEABLE_CONTRACTS}; do + echo "--------------debug--------------"; cargo test --verbose --manifest-path ./examples/upgradeable-contracts/${contract}/Cargo.toml; done # TODO (#1502): We need to clean before running, otherwise the CI fails with a # linking error. - for contract in ${LANG_ERR_INTEGRATION_CONTRACTS}; do + echo "--------------debug--------------"; cargo clean --verbose --manifest-path ./examples/lang-err-integration-tests/${contract}/Cargo.toml; cargo test --verbose --manifest-path ./examples/lang-err-integration-tests/${contract}/Cargo.toml --features e2e-tests; done From cbf09786cd095fb1d830cae4b7741bb343455fcf Mon Sep 17 00:00:00 2001 From: alvicsam Date: Thu, 2 Feb 2023 18:17:36 +0100 Subject: [PATCH 09/12] run test earlier --- .gitlab-ci.yml | 51 ++++++-------------------------------------------- 1 file changed, 6 insertions(+), 45 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7e11c8e25e9..d88e4c27109 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,6 +25,7 @@ variables: GIT_STRATEGY: fetch GIT_DEPTH: 100 CARGO_INCREMENTAL: 0 + CARGO_TARGET_DIR: "/ci-cache/${CI_PROJECT_NAME}/targets/${CI_COMMIT_REF_NAME}/${CI_JOB_NAME}" # CI_IMAGE is changed to "-:staging" when the CI image gets rebuilt # read more https://github.com/paritytech/scripts/pull/244 CI_IMAGE: "paritytech/ink-ci-linux:production" @@ -39,7 +40,6 @@ variables: # this fix not yet in stable: https://github.com/rust-lang/rust-clippy/issues/8895. # Remove the following line again as soon as `clippy` on stable succeeds again. CLIPPY_ALLOWED: "clippy::extra_unused_lifetimes" - RUSTC_WRAPPER: "" workflow: rules: @@ -61,6 +61,7 @@ workflow: - cargo +nightly --version - cargo spellcheck --version - bash --version + - sccache -s .test-refs: &test-refs rules: @@ -75,9 +76,11 @@ workflow: image: "${CI_IMAGE}" before_script: - *rust-info-script + - ./scripts/ci/pre_cache.sh + - sccache -s interruptible: true tags: - - linux-docker-vm-c2 + - linux-docker .kubernetes-env: &kubernetes-env interruptible: true @@ -307,7 +310,7 @@ docs: - cargo doc --no-deps --all-features -p ink_metadata - cargo doc --no-deps --all-features -p ink_e2e - cargo doc --no-deps --all-features -p ink_e2e_macro - - mv target/doc ./crate-docs + - mv ${CARGO_TARGET_DIR}/doc ./crate-docs # FIXME: remove me after CI image gets nonroot - chown -R nonroot:nonroot ./crate-docs @@ -391,48 +394,6 @@ examples-test: cargo test --verbose --manifest-path ./examples/lang-err-integration-tests/${contract}/Cargo.toml --features e2e-tests; done - cargo test --verbose --manifest-path ./examples/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml; - tags: - - linux-docker - -# debug, rm me -examples-test-vm: - stage: examples - <<: *docker-env - <<: *test-refs - needs: - - job: clippy-std - artifacts: false - script: - - *start-substrate-contracts-node - - for example in examples/*/; do - if [ "$example" = "examples/upgradeable-contracts/" ]; then continue; fi; - if [ "$example" = "examples/lang-err-integration-tests/" ]; then continue; fi; - if grep -q "e2e-tests = \[\]" "${example}/Cargo.toml"; then - echo "--------------${example}--------------"; - cargo test --verbose --manifest-path ${example}/Cargo.toml --features e2e-tests; - else - echo "--------------${example}--------------"; - cargo test --verbose --manifest-path ${example}/Cargo.toml; - fi; - done - - for contract in ${DELEGATOR_SUBCONTRACTS}; do - echo "--------------debug--------------"; - cargo test --verbose --manifest-path ./examples/delegator/${contract}/Cargo.toml; - done - - for contract in ${UPGRADEABLE_CONTRACTS}; do - echo "--------------debug--------------"; - cargo test --verbose --manifest-path ./examples/upgradeable-contracts/${contract}/Cargo.toml; - done - # TODO (#1502): We need to clean before running, otherwise the CI fails with a - # linking error. - - for contract in ${LANG_ERR_INTEGRATION_CONTRACTS}; do - echo "--------------debug--------------"; - cargo clean --verbose --manifest-path ./examples/lang-err-integration-tests/${contract}/Cargo.toml; - cargo test --verbose --manifest-path ./examples/lang-err-integration-tests/${contract}/Cargo.toml --features e2e-tests; - done - - cargo test --verbose --manifest-path ./examples/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml; - tags: - - linux-docker-vm-c2 examples-contract-build: stage: examples From 8340b50c11ac8784cfbeb4b534459c44ccedf655 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 3 Feb 2023 09:54:27 +0100 Subject: [PATCH 10/12] try k8s --- .gitlab-ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d88e4c27109..135b6c252f0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -395,6 +395,21 @@ examples-test: done - cargo test --verbose --manifest-path ./examples/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml; +# debug, rm me +examples-test-k8s: + # stage: examples + stage: lint + <<: *docker-env + <<: *test-refs + # needs: + # - job: clippy-std + # artifacts: false + script: + - *start-substrate-contracts-node + - cargo test --verbose --manifest-path examples/flipper/Cargo.toml --features e2e-tests + tags: + - kubernetes-parity-build + examples-contract-build: stage: examples <<: *docker-env From 8a6167b78cfe35112a0759ca7ac0a5cea617466b Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 3 Feb 2023 10:01:10 +0100 Subject: [PATCH 11/12] run only one test --- .gitlab-ci.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 135b6c252f0..d88e4c27109 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -395,21 +395,6 @@ examples-test: done - cargo test --verbose --manifest-path ./examples/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml; -# debug, rm me -examples-test-k8s: - # stage: examples - stage: lint - <<: *docker-env - <<: *test-refs - # needs: - # - job: clippy-std - # artifacts: false - script: - - *start-substrate-contracts-node - - cargo test --verbose --manifest-path examples/flipper/Cargo.toml --features e2e-tests - tags: - - kubernetes-parity-build - examples-contract-build: stage: examples <<: *docker-env From 5d4e7ee1ebb5a51e4e98a3100afc187542f3f1af Mon Sep 17 00:00:00 2001 From: alvicsam Date: Tue, 7 Feb 2023 14:04:09 +0100 Subject: [PATCH 12/12] new runner --- .gitlab-ci.yml | 5 +---- scripts/ci/pre_cache.sh | 28 ---------------------------- 2 files changed, 1 insertion(+), 32 deletions(-) delete mode 100755 scripts/ci/pre_cache.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d88e4c27109..d3f8b0047b4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -61,7 +61,6 @@ workflow: - cargo +nightly --version - cargo spellcheck --version - bash --version - - sccache -s .test-refs: &test-refs rules: @@ -76,11 +75,9 @@ workflow: image: "${CI_IMAGE}" before_script: - *rust-info-script - - ./scripts/ci/pre_cache.sh - - sccache -s interruptible: true tags: - - linux-docker + - linux-docker-vm-c2 .kubernetes-env: &kubernetes-env interruptible: true diff --git a/scripts/ci/pre_cache.sh b/scripts/ci/pre_cache.sh deleted file mode 100755 index c25d73587bf..00000000000 --- a/scripts/ci/pre_cache.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -set -u - -# if there is no directory for this $CI_COMMIT_REF_NAME/$CI_JOB_NAME -# create such directory and -# copy recursively all the files from the newest dir which has $CI_JOB_NAME, if it exists - -# cache lives in /ci-cache/${CI_PROJECT_NAME}/${2}/${CI_COMMIT_REF_NAME}/${CI_JOB_NAME} - -function prepopulate { - if [[ ! -d $1 ]]; then - mkdir -p "/ci-cache/$CI_PROJECT_NAME/$2/$CI_COMMIT_REF_NAME"; - FRESH_CACHE=$(find "/ci-cache/$CI_PROJECT_NAME/$2" -mindepth 2 -maxdepth 2 \ - -type d -name "$CI_JOB_NAME" -exec stat --printf="%Y\t%n\n" {} \; |sort -n -r |head -1 |cut -f2); - if [[ -d $FRESH_CACHE ]]; then - echo "____Using" "$FRESH_CACHE" "to prepopulate the cache____"; - time cp -r "$FRESH_CACHE" "$1"; - else - echo "_____No such $2 dir, proceeding from scratch_____"; - fi - else - echo "____No need to prepopulate $2 cache____"; - fi -} - -# CARGO_HOME cache is still broken so would be handled some other way. -prepopulate "$CARGO_TARGET_DIR" targets