From fd1b4e5bdc38148d038a3e6075bb9058de248396 Mon Sep 17 00:00:00 2001 From: Denis P Date: Tue, 18 Feb 2020 18:01:35 +0100 Subject: [PATCH 01/15] repro ui bug --- .gitlab-ci.yml | 530 +------------------------------------------------ 1 file changed, 1 insertion(+), 529 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 62a6c2de32ddf..e26f9b666abc1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -39,7 +39,7 @@ variables: name: parity-build .docker-env: &docker-env - image: parity/rust-builder:latest + image: parity/rust-builder:b2c2c71d-20200217 before_script: - rustup show - cargo --version @@ -72,62 +72,6 @@ variables: #### stage: test -check-runtime: - stage: test - image: parity/tools:latest - <<: *kubernetes-build - only: - - /^[0-9]+$/ - variables: - GITLAB_API: "https://gitlab.parity.io/api/v4" - GITHUB_API_PROJECT: "parity%2Finfrastructure%2Fgithub-api" - script: - - ./.maintain/gitlab/check_runtime.sh - interruptible: true - allow_failure: true - - -check-line-width: - stage: test - image: parity/tools:latest - <<: *kubernetes-build - only: - - /^[0-9]+$/ - script: - - ./.maintain/gitlab/check_line_width.sh - interruptible: true - allow_failure: true - - -cargo-audit: - stage: test - <<: *docker-env - except: - - /^[0-9]+$/ - script: - - cargo audit - allow_failure: true - - -cargo-check-benches: - stage: test - <<: *docker-env - script: - - BUILD_DUMMY_WASM_BINARY=1 time cargo +nightly check --benches --all - - sccache -s - - -cargo-check-subkey: - stage: test - <<: *docker-env - except: - - /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - script: - - cd ./bin/utils/subkey - - BUILD_DUMMY_WASM_BINARY=1 time cargo check --release - - sccache -s - - test-linux-stable: &test-linux stage: test <<: *docker-env @@ -150,475 +94,3 @@ test-linux-stable: &test-linux expire_in: 3 days paths: - ${CI_COMMIT_SHORT_SHA}_warnings.log - -test-dependency-rules: - stage: test - <<: *docker-env - except: - variables: - - $DEPLOY_TAG - script: - - .maintain/ensure-deps.sh - -test-frame-staking: - stage: test - <<: *docker-env - variables: - # Enable debug assertions since we are running optimized builds for testing - # but still want to have debug assertions. - RUSTFLAGS: -Cdebug-assertions=y - RUST_BACKTRACE: 1 - except: - variables: - - $DEPLOY_TAG - script: - - cd frame/staking/ - - WASM_BUILD_NO_COLOR=1 time cargo test --release --verbose --no-default-features --features std - - sccache -s - -test-wasmtime: - stage: test - <<: *docker-env - variables: - # Enable debug assertions since we are running optimized builds for testing - # but still want to have debug assertions. - RUSTFLAGS: -Cdebug-assertions=y - RUST_BACKTRACE: 1 - except: - variables: - - $DEPLOY_TAG - script: - - cd client/executor - - WASM_BUILD_NO_COLOR=1 time cargo test --release --verbose --features wasmtime - - sccache -s - -test-linux-stable-int: - <<: *test-linux - except: - refs: - - /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - variables: - - $DEPLOY_TAG - script: - - echo "___Logs will be partly shown at the end in case of failure.___" - - echo "___Full log will be saved to the job artifacts only in case of failure.___" - - WASM_BUILD_NO_COLOR=1 RUST_LOG=sync=trace,consensus=trace,client=trace,state-db=trace,db=trace,forks=trace,state_db=trace,storage_cache=trace - time cargo test -p node-cli --release --verbose --locked -- --ignored - &> ${CI_COMMIT_SHORT_SHA}_int_failure.log - - sccache -s - after_script: - - awk '/FAILED|^error\[/,0' ${CI_COMMIT_SHORT_SHA}_int_failure.log - artifacts: - name: $CI_COMMIT_SHORT_SHA - when: on_failure - expire_in: 3 days - paths: - - ${CI_COMMIT_SHORT_SHA}_int_failure.log - - -check-web-wasm: - stage: test - <<: *docker-env - except: - - /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - script: - # WASM support is in progress. As more and more crates support WASM, we - # should add entries here. See https://github.com/paritytech/substrate/issues/2416 - - time cargo build --target=wasm32-unknown-unknown -p sp-io - - time cargo build --target=wasm32-unknown-unknown -p sp-runtime - - time cargo build --target=wasm32-unknown-unknown -p sp-std - - time cargo build --target=wasm32-unknown-unknown -p sc-client - - time cargo build --target=wasm32-unknown-unknown -p sc-consensus-aura - - time cargo build --target=wasm32-unknown-unknown -p sc-consensus-babe - - time cargo build --target=wasm32-unknown-unknown -p sp-consensus - - time cargo build --target=wasm32-unknown-unknown -p sc-telemetry - # Note: the command below is a bit weird because several Cargo issues prevent us from compiling the node in a more straight-forward way. - - time cargo build --manifest-path=bin/node/cli/Cargo.toml --no-default-features --features "browser" --target=wasm32-unknown-unknown - - sccache -s - -test-full-crypto-feature: - stage: test - <<: *docker-env - variables: - # Enable debug assertions since we are running optimized builds for testing - # but still want to have debug assertions. - RUSTFLAGS: -Cdebug-assertions=y - RUST_BACKTRACE: 1 - except: - variables: - - $DEPLOY_TAG - script: - - cd primitives/core/ - - time cargo +nightly build --verbose --no-default-features --features full_crypto - - cd ../application-crypto - - time cargo +nightly build --verbose --no-default-features --features full_crypto - - sccache -s - - -#### stage: build - -build-linux-substrate: &build-binary - stage: build - <<: *collect-artifacts - <<: *docker-env - <<: *build-only - before_script: - - mkdir -p ./artifacts/substrate/ - except: - variables: - - $DEPLOY_TAG - script: - - WASM_BUILD_NO_COLOR=1 time cargo build --release --verbose - - mv ./target/release/substrate ./artifacts/substrate/. - - echo -n "Substrate version = " - - if [ "${CI_COMMIT_TAG}" ]; then - echo "${CI_COMMIT_TAG}" | tee ./artifacts/substrate/VERSION; - else - ./artifacts/substrate/substrate --version | - sed -n -r 's/^substrate ([0-9.]+.*-[0-9a-f]{7,13})-.*$/\1/p' | - tee ./artifacts/substrate/VERSION; - fi - - sha256sum ./artifacts/substrate/substrate | tee ./artifacts/substrate/substrate.sha256 - - printf '\n# building node-template\n\n' - - ./.maintain/node-template-release.sh ./artifacts/substrate/substrate-node-template.tar.gz - - cp -r .maintain/docker/substrate.Dockerfile ./artifacts/substrate/ - - sccache -s - -build-linux-subkey: - <<: *build-binary - before_script: - - mkdir -p ./artifacts/subkey - script: - - cd ./bin/utils/subkey - - BUILD_DUMMY_WASM_BINARY=1 time cargo build --release --verbose - - cd - - - mv ./target/release/subkey ./artifacts/subkey/. - - echo -n "Subkey version = " - - ./artifacts/subkey/subkey --version | - sed -n -r 's/^subkey ([0-9.]+.*)/\1/p' | - tee ./artifacts/subkey/VERSION; - - sha256sum ./artifacts/subkey/subkey | tee ./artifacts/subkey/subkey.sha256 - - cp -r .maintain/docker/subkey.Dockerfile ./artifacts/subkey/ - - sccache -s - -build-rust-doc-release: - stage: build - <<: *docker-env - allow_failure: true - artifacts: - name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}-doc" - when: on_success - expire_in: 7 days - paths: - - ./crate-docs - <<: *build-only - script: - - rm -f ./crate-docs/index.html # use it as an indicator if the job succeeds - - BUILD_DUMMY_WASM_BINARY=1 RUSTDOCFLAGS="--html-in-header $(pwd)/.maintain/rustdoc-header.html" time cargo +nightly doc --release --all --verbose - - cp -R ./target/doc ./crate-docs - - echo "" > ./crate-docs/index.html - - sccache -s - -check_warnings: - stage: build - <<: *docker-env - except: - variables: - - $DEPLOY_TAG - variables: - GIT_STRATEGY: none - dependencies: - - test-linux-stable - script: - - if [ -s ${CI_COMMIT_SHORT_SHA}_warnings.log ]; then - cat ${CI_COMMIT_SHORT_SHA}_warnings.log; - exit 1; - else - echo "___No warnings___"; - fi - allow_failure: true - -# Nightly check whether Polkadot 'master' branch builds. -check_polkadot: - stage: build - <<: *docker-env - allow_failure: true - only: - - master - - schedules - script: - - SUBSTRATE_PATH=$(pwd) - # Clone the current Polkadot master branch into ./polkadot. - - git clone --depth 1 https://gitlab.parity.io/parity/polkadot.git - - cd polkadot - # Make sure we override the crates in native and wasm build - - mkdir .cargo - - echo "paths = [ \"$SUBSTRATE_PATH\" ]" > .cargo/config - - mkdir -p target/debug/wbuild/.cargo - - echo "paths = [ \"$SUBSTRATE_PATH\" ]" > target/debug/wbuild/.cargo/config - # package, others are updated along the way. - - cargo update - # Check whether Polkadot 'master' branch builds with this Substrate commit. - - time cargo check - - cd - - - sccache -s - -trigger-contracts-ci: - stage: publish - needs: - - job: build-linux-substrate - artifacts: false - - job: test-linux-stable - artifacts: false - trigger: - project: parity/srml-contracts-waterfall - branch: master - strategy: depend - only: - - master - - schedules - -#### stage: publish - -.publish-docker-release: &publish-docker-release - <<: *build-only - <<: *kubernetes-build - image: docker:stable - services: - - docker:dind - before_script: - - test "$Docker_Hub_User_Parity" -a "$Docker_Hub_Pass_Parity" - || ( echo "no docker credentials provided"; exit 1 ) - - docker login -u "$Docker_Hub_User_Parity" -p "$Docker_Hub_Pass_Parity" - - docker info - script: - - cd ./artifacts/$PRODUCT/ - - VERSION="$(cat ./VERSION)" - - echo "${PRODUCT} version = ${VERSION}" - - test -z "${VERSION}" && exit 1 - - docker build - --build-arg VCS_REF="${CI_COMMIT_SHA}" - --build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" - --tag $CONTAINER_IMAGE:$VERSION - --tag $CONTAINER_IMAGE:latest - --file $DOCKERFILE . - - docker push $CONTAINER_IMAGE:$VERSION - - docker push $CONTAINER_IMAGE:latest - -publish-docker-substrate: - stage: publish - <<: *publish-docker-release - # collect VERSION artifact here to pass it on to kubernetes - <<: *collect-artifacts - dependencies: - - build-linux-substrate - variables: - DOCKER_HOST: tcp://localhost:2375 - DOCKER_DRIVER: overlay2 - GIT_STRATEGY: none - PRODUCT: substrate - DOCKERFILE: $PRODUCT.Dockerfile - CONTAINER_IMAGE: parity/$PRODUCT - after_script: - - docker logout - # only VERSION information is needed for the deployment - - find ./artifacts/ -depth -not -name VERSION -type f -delete - -publish-docker-subkey: - stage: publish - <<: *publish-docker-release - dependencies: - - build-linux-subkey - variables: - DOCKER_HOST: tcp://localhost:2375 - DOCKER_DRIVER: overlay2 - GIT_STRATEGY: none - PRODUCT: subkey - DOCKERFILE: $PRODUCT.Dockerfile - CONTAINER_IMAGE: parity/$PRODUCT - after_script: - - docker logout - -publish-s3-release: - stage: publish - <<: *build-only - <<: *kubernetes-build - dependencies: - - build-linux-substrate - - build-linux-subkey - image: parity/awscli:latest - variables: - GIT_STRATEGY: none - BUCKET: "releases.parity.io" - PREFIX: "substrate/${ARCH}-${DOCKER_OS}" - script: - - aws s3 sync ./artifacts/ s3://${BUCKET}/${PREFIX}/$(cat ./artifacts/substrate/VERSION)/ - - echo "update objects in latest path" - - aws s3 sync s3://${BUCKET}/${PREFIX}/$(cat ./artifacts/substrate/VERSION)/ s3://${BUCKET}/${PREFIX}/latest/ - after_script: - - aws s3 ls s3://${BUCKET}/${PREFIX}/latest/ - --recursive --human-readable --summarize - - -publish-s3-doc: - stage: publish - image: parity/awscli:latest - allow_failure: true - dependencies: - - build-rust-doc-release - cache: {} - <<: *build-only - <<: *kubernetes-build - variables: - GIT_STRATEGY: none - BUCKET: "releases.parity.io" - PREFIX: "substrate-rustdoc" - script: - - test -r ./crate-docs/index.html || ( - echo "./crate-docs/index.html not present, build:rust:doc:release job not complete"; - exit 1 - ) - - aws s3 sync --delete --size-only --only-show-errors - ./crate-docs/ s3://${BUCKET}/${PREFIX}/ - after_script: - - aws s3 ls s3://${BUCKET}/${PREFIX}/ - --human-readable --summarize - - -publish-gh-doc: - stage: publish - image: parity/tools:latest - allow_failure: true - dependencies: - - build-rust-doc-release - cache: {} - <<: *build-only - <<: *kubernetes-build - variables: - GIT_STRATEGY: none - GITHUB_API: "https://api.github.com" - script: - - test -r ./crate-docs/index.html || ( - echo "./crate-docs/index.html not present, build:rust:doc:release job not complete"; - exit 1 - ) - - test "${GITHUB_USER}" -a "${GITHUB_EMAIL}" -a "${GITHUB_TOKEN}" || ( - echo "environment variables for github insufficient"; - exit 1 - ) - - | - cat > ${HOME}/.gitconfig <&1 | sed -r "s|(${GITHUB_USER}):[a-f0-9]+@|\1:REDACTED@|g" - after_script: - - rm -vrf ${HOME}/.gitconfig - - - -.deploy-template: &deploy - stage: kubernetes - when: manual - retry: 1 - image: parity/kubetools:latest - <<: *build-only - tags: - # this is the runner that is used to deploy it - - kubernetes-parity-build - before_script: - - test -z "${DEPLOY_TAG}" && - test -f ./artifacts/substrate/VERSION && - DEPLOY_TAG="$(cat ./artifacts/substrate/VERSION)" - - test "${DEPLOY_TAG}" || ( echo "Neither DEPLOY_TAG nor VERSION information available"; exit 1 ) - script: - - echo "Substrate version = ${DEPLOY_TAG}" - # or use helm to render the template - - helm template - --values ./.maintain/kubernetes/values.yaml - --set image.tag=${DEPLOY_TAG} - --set validator.keys=${VALIDATOR_KEYS} - ./.maintain/kubernetes | kubectl apply -f - --dry-run=false - - echo "# substrate namespace ${KUBE_NAMESPACE}" - - kubectl -n ${KUBE_NAMESPACE} get all - - echo "# substrate's nodes' external ip addresses:" - - kubectl get nodes -l node=substrate - -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{range @.status.addresses[?(@.type=="ExternalIP")]}{.address}{"\n"}{end}' - - echo "# substrate' nodes" - - kubectl -n ${KUBE_NAMESPACE} get pods - -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.nodeName}{"\n"}{end}' - - echo "# wait for the rollout to complete" - - kubectl -n ${KUBE_NAMESPACE} rollout status statefulset/substrate - -# have environment:url eventually point to the logs - -.deploy-cibuild: &deploy-cibuild - <<: *deploy - dependencies: - - publish-docker-substrate - -.deploy-tag: &deploy-tag - <<: *deploy - only: - variables: - - $DEPLOY_TAG - -# have environment:url eventually point to the logs - -deploy-ew3: - <<: *deploy-cibuild - environment: - name: parity-prod-ew3 - -deploy-ue1: - <<: *deploy-cibuild - environment: - name: parity-prod-ue1 - -deploy-ew3-tag: - <<: *deploy-tag - environment: - name: parity-prod-ew3 - -deploy-ue1-tag: - <<: *deploy-tag - environment: - name: parity-prod-ue1 - -.validator-deploy: &validator-deploy - # script will fail if there is no artifacts/substrate/VERSION - <<: *build-only - stage: flaming-fir - dependencies: - - build-linux-substrate - image: parity/azure-ansible:v1 - allow_failure: true - when: manual - tags: - - linux-docker - -validator 1 4: - <<: *validator-deploy - script: - - ./.maintain/flamingfir-deploy.sh flamingfir-validator1 -validator 2 4: - <<: *validator-deploy - script: - - ./.maintain/flamingfir-deploy.sh flamingfir-validator2 -validator 3 4: - <<: *validator-deploy - script: - - ./.maintain/flamingfir-deploy.sh flamingfir-validator3 -validator 4 4: - <<: *validator-deploy - script: - - ./.maintain/flamingfir-deploy.sh flamingfir-validator4 From bfcc87115ea0989d3ad76d7e59c2c946af847e1c Mon Sep 17 00:00:00 2001 From: Denis P Date: Wed, 19 Feb 2020 16:16:47 +0100 Subject: [PATCH 02/15] fix the tests --- .../tests/construct_runtime_ui/invalid_module_details.stderr | 2 +- .../test/tests/construct_runtime_ui/missing_where_block.stderr | 2 +- .../test/tests/construct_runtime_ui/missing_where_param.stderr | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frame/support/test/tests/construct_runtime_ui/invalid_module_details.stderr b/frame/support/test/tests/construct_runtime_ui/invalid_module_details.stderr index 559a4637d67ff..7f8f5d83cc26e 100644 --- a/frame/support/test/tests/construct_runtime_ui/invalid_module_details.stderr +++ b/frame/support/test/tests/construct_runtime_ui/invalid_module_details.stderr @@ -2,4 +2,4 @@ error: expected curly braces --> $DIR/invalid_module_details.rs:9:19 | 9 | system: System::(), - | ^^ + | ^ diff --git a/frame/support/test/tests/construct_runtime_ui/missing_where_block.stderr b/frame/support/test/tests/construct_runtime_ui/missing_where_block.stderr index 4af672a2610b6..103816dd1a5b3 100644 --- a/frame/support/test/tests/construct_runtime_ui/missing_where_block.stderr +++ b/frame/support/test/tests/construct_runtime_ui/missing_where_block.stderr @@ -2,4 +2,4 @@ error: expected `where` --> $DIR/missing_where_block.rs:4:19 | 4 | pub enum Runtime {} - | ^^ + | ^ diff --git a/frame/support/test/tests/construct_runtime_ui/missing_where_param.stderr b/frame/support/test/tests/construct_runtime_ui/missing_where_param.stderr index ac7313523c0c4..b3d877f730d53 100644 --- a/frame/support/test/tests/construct_runtime_ui/missing_where_param.stderr +++ b/frame/support/test/tests/construct_runtime_ui/missing_where_param.stderr @@ -2,4 +2,4 @@ error: Missing associated type for `UncheckedExtrinsic`. Add `UncheckedExtrinsic --> $DIR/missing_where_param.rs:7:2 | 7 | {} - | ^^ + | ^ From 5ec990eea2a03ac56beeb47159e086ad999bd7c1 Mon Sep 17 00:00:00 2001 From: Denis P Date: Wed, 19 Feb 2020 19:26:05 +0100 Subject: [PATCH 03/15] test with the new image --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e26f9b666abc1..111b72b850cf7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -39,7 +39,7 @@ variables: name: parity-build .docker-env: &docker-env - image: parity/rust-builder:b2c2c71d-20200217 + image: parity/rust-builder:0e1e2f7-20200219 before_script: - rustup show - cargo --version From 8371ff66daef7c78f7086c98823993bb3a6fc9c2 Mon Sep 17 00:00:00 2001 From: Denis P Date: Wed, 19 Feb 2020 20:06:31 +0100 Subject: [PATCH 04/15] test without CARGO_HOME --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 111b72b850cf7..4a93fd4b2a5fc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,8 +16,8 @@ stages: variables: GIT_STRATEGY: fetch GIT_DEPTH: 100 - CARGO_HOME: "/ci-cache/${CI_PROJECT_NAME}/cargo/${CI_JOB_NAME}" - SCCACHE_DIR: "/ci-cache/${CI_PROJECT_NAME}/sccache" + # CARGO_HOME: "/ci-cache/${CI_PROJECT_NAME}/cargo/${CI_JOB_NAME}" + # SCCACHE_DIR: "/ci-cache/${CI_PROJECT_NAME}/sccache" CARGO_INCREMENTAL: 0 CI_SERVER_NAME: "GitLab CI" DOCKER_OS: "debian:stretch" From 9cc109971da67891f52720e48d9a4429408068a4 Mon Sep 17 00:00:00 2001 From: Denis P Date: Wed, 19 Feb 2020 22:08:29 +0100 Subject: [PATCH 05/15] test without fixes --- .../tests/construct_runtime_ui/invalid_module_details.stderr | 2 +- .../test/tests/construct_runtime_ui/missing_where_block.stderr | 2 +- .../test/tests/construct_runtime_ui/missing_where_param.stderr | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frame/support/test/tests/construct_runtime_ui/invalid_module_details.stderr b/frame/support/test/tests/construct_runtime_ui/invalid_module_details.stderr index 7f8f5d83cc26e..559a4637d67ff 100644 --- a/frame/support/test/tests/construct_runtime_ui/invalid_module_details.stderr +++ b/frame/support/test/tests/construct_runtime_ui/invalid_module_details.stderr @@ -2,4 +2,4 @@ error: expected curly braces --> $DIR/invalid_module_details.rs:9:19 | 9 | system: System::(), - | ^ + | ^^ diff --git a/frame/support/test/tests/construct_runtime_ui/missing_where_block.stderr b/frame/support/test/tests/construct_runtime_ui/missing_where_block.stderr index 103816dd1a5b3..4af672a2610b6 100644 --- a/frame/support/test/tests/construct_runtime_ui/missing_where_block.stderr +++ b/frame/support/test/tests/construct_runtime_ui/missing_where_block.stderr @@ -2,4 +2,4 @@ error: expected `where` --> $DIR/missing_where_block.rs:4:19 | 4 | pub enum Runtime {} - | ^ + | ^^ diff --git a/frame/support/test/tests/construct_runtime_ui/missing_where_param.stderr b/frame/support/test/tests/construct_runtime_ui/missing_where_param.stderr index b3d877f730d53..ac7313523c0c4 100644 --- a/frame/support/test/tests/construct_runtime_ui/missing_where_param.stderr +++ b/frame/support/test/tests/construct_runtime_ui/missing_where_param.stderr @@ -2,4 +2,4 @@ error: Missing associated type for `UncheckedExtrinsic`. Add `UncheckedExtrinsic --> $DIR/missing_where_param.rs:7:2 | 7 | {} - | ^ + | ^^ From 2a408c46e406188eb73de3308fc689bfa89d74f9 Mon Sep 17 00:00:00 2001 From: Denis P Date: Fri, 21 Feb 2020 12:19:17 +0100 Subject: [PATCH 06/15] test again --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4a93fd4b2a5fc..98f6fe4d178d2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,7 +16,7 @@ stages: variables: GIT_STRATEGY: fetch GIT_DEPTH: 100 - # CARGO_HOME: "/ci-cache/${CI_PROJECT_NAME}/cargo/${CI_JOB_NAME}" + CARGO_HOME: "/ci-cache/${CI_PROJECT_NAME}/cargo/${CI_JOB_NAME}" # SCCACHE_DIR: "/ci-cache/${CI_PROJECT_NAME}/sccache" CARGO_INCREMENTAL: 0 CI_SERVER_NAME: "GitLab CI" From 099b6ff5ba742497aeaf7afa5c7ddf88cc720e6b Mon Sep 17 00:00:00 2001 From: Denis P Date: Fri, 21 Feb 2020 13:00:57 +0100 Subject: [PATCH 07/15] fix trybuild old versions --- frame/support/test/Cargo.toml | 2 +- primitives/api/test/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frame/support/test/Cargo.toml b/frame/support/test/Cargo.toml index 71d3893426f06..6cb5f12876769 100644 --- a/frame/support/test/Cargo.toml +++ b/frame/support/test/Cargo.toml @@ -14,7 +14,7 @@ frame-support = { version = "2.0.0", default-features = false, path = "../" } sp-inherents = { version = "2.0.0", default-features = false, path = "../../../primitives/inherents" } sp-runtime = { version = "2.0.0", default-features = false, path = "../../../primitives/runtime" } sp-core = { version = "2.0.0", default-features = false, path = "../../../primitives/core" } -trybuild = "1.0.17" +trybuild = "=1.0.17" pretty_assertions = "0.6.1" [features] diff --git a/primitives/api/test/Cargo.toml b/primitives/api/test/Cargo.toml index c193c9dc5ef3c..7c990f9702b43 100644 --- a/primitives/api/test/Cargo.toml +++ b/primitives/api/test/Cargo.toml @@ -14,7 +14,7 @@ sp-blockchain = { version = "2.0.0", path = "../../blockchain" } sp-consensus = { version = "0.8", path = "../../../primitives/consensus/common" } codec = { package = "parity-scale-codec", version = "1.0.0" } sp-state-machine = { version = "0.8", path = "../../../primitives/state-machine" } -trybuild = "1.0.17" +trybuild = "=1.0.17" rustversion = "1.0.0" [dev-dependencies] From 64198b72dec2aad997a423ee958c4e041a682072 Mon Sep 17 00:00:00 2001 From: Denis P Date: Fri, 21 Feb 2020 13:06:22 +0100 Subject: [PATCH 08/15] bump CArgo.lock --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b557048f9d36a..b937c2820a5fe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8349,9 +8349,9 @@ checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" [[package]] name = "trybuild" -version = "1.0.21" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f5b3f750c701725331ac78e389b5d143b7d25f6b6ffffd0d419759a9063ac5f" +checksum = "e6851bf8351876984fbab8a2391de6378947b898410d8714edd12164d2137127" dependencies = [ "glob 0.3.0", "lazy_static", From 41b1b7c873324eb2c9aca6c4c70aa123d6933bdd Mon Sep 17 00:00:00 2001 From: Denis P Date: Fri, 21 Feb 2020 13:48:18 +0100 Subject: [PATCH 09/15] fix trybuild newest versions --- frame/support/test/Cargo.toml | 2 +- primitives/api/test/Cargo.toml | 2 +- primitives/runtime-interface/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frame/support/test/Cargo.toml b/frame/support/test/Cargo.toml index 6cb5f12876769..2362db88765fa 100644 --- a/frame/support/test/Cargo.toml +++ b/frame/support/test/Cargo.toml @@ -14,7 +14,7 @@ frame-support = { version = "2.0.0", default-features = false, path = "../" } sp-inherents = { version = "2.0.0", default-features = false, path = "../../../primitives/inherents" } sp-runtime = { version = "2.0.0", default-features = false, path = "../../../primitives/runtime" } sp-core = { version = "2.0.0", default-features = false, path = "../../../primitives/core" } -trybuild = "=1.0.17" +trybuild = "1.0.23" pretty_assertions = "0.6.1" [features] diff --git a/primitives/api/test/Cargo.toml b/primitives/api/test/Cargo.toml index 7c990f9702b43..dd779edfa6088 100644 --- a/primitives/api/test/Cargo.toml +++ b/primitives/api/test/Cargo.toml @@ -14,7 +14,7 @@ sp-blockchain = { version = "2.0.0", path = "../../blockchain" } sp-consensus = { version = "0.8", path = "../../../primitives/consensus/common" } codec = { package = "parity-scale-codec", version = "1.0.0" } sp-state-machine = { version = "0.8", path = "../../../primitives/state-machine" } -trybuild = "=1.0.17" +trybuild = "1.0.23" rustversion = "1.0.0" [dev-dependencies] diff --git a/primitives/runtime-interface/Cargo.toml b/primitives/runtime-interface/Cargo.toml index cef3acdbfbbb3..b24dff905fe06 100644 --- a/primitives/runtime-interface/Cargo.toml +++ b/primitives/runtime-interface/Cargo.toml @@ -20,7 +20,7 @@ sp-state-machine = { version = "0.8", path = "../../primitives/state-machine" } sp-core = { version = "2.0.0", path = "../core" } sp-io = { version = "2.0.0", path = "../io" } rustversion = "1.0.0" -trybuild = "1.0.17" +trybuild = "1.0.23" [features] default = [ "std" ] From c9224bbebae8a33d6493187f1582fbe9e4a9c64a Mon Sep 17 00:00:00 2001 From: Denis P Date: Fri, 21 Feb 2020 13:49:42 +0100 Subject: [PATCH 10/15] bump Cargo.lock --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b937c2820a5fe..61e94c99b5b4a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8349,9 +8349,9 @@ checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" [[package]] name = "trybuild" -version = "1.0.17" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6851bf8351876984fbab8a2391de6378947b898410d8714edd12164d2137127" +checksum = "26ff1b18659a2218332848d76ad1c867ce4c6ee37b085e6bc8de9a6d11401220" dependencies = [ "glob 0.3.0", "lazy_static", From 8bb57bab9ca9a01d43835e158f701903cce239b5 Mon Sep 17 00:00:00 2001 From: Denis P Date: Fri, 21 Feb 2020 14:12:09 +0100 Subject: [PATCH 11/15] trying on the latest image --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 98f6fe4d178d2..4ac2928cd451d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,7 +17,6 @@ variables: GIT_STRATEGY: fetch GIT_DEPTH: 100 CARGO_HOME: "/ci-cache/${CI_PROJECT_NAME}/cargo/${CI_JOB_NAME}" - # SCCACHE_DIR: "/ci-cache/${CI_PROJECT_NAME}/sccache" CARGO_INCREMENTAL: 0 CI_SERVER_NAME: "GitLab CI" DOCKER_OS: "debian:stretch" @@ -39,7 +38,7 @@ variables: name: parity-build .docker-env: &docker-env - image: parity/rust-builder:0e1e2f7-20200219 + image: parity/rust-builder:00f5094-20200221 before_script: - rustup show - cargo --version From 07adb5ed0a39915af880c5f3a291275075670f4a Mon Sep 17 00:00:00 2001 From: Denis P Date: Fri, 21 Feb 2020 14:26:28 +0100 Subject: [PATCH 12/15] bump Cargo.lock --- Cargo.lock | 222 ++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 160 insertions(+), 62 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fff34f7eb6856..e5bf138c523d2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -446,6 +446,12 @@ dependencies = [ "wasm-bindgen-futures", ] +[[package]] +name = "bs58" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c95ee6bba9d950218b6cc910cf62bc9e0a171d0f4537e3627b0f54d08549b188" + [[package]] name = "bs58" version = "0.3.0" @@ -610,7 +616,6 @@ dependencies = [ "js-sys", "num-integer", "num-traits", - "serde", "time", "wasm-bindgen", ] @@ -1441,6 +1446,32 @@ dependencies = [ "parity-scale-codec", ] +[[package]] +name = "frame-benchmarking" +version = "2.0.0" +dependencies = [ + "parity-scale-codec", + "sp-api", + "sp-io", + "sp-runtime-interface", + "sp-std", +] + +[[package]] +name = "frame-benchmarking-cli" +version = "2.0.0" +dependencies = [ + "frame-benchmarking", + "parity-scale-codec", + "sc-cli", + "sc-client", + "sc-client-db", + "sc-executor", + "sc-service", + "sp-runtime", + "structopt", +] + [[package]] name = "frame-executive" version = "2.0.0" @@ -1927,34 +1958,6 @@ dependencies = [ "scroll", ] -[[package]] -name = "grafana-data-source" -version = "0.8.0" -dependencies = [ - "async-std", - "chrono", - "derive_more", - "futures-timer 3.0.1", - "futures-util", - "hyper 0.13.2", - "lazy_static", - "log 0.4.8", - "parking_lot 0.10.0", - "serde", - "serde_json", - "tokio 0.2.11", -] - -[[package]] -name = "grafana-data-source-test" -version = "2.0.0" -dependencies = [ - "futures 0.3.4", - "futures-timer 3.0.1", - "grafana-data-source", - "rand 0.7.3", -] - [[package]] name = "h2" version = "0.1.26" @@ -2634,9 +2637,9 @@ dependencies = [ [[package]] name = "libp2p" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a58becf0b9585fcfbb8215bbe6e6ac187fcc180fd1026925ca180c845aa5a6e8" +checksum = "f6bf152b510950e1030f2d3dcca5f0b4017892be50348a15fd3eec8b90c826fb" dependencies = [ "bytes 0.5.4", "futures 0.3.4", @@ -2662,8 +2665,8 @@ dependencies = [ "libp2p-wasm-ext", "libp2p-websocket", "libp2p-yamux", - "parity-multiaddr", - "parity-multihash", + "parity-multiaddr 0.7.2", + "parity-multihash 0.2.3", "parking_lot 0.10.0", "pin-project", "smallvec 1.2.0", @@ -2677,7 +2680,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b874594c4b29de1a29f27871feba8e6cd13aa54a8a1e8f8c7cf3dfac5ca287c" dependencies = [ "asn1_der", - "bs58", + "bs58 0.3.0", "ed25519-dalek", "fnv", "futures 0.3.4", @@ -2686,8 +2689,8 @@ dependencies = [ "libsecp256k1", "log 0.4.8", "multistream-select", - "parity-multiaddr", - "parity-multihash", + "parity-multiaddr 0.7.2", + "parity-multihash 0.2.3", "parking_lot 0.10.0", "pin-project", "prost", @@ -2698,7 +2701,7 @@ dependencies = [ "sha2", "smallvec 1.2.0", "thiserror", - "unsigned-varint", + "unsigned-varint 0.3.1", "void", "zeroize 1.1.0", ] @@ -2773,7 +2776,7 @@ dependencies = [ "rand 0.7.3", "sha2", "smallvec 1.2.0", - "unsigned-varint", + "unsigned-varint 0.3.1", "wasm-timer", ] @@ -2795,9 +2798,9 @@ dependencies = [ [[package]] name = "libp2p-kad" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2efcff2af085e8181c421f68fe9c2b0a067379d146731925b3ac8f8e605c458" +checksum = "76c260a92309112fff855ab2bd8f26c246c1dd380b87021abe61358dedb9748d" dependencies = [ "arrayvec 0.5.1", "bytes 0.5.4", @@ -2808,14 +2811,14 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log 0.4.8", - "parity-multihash", + "parity-multihash 0.2.3", "prost", "prost-build", "rand 0.7.3", "sha2", "smallvec 1.2.0", "uint", - "unsigned-varint", + "unsigned-varint 0.3.1", "void", "wasm-timer", ] @@ -2855,7 +2858,7 @@ dependencies = [ "libp2p-core", "log 0.4.8", "parking_lot 0.10.0", - "unsigned-varint", + "unsigned-varint 0.3.1", ] [[package]] @@ -2908,7 +2911,7 @@ dependencies = [ "prost", "prost-build", "rw-stream-sink", - "unsigned-varint", + "unsigned-varint 0.3.1", "void", ] @@ -2928,9 +2931,9 @@ dependencies = [ [[package]] name = "libp2p-secio" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec00eb9a3404ed76a0e14f637edcaa7f2b4a27a16884da4a56f2f21e166c2843" +checksum = "1219e9ecb4945d7331a05f5ffe96a1f6e28051bfa1223d4c60353c251de0354e" dependencies = [ "aes-ctr", "ctr", @@ -2958,9 +2961,9 @@ dependencies = [ [[package]] name = "libp2p-swarm" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1e9f4fb84a4bfe3d3a361c1fbcd4af017ba68f0a46a77bfbcc48bf8a456d6ef" +checksum = "275471e7c0e88ae004660866cd54f603bd8bd1f4caef541a27f50dd8640c4d4c" dependencies = [ "futures 0.3.4", "libp2p-core", @@ -2999,9 +3002,9 @@ dependencies = [ [[package]] name = "libp2p-wasm-ext" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39703653caa36f4afd0def39cc49a3ac0fa1d4289ca1802e417af03e4f5ef950" +checksum = "7d40c95ac1a9b7fb7770616e4165f34559885337f3be485b32acdd085261be3a" dependencies = [ "futures 0.3.4", "js-sys", @@ -3309,7 +3312,7 @@ dependencies = [ "log 0.4.8", "smallvec 1.2.0", "tokio-io", - "unsigned-varint", + "unsigned-varint 0.3.1", ] [[package]] @@ -3369,6 +3372,7 @@ version = "2.0.0" dependencies = [ "assert_cmd", "browser-utils", + "frame-benchmarking-cli", "frame-support", "frame-system", "futures 0.3.4", @@ -3411,6 +3415,7 @@ dependencies = [ "sc-tracing", "sc-transaction-pool", "serde", + "serde_json", "sp-authority-discovery", "sp-consensus", "sp-consensus-babe", @@ -3437,6 +3442,7 @@ name = "node-executor" version = "2.0.0" dependencies = [ "criterion 0.3.1", + "frame-benchmarking", "frame-support", "frame-system", "node-primitives", @@ -3530,6 +3536,7 @@ dependencies = [ name = "node-runtime" version = "2.0.0" dependencies = [ + "frame-benchmarking", "frame-executive", "frame-support", "frame-system", @@ -3966,6 +3973,7 @@ dependencies = [ name = "pallet-balances" version = "2.0.0" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", "pallet-transaction-payment", @@ -4143,6 +4151,21 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-example-offchain-worker" +version = "2.0.0" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec", + "serde", + "serde_json", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-finality-tracker" version = "2.0.0" @@ -4197,6 +4220,7 @@ name = "pallet-identity" version = "2.0.0" dependencies = [ "enumflags2", + "frame-benchmarking", "frame-support", "frame-system", "pallet-balances", @@ -4433,6 +4457,7 @@ dependencies = [ name = "pallet-timestamp" version = "2.0.0" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", "impl-trait-for-tuples", @@ -4545,6 +4570,24 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c276d76c5333b8c2579e02d49a06733a55b8282d2d9b13e8d53b6406bd7e30a" +[[package]] +name = "parity-multiaddr" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "045b3c7af871285146300da35b1932bb6e4639b66c7c98e85d06a32cbc4e8fa7" +dependencies = [ + "arrayref", + "bs58 0.2.5", + "byteorder 1.3.4", + "bytes 0.4.12", + "data-encoding", + "parity-multihash 0.1.3", + "percent-encoding 1.0.1", + "serde", + "unsigned-varint 0.2.3", + "url 1.7.2", +] + [[package]] name = "parity-multiaddr" version = "0.7.2" @@ -4552,17 +4595,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26df883298bc3f4e92528b4c5cc9f806b791955b136da3e5e939ed9de0fd958b" dependencies = [ "arrayref", - "bs58", + "bs58 0.3.0", "byteorder 1.3.4", "data-encoding", - "parity-multihash", + "parity-multihash 0.2.3", "percent-encoding 2.1.0", "serde", "static_assertions", - "unsigned-varint", + "unsigned-varint 0.3.1", "url 2.1.1", ] +[[package]] +name = "parity-multihash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3a17dc27848fd99e4f87eb0f8c9baba6ede0a6d555400c850ca45254ef4ce3" +dependencies = [ + "blake2", + "bytes 0.4.12", + "rand 0.6.5", + "sha-1", + "sha2", + "sha3", + "unsigned-varint 0.2.3", +] + [[package]] name = "parity-multihash" version = "0.2.3" @@ -4575,7 +4633,7 @@ dependencies = [ "sha-1", "sha2", "sha3", - "unsigned-varint", + "unsigned-varint 0.3.1", ] [[package]] @@ -4949,6 +5007,33 @@ dependencies = [ "unicode-xid 0.2.0", ] +[[package]] +name = "prometheus" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5567486d5778e2c6455b1b90ff1c558f29e751fc018130fa182e15828e728af1" +dependencies = [ + "cfg-if", + "fnv", + "lazy_static", + "protobuf", + "quick-error", + "spin", +] + +[[package]] +name = "prometheus-exporter" +version = "0.8.0" +dependencies = [ + "async-std", + "derive_more", + "futures-util", + "hyper 0.13.2", + "log 0.4.8", + "prometheus", + "tokio 0.2.11", +] + [[package]] name = "prost" version = "0.6.1" @@ -5000,6 +5085,12 @@ dependencies = [ "prost", ] +[[package]] +name = "protobuf" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6686ddd96a8dbe2687b5f2a687b2cfb520854010ec480f2d74c32e7c9873d3c5" + [[package]] name = "pwasm-utils" version = "0.12.0" @@ -5637,6 +5728,7 @@ dependencies = [ "log 0.4.8", "names", "parity-util-mem", + "prometheus-exporter", "regex", "rpassword", "sc-client-api", @@ -6143,6 +6235,7 @@ dependencies = [ "nohash-hasher", "parity-scale-codec", "parking_lot 0.10.0", + "pin-project", "prost", "prost-build", "quickcheck", @@ -6170,7 +6263,7 @@ dependencies = [ "substrate-test-runtime-client", "tempfile", "thiserror", - "unsigned-varint", + "unsigned-varint 0.3.1", "void", "wasm-timer", "zeroize 1.1.0", @@ -6180,7 +6273,6 @@ dependencies = [ name = "sc-network-gossip" version = "0.8.0" dependencies = [ - "futures 0.1.29", "futures 0.3.4", "futures-timer 3.0.1", "libp2p", @@ -6358,13 +6450,13 @@ dependencies = [ "futures 0.3.4", "futures-diagnose", "futures-timer 3.0.1", - "grafana-data-source", "lazy_static", "log 0.4.8", - "parity-multiaddr", + "parity-multiaddr 0.5.0", "parity-scale-codec", "parity-util-mem", "parking_lot 0.10.0", + "prometheus-exporter", "sc-chain-spec", "sc-client", "sc-client-api", @@ -6458,7 +6550,6 @@ name = "sc-tracing" version = "2.0.0" dependencies = [ "erased-serde", - "grafana-data-source", "log 0.4.8", "parking_lot 0.10.0", "sc-telemetry", @@ -8467,11 +8558,18 @@ checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" [[package]] name = "unsigned-varint" -version = "0.3.0" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7f0023a96687fe169081e8adce3f65e3874426b7886e9234d490af2dc077959" + +[[package]] +name = "unsigned-varint" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c689459fbaeb50e56c6749275f084decfd02194ac5852e6617d95d0d3cf02eaf" +checksum = "3b7ffb36714206d2f5f05d61a2bc350415c642f2c54433f0ebf829afbe41d570" dependencies = [ "bytes 0.5.4", + "futures 0.3.4", "futures_codec", ] From cdaf75977a9bbf3386b0136242664367f9691d63 Mon Sep 17 00:00:00 2001 From: Denis P Date: Fri, 21 Feb 2020 14:40:45 +0100 Subject: [PATCH 13/15] run with the old image --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4ac2928cd451d..ce246c2ebfecd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -38,7 +38,7 @@ variables: name: parity-build .docker-env: &docker-env - image: parity/rust-builder:00f5094-20200221 + image: parity/rust-builder:latest before_script: - rustup show - cargo --version From b6b10a3b17e8c3be94982e37b006d3f8d73a1bfa Mon Sep 17 00:00:00 2001 From: Denis P Date: Fri, 21 Feb 2020 15:03:23 +0100 Subject: [PATCH 14/15] ci will be green on the image from 2020-02-19 [skip ci] --- .gitlab-ci.yml | 553 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 553 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ce246c2ebfecd..36e1da8d108da 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,6 +5,21 @@ # pipelines can be triggered manually in the web # setting DEPLOY_TAG will only deploy the tagged image +# SAMPLE JOB TEMPLATE - This is not a complete example but is enough to build a +# simple CI job. For full documentation, visit https://docs.gitlab.com/ee/ci/yaml/ +# +# my-example-job: +# stage: test # One of the stages listed below this job (required) +# image: parity/tools:latest # Any docker image (required) +# allow_failure: true # Allow the pipeline to continue if this job fails (default: false) +# dependencies: +# - build-rust-doc-release # Any jobs that are required to run before this job (optional) +# variables: +# MY_ENVIRONMENT_VARIABLE: "some useful value" # Environment variables passed to the job (optional) +# script: +# - echo "List of shell commands to run in your job" +# - echo "You can also just specify a script here, like so:" +# - ./scripts/gitlab/my_amazing_script.sh stages: - test @@ -17,6 +32,7 @@ variables: GIT_STRATEGY: fetch GIT_DEPTH: 100 CARGO_HOME: "/ci-cache/${CI_PROJECT_NAME}/cargo/${CI_JOB_NAME}" + SCCACHE_DIR: "/ci-cache/${CI_PROJECT_NAME}/sccache" CARGO_INCREMENTAL: 0 CI_SERVER_NAME: "GitLab CI" DOCKER_OS: "debian:stretch" @@ -71,6 +87,62 @@ variables: #### stage: test +check-runtime: + stage: test + image: parity/tools:latest + <<: *kubernetes-build + only: + - /^[0-9]+$/ + variables: + GITLAB_API: "https://gitlab.parity.io/api/v4" + GITHUB_API_PROJECT: "parity%2Finfrastructure%2Fgithub-api" + script: + - ./.maintain/gitlab/check_runtime.sh + interruptible: true + allow_failure: true + + +check-line-width: + stage: test + image: parity/tools:latest + <<: *kubernetes-build + only: + - /^[0-9]+$/ + script: + - ./.maintain/gitlab/check_line_width.sh + interruptible: true + allow_failure: true + + +cargo-audit: + stage: test + <<: *docker-env + except: + - /^[0-9]+$/ + script: + - cargo audit + allow_failure: true + + +cargo-check-benches: + stage: test + <<: *docker-env + script: + - BUILD_DUMMY_WASM_BINARY=1 time cargo +nightly check --benches --all + - sccache -s + + +cargo-check-subkey: + stage: test + <<: *docker-env + except: + - /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 + script: + - cd ./bin/utils/subkey + - BUILD_DUMMY_WASM_BINARY=1 time cargo check --release + - sccache -s + + test-linux-stable: &test-linux stage: test <<: *docker-env @@ -93,3 +165,484 @@ test-linux-stable: &test-linux expire_in: 3 days paths: - ${CI_COMMIT_SHORT_SHA}_warnings.log + +test-dependency-rules: + stage: test + <<: *docker-env + except: + variables: + - $DEPLOY_TAG + script: + - .maintain/ensure-deps.sh + +test-frame-staking: + stage: test + <<: *docker-env + variables: + # Enable debug assertions since we are running optimized builds for testing + # but still want to have debug assertions. + RUSTFLAGS: -Cdebug-assertions=y + RUST_BACKTRACE: 1 + except: + variables: + - $DEPLOY_TAG + script: + - cd frame/staking/ + - WASM_BUILD_NO_COLOR=1 time cargo test --release --verbose --no-default-features --features std + - sccache -s + +test-wasmtime: + stage: test + <<: *docker-env + variables: + # Enable debug assertions since we are running optimized builds for testing + # but still want to have debug assertions. + RUSTFLAGS: -Cdebug-assertions=y + RUST_BACKTRACE: 1 + except: + variables: + - $DEPLOY_TAG + script: + - cd client/executor + - WASM_BUILD_NO_COLOR=1 time cargo test --release --verbose --features wasmtime + - sccache -s + +test-linux-stable-int: + <<: *test-linux + except: + refs: + - /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 + variables: + - $DEPLOY_TAG + script: + - echo "___Logs will be partly shown at the end in case of failure.___" + - echo "___Full log will be saved to the job artifacts only in case of failure.___" + - WASM_BUILD_NO_COLOR=1 RUST_LOG=sync=trace,consensus=trace,client=trace,state-db=trace,db=trace,forks=trace,state_db=trace,storage_cache=trace + time cargo test -p node-cli --release --verbose --locked -- --ignored + &> ${CI_COMMIT_SHORT_SHA}_int_failure.log + - sccache -s + after_script: + - awk '/FAILED|^error\[/,0' ${CI_COMMIT_SHORT_SHA}_int_failure.log + artifacts: + name: $CI_COMMIT_SHORT_SHA + when: on_failure + expire_in: 3 days + paths: + - ${CI_COMMIT_SHORT_SHA}_int_failure.log + + +check-web-wasm: + stage: test + <<: *docker-env + except: + - /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 + script: + # WASM support is in progress. As more and more crates support WASM, we + # should add entries here. See https://github.com/paritytech/substrate/issues/2416 + - time cargo build --target=wasm32-unknown-unknown -p sp-io + - time cargo build --target=wasm32-unknown-unknown -p sp-runtime + - time cargo build --target=wasm32-unknown-unknown -p sp-std + - time cargo build --target=wasm32-unknown-unknown -p sc-client + - time cargo build --target=wasm32-unknown-unknown -p sc-consensus-aura + - time cargo build --target=wasm32-unknown-unknown -p sc-consensus-babe + - time cargo build --target=wasm32-unknown-unknown -p sp-consensus + - time cargo build --target=wasm32-unknown-unknown -p sc-telemetry + # Note: the command below is a bit weird because several Cargo issues prevent us from compiling the node in a more straight-forward way. + - time cargo build --manifest-path=bin/node/cli/Cargo.toml --no-default-features --features "browser" --target=wasm32-unknown-unknown + - sccache -s + +test-full-crypto-feature: + stage: test + <<: *docker-env + variables: + # Enable debug assertions since we are running optimized builds for testing + # but still want to have debug assertions. + RUSTFLAGS: -Cdebug-assertions=y + RUST_BACKTRACE: 1 + except: + variables: + - $DEPLOY_TAG + script: + - cd primitives/core/ + - time cargo +nightly build --verbose --no-default-features --features full_crypto + - cd ../application-crypto + - time cargo +nightly build --verbose --no-default-features --features full_crypto + - sccache -s + + +#### stage: build + +build-linux-substrate: &build-binary + stage: build + <<: *collect-artifacts + <<: *docker-env + <<: *build-only + before_script: + - mkdir -p ./artifacts/substrate/ + except: + variables: + - $DEPLOY_TAG + script: + - WASM_BUILD_NO_COLOR=1 time cargo build --release --verbose + - mv ./target/release/substrate ./artifacts/substrate/. + - echo -n "Substrate version = " + - if [ "${CI_COMMIT_TAG}" ]; then + echo "${CI_COMMIT_TAG}" | tee ./artifacts/substrate/VERSION; + else + ./artifacts/substrate/substrate --version | + sed -n -r 's/^substrate ([0-9.]+.*-[0-9a-f]{7,13})-.*$/\1/p' | + tee ./artifacts/substrate/VERSION; + fi + - sha256sum ./artifacts/substrate/substrate | tee ./artifacts/substrate/substrate.sha256 + - printf '\n# building node-template\n\n' + - ./.maintain/node-template-release.sh ./artifacts/substrate/substrate-node-template.tar.gz + - cp -r .maintain/docker/substrate.Dockerfile ./artifacts/substrate/ + - sccache -s + +build-linux-subkey: + <<: *build-binary + before_script: + - mkdir -p ./artifacts/subkey + script: + - cd ./bin/utils/subkey + - BUILD_DUMMY_WASM_BINARY=1 time cargo build --release --verbose + - cd - + - mv ./target/release/subkey ./artifacts/subkey/. + - echo -n "Subkey version = " + - ./artifacts/subkey/subkey --version | + sed -n -r 's/^subkey ([0-9.]+.*)/\1/p' | + tee ./artifacts/subkey/VERSION; + - sha256sum ./artifacts/subkey/subkey | tee ./artifacts/subkey/subkey.sha256 + - cp -r .maintain/docker/subkey.Dockerfile ./artifacts/subkey/ + - sccache -s + +build-rust-doc-release: + stage: build + <<: *docker-env + allow_failure: true + artifacts: + name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}-doc" + when: on_success + expire_in: 7 days + paths: + - ./crate-docs + <<: *build-only + script: + - rm -f ./crate-docs/index.html # use it as an indicator if the job succeeds + - BUILD_DUMMY_WASM_BINARY=1 RUSTDOCFLAGS="--html-in-header $(pwd)/.maintain/rustdoc-header.html" time cargo +nightly doc --release --all --verbose + - cp -R ./target/doc ./crate-docs + - echo "" > ./crate-docs/index.html + - sccache -s + +check_warnings: + stage: build + <<: *docker-env + except: + variables: + - $DEPLOY_TAG + variables: + GIT_STRATEGY: none + dependencies: + - test-linux-stable + script: + - if [ -s ${CI_COMMIT_SHORT_SHA}_warnings.log ]; then + cat ${CI_COMMIT_SHORT_SHA}_warnings.log; + exit 1; + else + echo "___No warnings___"; + fi + allow_failure: true + +# Nightly check whether Polkadot 'master' branch builds. +check_polkadot: + stage: build + <<: *docker-env + allow_failure: true + only: + - master + - schedules + script: + - SUBSTRATE_PATH=$(pwd) + # Clone the current Polkadot master branch into ./polkadot. + - git clone --depth 1 https://gitlab.parity.io/parity/polkadot.git + - cd polkadot + # Make sure we override the crates in native and wasm build + - mkdir .cargo + - echo "paths = [ \"$SUBSTRATE_PATH\" ]" > .cargo/config + - mkdir -p target/debug/wbuild/.cargo + - echo "paths = [ \"$SUBSTRATE_PATH\" ]" > target/debug/wbuild/.cargo/config + # package, others are updated along the way. + - cargo update + # Check whether Polkadot 'master' branch builds with this Substrate commit. + - time cargo check + - cd - + - sccache -s + +trigger-contracts-ci: + stage: publish + needs: + - job: build-linux-substrate + artifacts: false + - job: test-linux-stable + artifacts: false + trigger: + project: parity/srml-contracts-waterfall + branch: master + strategy: depend + only: + - master + - schedules + +#### stage: publish + +.publish-docker-release: &publish-docker-release + <<: *build-only + <<: *kubernetes-build + image: docker:stable + services: + - docker:dind + before_script: + - test "$Docker_Hub_User_Parity" -a "$Docker_Hub_Pass_Parity" + || ( echo "no docker credentials provided"; exit 1 ) + - docker login -u "$Docker_Hub_User_Parity" -p "$Docker_Hub_Pass_Parity" + - docker info + script: + - cd ./artifacts/$PRODUCT/ + - VERSION="$(cat ./VERSION)" + - echo "${PRODUCT} version = ${VERSION}" + - test -z "${VERSION}" && exit 1 + - docker build + --build-arg VCS_REF="${CI_COMMIT_SHA}" + --build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" + --tag $CONTAINER_IMAGE:$VERSION + --tag $CONTAINER_IMAGE:latest + --file $DOCKERFILE . + - docker push $CONTAINER_IMAGE:$VERSION + - docker push $CONTAINER_IMAGE:latest + +publish-docker-substrate: + stage: publish + <<: *publish-docker-release + # collect VERSION artifact here to pass it on to kubernetes + <<: *collect-artifacts + dependencies: + - build-linux-substrate + variables: + DOCKER_HOST: tcp://localhost:2375 + DOCKER_DRIVER: overlay2 + GIT_STRATEGY: none + PRODUCT: substrate + DOCKERFILE: $PRODUCT.Dockerfile + CONTAINER_IMAGE: parity/$PRODUCT + after_script: + - docker logout + # only VERSION information is needed for the deployment + - find ./artifacts/ -depth -not -name VERSION -type f -delete + +publish-docker-subkey: + stage: publish + <<: *publish-docker-release + dependencies: + - build-linux-subkey + variables: + DOCKER_HOST: tcp://localhost:2375 + DOCKER_DRIVER: overlay2 + GIT_STRATEGY: none + PRODUCT: subkey + DOCKERFILE: $PRODUCT.Dockerfile + CONTAINER_IMAGE: parity/$PRODUCT + after_script: + - docker logout + +publish-s3-release: + stage: publish + <<: *build-only + <<: *kubernetes-build + dependencies: + - build-linux-substrate + - build-linux-subkey + image: parity/awscli:latest + variables: + GIT_STRATEGY: none + BUCKET: "releases.parity.io" + PREFIX: "substrate/${ARCH}-${DOCKER_OS}" + script: + - aws s3 sync ./artifacts/ s3://${BUCKET}/${PREFIX}/$(cat ./artifacts/substrate/VERSION)/ + - echo "update objects in latest path" + - aws s3 sync s3://${BUCKET}/${PREFIX}/$(cat ./artifacts/substrate/VERSION)/ s3://${BUCKET}/${PREFIX}/latest/ + after_script: + - aws s3 ls s3://${BUCKET}/${PREFIX}/latest/ + --recursive --human-readable --summarize + + +publish-s3-doc: + stage: publish + image: parity/awscli:latest + allow_failure: true + dependencies: + - build-rust-doc-release + cache: {} + <<: *build-only + <<: *kubernetes-build + variables: + GIT_STRATEGY: none + BUCKET: "releases.parity.io" + PREFIX: "substrate-rustdoc" + script: + - test -r ./crate-docs/index.html || ( + echo "./crate-docs/index.html not present, build:rust:doc:release job not complete"; + exit 1 + ) + - aws s3 sync --delete --size-only --only-show-errors + ./crate-docs/ s3://${BUCKET}/${PREFIX}/ + after_script: + - aws s3 ls s3://${BUCKET}/${PREFIX}/ + --human-readable --summarize + + +publish-gh-doc: + stage: publish + image: parity/tools:latest + allow_failure: true + dependencies: + - build-rust-doc-release + cache: {} + <<: *build-only + <<: *kubernetes-build + variables: + GIT_STRATEGY: none + GITHUB_API: "https://api.github.com" + script: + - test -r ./crate-docs/index.html || ( + echo "./crate-docs/index.html not present, build:rust:doc:release job not complete"; + exit 1 + ) + - test "${GITHUB_USER}" -a "${GITHUB_EMAIL}" -a "${GITHUB_TOKEN}" || ( + echo "environment variables for github insufficient"; + exit 1 + ) + - | + cat > ${HOME}/.gitconfig <&1 | sed -r "s|(${GITHUB_USER}):[a-f0-9]+@|\1:REDACTED@|g" + after_script: + - rm -vrf ${HOME}/.gitconfig + +publish-draft-release: + stage: publish + image: parity/tools:latest + only: + - tags + - /^v[0-9]+\.[0-9]+\.[0-9]+.*$/ + script: + - ./scripts/gitlab/publish_draft_release.sh + interruptible: true + allow_failure: true + +.deploy-template: &deploy + stage: kubernetes + when: manual + retry: 1 + image: parity/kubetools:latest + <<: *build-only + tags: + # this is the runner that is used to deploy it + - kubernetes-parity-build + before_script: + - test -z "${DEPLOY_TAG}" && + test -f ./artifacts/substrate/VERSION && + DEPLOY_TAG="$(cat ./artifacts/substrate/VERSION)" + - test "${DEPLOY_TAG}" || ( echo "Neither DEPLOY_TAG nor VERSION information available"; exit 1 ) + script: + - echo "Substrate version = ${DEPLOY_TAG}" + # or use helm to render the template + - helm template + --values ./.maintain/kubernetes/values.yaml + --set image.tag=${DEPLOY_TAG} + --set validator.keys=${VALIDATOR_KEYS} + ./.maintain/kubernetes | kubectl apply -f - --dry-run=false + - echo "# substrate namespace ${KUBE_NAMESPACE}" + - kubectl -n ${KUBE_NAMESPACE} get all + - echo "# substrate's nodes' external ip addresses:" + - kubectl get nodes -l node=substrate + -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{range @.status.addresses[?(@.type=="ExternalIP")]}{.address}{"\n"}{end}' + - echo "# substrate' nodes" + - kubectl -n ${KUBE_NAMESPACE} get pods + -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.nodeName}{"\n"}{end}' + - echo "# wait for the rollout to complete" + - kubectl -n ${KUBE_NAMESPACE} rollout status statefulset/substrate + +# have environment:url eventually point to the logs + +.deploy-cibuild: &deploy-cibuild + <<: *deploy + dependencies: + - publish-docker-substrate + +.deploy-tag: &deploy-tag + <<: *deploy + only: + variables: + - $DEPLOY_TAG + +# have environment:url eventually point to the logs + +deploy-ew3: + <<: *deploy-cibuild + environment: + name: parity-prod-ew3 + +deploy-ue1: + <<: *deploy-cibuild + environment: + name: parity-prod-ue1 + +deploy-ew3-tag: + <<: *deploy-tag + environment: + name: parity-prod-ew3 + +deploy-ue1-tag: + <<: *deploy-tag + environment: + name: parity-prod-ue1 + +.validator-deploy: &validator-deploy + # script will fail if there is no artifacts/substrate/VERSION + <<: *build-only + stage: flaming-fir + dependencies: + - build-linux-substrate + image: parity/azure-ansible:v1 + allow_failure: true + when: manual + tags: + - linux-docker + +validator 1 4: + <<: *validator-deploy + script: + - ./.maintain/flamingfir-deploy.sh flamingfir-validator1 +validator 2 4: + <<: *validator-deploy + script: + - ./.maintain/flamingfir-deploy.sh flamingfir-validator2 +validator 3 4: + <<: *validator-deploy + script: + - ./.maintain/flamingfir-deploy.sh flamingfir-validator3 +validator 4 4: + <<: *validator-deploy + script: + - ./.maintain/flamingfir-deploy.sh flamingfir-validator4 From dd86878d378f99d31f8d2893097acc3f2bbbc084 Mon Sep 17 00:00:00 2001 From: Denis P Date: Wed, 26 Feb 2020 12:17:09 +0100 Subject: [PATCH 15/15] bump Cargo.lock --- Cargo.lock | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 342cd857c5efc..53e2a5663b09c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3151,6 +3151,9 @@ name = "memchr" version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" +dependencies = [ + "libc", +] [[package]] name = "memoffset"