Skip to content
Snippets Groups Projects
Commit a44349f6 authored by ordian's avatar ordian Committed by GitHub
Browse files

custom cargo profiles for production (#4627)


* add custom profiles and specify MSVR as 1.57

* fix host-perf-check command

* use testnet profile for CI images

* do not do lto for testnet profile

* fix artifact path

* test with testnet profile to reuse build artifacts

* Revert "fix host-perf-check command"

This reverts commit f1d15492204b8251685a97636cbb5a5f394f21da.

* bump zombienet version

Co-authored-by: default avatarJavier Viola <javier@parity.io>
parent 1394b70d
No related merge requests found
......@@ -27,7 +27,7 @@ variables:
CI_IMAGE: "paritytech/ci-linux:production"
DOCKER_OS: "debian:stretch"
ARCH: "x86_64"
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.1.3"
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.1.4"
VAULT_SERVER_URL: "https://vault.parity-mgmt-vault.parity.io"
VAULT_AUTH_PATH: "gitlab-parity-io-jwt"
VAULT_AUTH_ROLE: "cicd_gitlab_parity_${CI_PROJECT_NAME}"
......@@ -198,13 +198,12 @@ test-build-linux-stable:
script:
- ./scripts/gitlab/test_linux_stable.sh
# we're using the bin built here, instead of having a parallel `build-linux-release`
# disputes feature is needed for zombie-net parachains malus test
- time cargo build --release --verbose --bin polkadot
- time cargo build --profile testnet --verbose --bin polkadot
- sccache -s
# pack artifacts
- mkdir -p ./artifacts
- VERSION="${CI_COMMIT_REF_NAME}" # will be tag or branch name
- mv ./target/release/polkadot ./artifacts/.
- mv ./target/testnet/polkadot ./artifacts/.
- pushd artifacts
- sha256sum polkadot | tee polkadot.sha256
- shasum -c polkadot.sha256
......@@ -260,11 +259,11 @@ build-adder-collator:
<<: *compiler-info
<<: *rules-test-and-rococo
script:
- time cargo build --release --verbose -p test-parachain-adder-collator
- time cargo build --profile testnet --verbose -p test-parachain-adder-collator
- sccache -s
# pack artifacts
- mkdir -p ./artifacts
- mv ./target/release/adder-collator ./artifacts/.
- mv ./target/testnet/adder-collator ./artifacts/.
- echo -n "${CI_COMMIT_REF_NAME}" > ./artifacts/VERSION
- echo -n "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}" > ./artifacts/EXTRATAG
- echo "adder-collator version = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))"
......@@ -280,11 +279,11 @@ build-malus:
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
script:
- time cargo build --release --verbose -p polkadot-test-malus
- time cargo build --profile testnet --verbose -p polkadot-test-malus
- sccache -s
# pack artifacts
- mkdir -p ./artifacts
- mv ./target/release/malus ./artifacts/.
- mv ./target/testnet/malus ./artifacts/.
- echo -n "${CI_COMMIT_REF_NAME}" > ./artifacts/VERSION
- echo -n "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}" > ./artifacts/EXTRATAG
- echo "polkadot-test-malus = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))"
......
......@@ -9,6 +9,7 @@ license = "GPL-3.0-only"
version = "0.9.13"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
rust-version = "1.57.0" # custom profiles
readme = "README.md"
[dependencies]
......@@ -114,6 +115,16 @@ opt-level = 3
# Polkadot runtime requires unwinding.
panic = "unwind"
[profile.production]
inherits = "release"
lto = true
[profile.testnet]
inherits = "release"
debug = true # debug symbols are useful for profilers
debug-assertions = true
overflow-checks = true
[features]
runtime-benchmarks= [ "polkadot-cli/runtime-benchmarks" ]
try-runtime = [ "polkadot-cli/try-runtime" ]
......
......@@ -5,4 +5,4 @@ set -eux
source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/../common/lib.sh"
# Builds with the runtime benchmarks/metrics features are only to be used for testing.
time cargo test --workspace --release --verbose --locked --features=runtime-benchmarks,runtime-metrics
time cargo test --workspace --profile testnet --verbose --locked --features=runtime-benchmarks,runtime-metrics
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment