From d6c55469c9794286b1482a0febe917630b050b72 Mon Sep 17 00:00:00 2001 From: Talha Cross <47772477+soc1c@users.noreply.github.com> Date: Tue, 11 Jun 2019 20:50:37 +0200 Subject: [PATCH] backports for stable 2.4.7 (#10736) * version: bump stable to 2.4.7 * [CI] allow cargo audit to fail (#10676) * [CI] allow cargo audit to fail * [.gitlab-ci.yml] add a comment about cargo audit * [Cargo.lock] cargo update -p protobuf * new image (#10673) * Update publishing (#10644) * docker images are now built on k8s: test run * copy check_sync.sh in build-linux job * copy scripts/docker/hub/* in build-linux job * removed cache var * cleanup, no more nightly dockers * cleanup in dockerfile * some new tags * removed sccsche debug log, cleanup * no_gits, new artifacts dir, changed scripts. Test run. * define version once * one source for TRACK * stop kovan onchain updates * moved changes for two images to a new branch * rename Dockerfile * no need in libudev-dev * enable lto for release builds (#10717) * Use RUSTFLAGS to set the optimization level (#10719) * Use RUSTFLAGS to set the optimization level Cargo has a [quirk]() in how configuration settings are propagated when `cargo test` runs: local code respect the settings in `[profile.test]` but all dependencies use the `[profile.dev]` settings. Here we force `opt-level=3` for all dependencies. * Remove unused profile settings * Maybe like this? * Turn off incremental compilation * Remove colors; try again with overflow-checks on * Use quiet CI machine * Turn overflow checking back on * Be explicit about what options we use * Remove "quiet machine" override * ethcore: enable ECIP-1054 for classic (#10731) * config: enable atlantis on ethereum classic * config: enable atlantis on morden classic * config: enable atlantis on morden classic * config: enable atlantis on kotti classic * ethcore: move kotti fork block to 0xAEF49 * ethcore: move morden fork block to 0x4829BA * ethcore: move classic fork block to 0x81B320 * remove trailing comma * remove trailing comma * fix chainspec * ethcore: move classic fork block to 0x7fffffffffffffff --- .gitlab-ci.yml | 57 ++++++++++--- Cargo.lock | 20 ++--- Cargo.toml | 7 +- ethcore/res/ethereum/classic.json | 120 ++++++++++++++++++++++++--- ethcore/res/ethereum/morden.json | 74 ++++++++++++++--- scripts/docker/hub/Dockerfile | 44 +++++++--- scripts/docker/hub/publish-docker.sh | 57 +++++++++++++ scripts/gitlab/publish-docker.sh | 22 ----- scripts/gitlab/publish-docs.sh | 4 +- scripts/gitlab/publish-onchain.sh | 9 +- scripts/gitlab/publish-snap.sh | 16 +--- scripts/gitlab/test-linux.sh | 5 +- util/version/Cargo.toml | 2 +- 13 files changed, 331 insertions(+), 106 deletions(-) create mode 100755 scripts/docker/hub/publish-docker.sh delete mode 100755 scripts/gitlab/publish-docker.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index acea999e2e5..33cfbd9d9fb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,11 +4,13 @@ stages: - publish - optional -image: parity/rust-parity-ethereum-build:xenial +image: parity/parity-ci-linux:latest variables: GIT_STRATEGY: fetch GIT_SUBMODULE_STRATEGY: recursive CI_SERVER_NAME: "GitLab CI" + CARGO_HOME: "/ci-cache/${CI_PROJECT_NAME}/cargo/${CI_JOB_NAME}" + SCCACHE_DIR: "/ci-cache/${CI_PROJECT_NAME}/sccache" CARGO_TARGET: x86_64-unknown-linux-gnu .no_git: &no_git # disable git strategy @@ -30,12 +32,15 @@ variables: expire_in: 1 mos paths: - artifacts/ + - tools/ .docker-cache-status: &docker-cache-status variables: CARGO_HOME: "/ci-cache/parity-ethereum/cargo/${CI_JOB_NAME}" dependencies: [] before_script: + - rustup show + - cargo --version - SCCACHE_ERROR_LOG=/builds/parity/parity-ethereum/sccache_debug.log RUST_LOG=sccache=debug sccache --start-server @@ -44,10 +49,7 @@ variables: # sccache debug info - if test -e sccache_debug.log; then - echo "_____sccache_debug.log listing start:_____"; - cat sccache_debug.log; - echo "_____sccache_debug.log listing end_____"; - echo "All crate-types:"; + echo "_____All crate-types:_____"; grep 'parse_arguments.*--crate-type' sccache_debug.log | sed -re 's/.*"--crate-type", "([^"]+)".*/\1/' | sort | uniq -c; echo "_____Non-cacheable reasons:_____"; grep CannotCache sccache_debug.log | sed -re 's/.*CannotCache\((.+)\).*/\1/' | sort | uniq -c; @@ -65,6 +67,16 @@ variables: script: - scripts/gitlab/build-linux.sh - sccache -s + after_script: + - mkdir -p tools + - cp -r scripts/docker/hub/* ./tools + - cp scripts/gitlab/publish-snap.sh ./tools + - cp scripts/gitlab/publish-onchain.sh ./tools + - cp scripts/gitlab/safe-curl.sh ./tools + - echo v"$(sed -r -n '1,/^version/s/^version\s*=\s*"([^"]+)".*$/\1/p' Cargo.toml)" | + tee ./tools/VERSION + - echo "$(sed -r -n '1,/^track/s/^track\s*=\s*"([^"]+)".*$/\1/p' ./util/version/Cargo.toml)" | + tee ./tools/TRACK cargo-check 0 3: @@ -93,6 +105,7 @@ cargo-audit: <<: *docker-cache-status script: - cargo audit + allow_failure: true # failed cargo audit shouldn't prevent a PR from being merged validate-chainspecs: stage: test @@ -192,19 +205,35 @@ build-windows: publish-docker: stage: publish + <<: *no_git only: *releaseable_branches - cache: {} + except: + variables: + - $SCHEDULE_TAG == "nightly" dependencies: - build-linux - tags: - - shell + environment: + name: parity-build + cache: {} + image: docker:stable + services: + - docker:dind + variables: + DOCKER_HOST: tcp://localhost:2375 + DOCKER_DRIVER: overlay2 + GIT_STRATEGY: none + # DOCKERFILE: tools/Dockerfile + # CONTAINER_IMAGE: parity/parity script: - - scripts/gitlab/publish-docker.sh parity + # we stopped pushing nightlies to dockerhub, will push to own registry prb. + - ./tools/publish-docker.sh + tags: + - kubernetes-parity-build publish-snap: &publish-snap stage: publish + <<: *no_git only: *releaseable_branches - <<: *collect_artifacts image: snapcore/snapcraft variables: BUILD_ARCH: amd64 @@ -214,12 +243,13 @@ publish-snap: &publish-snap tags: - linux-docker script: - - scripts/gitlab/publish-snap.sh + - ./tools/publish-snap.sh publish-snap-i386: <<: *publish-snap variables: BUILD_ARCH: i386 + CARGO_TARGET: i686-unknown-linux-gnu dependencies: - build-linux-i386 @@ -227,6 +257,7 @@ publish-snap-arm64: <<: *publish-snap variables: BUILD_ARCH: arm64 + CARGO_TARGET: aarch64-unknown-linux-gnu dependencies: - build-linux-arm64 @@ -234,11 +265,13 @@ publish-snap-armhf: <<: *publish-snap variables: BUILD_ARCH: armhf + CARGO_TARGET: armv7-unknown-linux-gnueabihf dependencies: - build-linux-armhf publish-onchain: stage: publish + <<: *no_git only: *releaseable_branches cache: {} dependencies: @@ -246,7 +279,7 @@ publish-onchain: - build-darwin - build-windows script: - - scripts/gitlab/publish-onchain.sh + - ./tools/publish-onchain.sh tags: - linux-docker diff --git a/Cargo.lock b/Cargo.lock index 2c288f7ce7f..0cbb7838c9b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1548,7 +1548,7 @@ dependencies = [ "libusb 0.3.0 (git+https://github.com/paritytech/libusb-rs)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "protobuf 1.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 1.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "trezor-sys 1.0.0 (git+https://github.com/paritytech/trezor-sys)", @@ -2464,7 +2464,7 @@ dependencies = [ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "jni 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", "panic_hook 0.1.0", - "parity-ethereum 2.4.6", + "parity-ethereum 2.4.7", "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-current-thread 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2494,7 +2494,7 @@ dependencies = [ [[package]] name = "parity-ethereum" -version = "2.4.6" +version = "2.4.7" dependencies = [ "ansi_term 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2547,7 +2547,7 @@ dependencies = [ "parity-rpc 1.12.0", "parity-runtime 0.1.0", "parity-updater 1.12.0", - "parity-version 2.4.6", + "parity-version 2.4.7", "parity-whisper 0.1.0", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2698,7 +2698,7 @@ dependencies = [ "parity-crypto 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-runtime 0.1.0", "parity-updater 1.12.0", - "parity-version 2.4.6", + "parity-version 2.4.7", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2797,7 +2797,7 @@ dependencies = [ "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-hash-fetch 1.12.0", "parity-path 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-version 2.4.6", + "parity-version 2.4.7", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2807,7 +2807,7 @@ dependencies = [ [[package]] name = "parity-version" -version = "2.4.6" +version = "2.4.7" dependencies = [ "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3087,7 +3087,7 @@ dependencies = [ [[package]] name = "protobuf" -version = "1.7.4" +version = "1.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -4092,7 +4092,7 @@ name = "trezor-sys" version = "1.0.0" source = "git+https://github.com/paritytech/trezor-sys#8a401705e58c83db6c29c199d9577b78fde40709" dependencies = [ - "protobuf 1.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 1.7.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4702,7 +4702,7 @@ dependencies = [ "checksum primal-estimate 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "56ea4531dde757b56906493c8604641da14607bf9cdaa80fb9c9cabd2429f8d5" "checksum primal-sieve 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "da2d6ed369bb4b0273aeeb43f07c105c0117717cbae827b20719438eb2eb798c" "checksum proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)" = "3d7b7eaaa90b4a90a932a9ea6666c95a389e424eff347f0f793979289429feee" -"checksum protobuf 1.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "52fbc45bf6709565e44ef31847eb7407b3c3c80af811ee884a04da071dcca12b" +"checksum protobuf 1.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e14ccd6b79ec748412d4f2dfde1a80fa363a67def4062969f8aed3d790a30f28" "checksum pulldown-cmark 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8361e81576d2e02643b04950e487ec172b687180da65c731c03cf336784e6c07" "checksum pwasm-utils 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e9135bed7b452e20dbb395a2d519abaf0c46d60e7ecc02daeeab447d29bada1" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" diff --git a/Cargo.toml b/Cargo.toml index e844f20ba5a..cbc118c2460 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ description = "Parity Ethereum client" name = "parity-ethereum" # NOTE Make sure to update util/version/Cargo.toml as well -version = "2.4.6" +version = "2.4.7" license = "GPL-3.0" authors = ["Parity Technologies "] @@ -118,10 +118,13 @@ path = "parity/lib.rs" path = "parity/main.rs" name = "parity" -[profile.dev] +[profile.test] +lto = false +opt-level = 3 # makes tests slower to compile, but faster to run [profile.release] debug = false +lto = true [workspace] # This should only list projects that are not diff --git a/ethcore/res/ethereum/classic.json b/ethcore/res/ethereum/classic.json index 393129c12f0..682b752991e 100644 --- a/ethcore/res/ethereum/classic.json +++ b/ethcore/res/ethereum/classic.json @@ -8,11 +8,12 @@ "difficultyBoundDivisor": "0x0800", "durationLimit": "0x0d", "blockReward": "0x4563918244F40000", - "homesteadTransition": 1150000, - "ecip1010PauseTransition": 3000000, - "ecip1010ContinueTransition": 5000000, - "ecip1017EraRounds": 5000000, - "bombDefuseTransition": 5900000 + "homesteadTransition": "0x118c30", + "ecip1010PauseTransition": "0x2dc6c0", + "ecip1010ContinueTransition": "0x4c4b40", + "ecip1017EraRounds": "0x4c4b40", + "eip100bTransition": "0x7fffffffffffffff", + "bombDefuseTransition": "0x5a06e0" } } }, @@ -26,11 +27,17 @@ "chainID": "0x3d", "forkBlock": "0x1d4c00", "forkCanonHash": "0x94365e3a8c0b35089c1d1195081fe7489b528a84b22199c916180db8b28ade7f", - "eip150Transition": 2500000, - "eip160Transition": 3000000, + "eip150Transition": "0x2625a0", + "eip160Transition": "0x2dc6c0", "eip161abcTransition": "0x7fffffffffffffff", "eip161dTransition": "0x7fffffffffffffff", - "eip155Transition": 3000000 + "eip155Transition": "0x2dc6c0", + "maxCodeSize": "0x6000", + "maxCodeSizeTransition": "0x7fffffffffffffff", + "eip140Transition": "0x7fffffffffffffff", + "eip211Transition": "0x7fffffffffffffff", + "eip214Transition": "0x7fffffffffffffff", + "eip658Transition": "0x7fffffffffffffff" }, "genesis": { "seal": { @@ -3835,7 +3842,7 @@ "0xc32fd5318214071a41cd8e98499b2b65942c5837c686a06b536146fd0bf294bf", "0xac390c012eecd83fa8f4cc77a59992914b5c95af36b28747e07adea13228acbc" ] - }, + }, "nodes": [ "enode://efd48ad0879eeb7f9cb5e50f33f7bc21e805a72e90361f145baaa22dd75d111e7cd9c93f1b7060dcb30aa1b3e620269336dbf32339fea4c18925a4c15fe642df@18.205.66.229:30303", "enode://5fbfb426fbb46f8b8c1bd3dd140f5b511da558cd37d60844b525909ab82e13a25ee722293c829e52cb65c2305b1637fa9a2ea4d6634a224d5f400bfe244ac0de@162.243.55.45:30303", @@ -3851,10 +3858,97 @@ "enode://5cd218959f8263bc3721d7789070806b0adff1a0ed3f95ec886fb469f9362c7507e3b32b256550b9a7964a23a938e8d42d45a0c34b332bfebc54b29081e83b93@35.187.57.94:30303" ], "accounts": { - "0000000000000000000000000000000000000001": { "builtin": { "name": "ecrecover", "pricing": { "linear": { "base": 3000, "word": 0 } } } }, - "0000000000000000000000000000000000000002": { "builtin": { "name": "sha256", "pricing": { "linear": { "base": 60, "word": 12 } } } }, - "0000000000000000000000000000000000000003": { "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } }, - "0000000000000000000000000000000000000004": { "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } }, + "0x0000000000000000000000000000000000000001": { + "builtin": { + "name": "ecrecover", + "pricing": { + "linear": { + "base": 3000, + "word": 0 + } + } + } + }, + "0x0000000000000000000000000000000000000002": { + "builtin": { + "name": "sha256", + "pricing": { + "linear": { + "base": 60, + "word": 12 + } + } + } + }, + "0x0000000000000000000000000000000000000003": { + "builtin": { + "name": "ripemd160", + "pricing": { + "linear": { + "base": 600, + "word": 120 + } + } + } + }, + "0x0000000000000000000000000000000000000004": { + "builtin": { + "name": "identity", + "pricing": { + "linear": { + "base": 15, + "word": 3 + } + } + } + }, + "0x0000000000000000000000000000000000000005": { + "builtin": { + "name": "modexp", + "activate_at": "0x7fffffffffffffff", + "pricing": { + "modexp": { + "divisor": 20 + } + } + } + }, + "0x0000000000000000000000000000000000000006": { + "builtin": { + "name": "alt_bn128_add", + "activate_at": "0x7fffffffffffffff", + "pricing": { + "linear": { + "base": 500, + "word": 0 + } + } + } + }, + "0x0000000000000000000000000000000000000007": { + "builtin": { + "name": "alt_bn128_mul", + "activate_at": "0x7fffffffffffffff", + "pricing": { + "linear": { + "base": 40000, + "word": 0 + } + } + } + }, + "0x0000000000000000000000000000000000000008": { + "builtin": { + "name": "alt_bn128_pairing", + "activate_at": "0x7fffffffffffffff", + "pricing": { + "alt_bn128_pairing": { + "base": 100000, + "pair": 80000 + } + } + } + }, "3282791d6fd713f1e94f4bfd565eaa78b3a0599d": { "balance": "1337000000000000000000" }, diff --git a/ethcore/res/ethereum/morden.json b/ethcore/res/ethereum/morden.json index e626152adc9..5ea0f211432 100644 --- a/ethcore/res/ethereum/morden.json +++ b/ethcore/res/ethereum/morden.json @@ -8,11 +8,12 @@ "difficultyBoundDivisor": "0x0800", "durationLimit": "0x0d", "blockReward": "0x4563918244F40000", - "homesteadTransition": 494000, - "ecip1010PauseTransition": 1915000, - "ecip1010ContinueTransition": 3415000, - "ecip1017EraRounds": 2000000, - "bombDefuseTransition": 2300000 + "homesteadTransition": "0x789b0", + "ecip1010PauseTransition": "0x1d3878", + "ecip1010ContinueTransition": "0x341bd8", + "ecip1017EraRounds": "0x1e8480", + "eip100bTransition": "0x4829ba", + "bombDefuseTransition": "0x231860" } } }, @@ -26,11 +27,17 @@ "chainID": "0x3e", "forkBlock": "0x1b34d8", "forkCanonHash": "0xf376243aeff1f256d970714c3de9fd78fa4e63cf63e32a51fe1169e375d98145", - "eip150Transition": 1783000, - "eip160Transition": 1915000, - "eip161abcTransition": "0x7fffffffffffffff", - "eip161dTransition": "0x7fffffffffffffff", - "eip155Transition": 1915000 + "eip150Transition": "0x1b34d8", + "eip160Transition": "0x1d3878", + "eip161abcTransition": "0x4829ba", + "eip161dTransition": "0x4829ba", + "eip155Transition": "0x1d3878", + "maxCodeSize": "0x6000", + "maxCodeSizeTransition": "0x4829ba", + "eip140Transition": "0x4829ba", + "eip211Transition": "0x4829ba", + "eip214Transition": "0x4829ba", + "eip658Transition": "0x4829ba" }, "genesis": { "seal": { @@ -68,6 +75,53 @@ "0000000000000000000000000000000000000002": { "balance": "1", "nonce": "1048576", "builtin": { "name": "sha256", "pricing": { "linear": { "base": 60, "word": 12 } } } }, "0000000000000000000000000000000000000003": { "balance": "1", "nonce": "1048576", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } }, "0000000000000000000000000000000000000004": { "balance": "1", "nonce": "1048576", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } }, + "0x0000000000000000000000000000000000000005": { + "builtin": { + "name": "modexp", + "activate_at": "0x4829ba", + "pricing": { + "modexp": { + "divisor": 20 + } + } + } + }, + "0x0000000000000000000000000000000000000006": { + "builtin": { + "name": "alt_bn128_add", + "activate_at": "0x4829ba", + "pricing": { + "linear": { + "base": 500, + "word": 0 + } + } + } + }, + "0x0000000000000000000000000000000000000007": { + "builtin": { + "name": "alt_bn128_mul", + "activate_at": "0x4829ba", + "pricing": { + "linear": { + "base": 40000, + "word": 0 + } + } + } + }, + "0x0000000000000000000000000000000000000008": { + "builtin": { + "name": "alt_bn128_pairing", + "activate_at": "0x4829ba", + "pricing": { + "alt_bn128_pairing": { + "base": 100000, + "pair": 80000 + } + } + } + }, "102e61f5d8f9bc71d0ad4a084df4e65e05ce0e1c": { "balance": "1606938044258990275541962092341162602522202993782792835301376", "nonce": "1048576" } }, "hardcodedSync": { diff --git a/scripts/docker/hub/Dockerfile b/scripts/docker/hub/Dockerfile index a18cacf9cc9..ac1dd32ee15 100644 --- a/scripts/docker/hub/Dockerfile +++ b/scripts/docker/hub/Dockerfile @@ -1,30 +1,48 @@ FROM ubuntu:xenial -LABEL MAINTAINER="Parity Technologies " -# install tools and dependencies -RUN apt update && apt install -y --no-install-recommends openssl libudev-dev file curl jq +# metadata +ARG VCS_REF +ARG BUILD_DATE + +LABEL io.parity.image.authors="devops-team@parity.io" \ + io.parity.image.vendor="Parity Technologies" \ + io.parity.image.title="parity/parity" \ + io.parity.image.description="Parity Ethereum. The Fastest and most Advanced Ethereum Client." \ + io.parity.image.source="https://github.com/paritytech/parity-ethereum/blob/${VCS_REF}/\ +scripts/docker/hub/Dockerfile" \ + io.parity.image.documentation="https://wiki.parity.io/Parity-Ethereum" \ + io.parity.image.revision="${VCS_REF}" \ + io.parity.image.created="${BUILD_DATE}" # show backtraces ENV RUST_BACKTRACE 1 -# cleanup Docker image -RUN apt autoremove -y \ - && apt clean -y \ - && rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/* - -RUN groupadd -g 1000 parity \ - && useradd -m -u 1000 -g parity -s /bin/sh parity +# install tools and dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + file curl jq; \ +# apt cleanup + apt-get autoremove -y; \ + apt-get clean; \ + rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/*; \ +# add user + groupadd -g 1000 parity; \ + useradd -m -u 1000 -g parity -s /bin/sh parity WORKDIR /home/parity -# add parity-ethereum to docker image +# add parity-ethereum binary to docker image COPY artifacts/x86_64-unknown-linux-gnu/parity /bin/parity - -COPY scripts/docker/hub/check_sync.sh /check_sync.sh +COPY tools/check_sync.sh /check_sync.sh # switch to user parity here USER parity +# check if executable works in this container +RUN parity --version + EXPOSE 5001 8080 8082 8083 8545 8546 8180 30303/tcp 30303/udp ENTRYPOINT ["/bin/parity"] + diff --git a/scripts/docker/hub/publish-docker.sh b/scripts/docker/hub/publish-docker.sh new file mode 100755 index 00000000000..6602d55c23a --- /dev/null +++ b/scripts/docker/hub/publish-docker.sh @@ -0,0 +1,57 @@ +#!/bin/sh + +set -e # fail on any error + +VERSION=$(cat ./tools/VERSION) +echo "Parity Ethereum version = ${VERSION}" + +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" +echo "__________Docker info__________" +docker info + +# we stopped pushing nightlies to dockerhub, will push to own registry prb. +case "${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}" in + "$SCHEDULE_TAG") + echo "Docker TAG - 'parity/parity:${SCHEDULE_TAG}'"; + docker build --no-cache \ + --build-arg VCS_REF="${CI_COMMIT_SHA}" \ + --build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" \ + --tag "parity/parity:${SCHEDULE_TAG}" \ + --file tools/Dockerfile .; + docker push "parity/parity:${SCHEDULE_TAG}";; + "beta") + echo "Docker TAGs - 'parity/parity:beta', 'parity/parity:latest', \ + 'parity/parity:${VERSION}-${CI_COMMIT_REF_NAME}'"; + docker build --no-cache \ + --build-arg VCS_REF="${CI_COMMIT_SHA}" \ + --build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" \ + --tag "parity/parity:beta" \ + --tag "parity/parity:latest" \ + --tag "parity/parity:${VERSION}-${CI_COMMIT_REF_NAME}" \ + --file tools/Dockerfile .; + docker push "parity/parity:beta"; + docker push "parity/parity:latest"; + docker push "parity/parity:${VERSION}-${CI_COMMIT_REF_NAME}";; + "stable") + echo "Docker TAGs - 'parity/parity:${VERSION}-${CI_COMMIT_REF_NAME}', 'parity/parity:stable'"; + docker build --no-cache \ + --build-arg VCS_REF="${CI_COMMIT_SHA}" \ + --build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" \ + --tag "parity/parity:${VERSION}-${CI_COMMIT_REF_NAME}" \ + --tag "parity/parity:stable" \ + --file tools/Dockerfile .; + docker push "parity/parity:${VERSION}-${CI_COMMIT_REF_NAME}"; + docker push "parity/parity:stable";; + *) + echo "Docker TAG - 'parity/parity:${VERSION}-${CI_COMMIT_REF_NAME}'" + docker build --no-cache \ + --build-arg VCS_REF="${CI_COMMIT_SHA}" \ + --build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" \ + --tag "parity/parity:${VERSION}-${CI_COMMIT_REF_NAME}" \ + --file tools/Dockerfile .; + docker push "parity/parity:${VERSION}-${CI_COMMIT_REF_NAME}";; +esac + +docker logout diff --git a/scripts/gitlab/publish-docker.sh b/scripts/gitlab/publish-docker.sh deleted file mode 100755 index e8697fac2e0..00000000000 --- a/scripts/gitlab/publish-docker.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -##ARGUMENTS: 1. Docker target -set -e # fail on any error -set -u # treat unset variables as error - -if [ "$CI_COMMIT_REF_NAME" == "master" ]; - then export DOCKER_BUILD_TAG="${SCHEDULE_TAG:-latest}"; - else export DOCKER_BUILD_TAG=$CI_COMMIT_REF_NAME; -fi -docker login -u $Docker_Hub_User_Parity -p $Docker_Hub_Pass_Parity - -echo "__________Docker TAG__________" -echo $DOCKER_BUILD_TAG - -echo "__________Docker target__________" -export DOCKER_TARGET=$1 -echo $DOCKER_TARGET - -echo "__________Docker build and push__________" -docker build --build-arg TARGET=$DOCKER_TARGET --no-cache=true --tag parity/$DOCKER_TARGET:$DOCKER_BUILD_TAG -f scripts/docker/hub/Dockerfile . -docker push parity/$DOCKER_TARGET:$DOCKER_BUILD_TAG -docker logout diff --git a/scripts/gitlab/publish-docs.sh b/scripts/gitlab/publish-docs.sh index 2508c825556..16a781eeb98 100755 --- a/scripts/gitlab/publish-docs.sh +++ b/scripts/gitlab/publish-docs.sh @@ -33,8 +33,8 @@ update_wiki_docs() { setup_git() { echo "__________Set github__________" - git config --global user.email "devops@parity.com" - git config --global user.name "Devops Parity" + git config --global user.email "devops-team@parity.io" + git config --global user.name "Devops Team Parity" } set_remote_wiki() { diff --git a/scripts/gitlab/publish-onchain.sh b/scripts/gitlab/publish-onchain.sh index 588cbdfb579..9c7b866fb49 100755 --- a/scripts/gitlab/publish-onchain.sh +++ b/scripts/gitlab/publish-onchain.sh @@ -7,10 +7,7 @@ echo "__________Register Release__________" DATA="secret=$RELEASES_SECRET" echo "Pushing release to Mainnet" -./scripts/gitlab/safe-curl.sh $DATA "http://update.parity.io:1337/push-release/${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}/$CI_COMMIT_SHA" - -echo "Pushing release to Kovan" -./scripts/gitlab/safe-curl.sh $DATA "http://update.parity.io:1338/push-release/${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}/$CI_COMMIT_SHA" +./tools/safe-curl.sh $DATA "http://update.parity.io:1337/push-release/${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}/$CI_COMMIT_SHA" cd artifacts ls -l | sort -k9 @@ -29,9 +26,7 @@ do case $DIR in x86_64* ) DATA="commit=$CI_COMMIT_SHA&sha3=$sha3&filename=parity$WIN&secret=$RELEASES_SECRET" - ../../scripts/gitlab/safe-curl.sh $DATA "http://update.parity.io:1337/push-build/${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}/$DIR" - # Kovan - ../../scripts/gitlab/safe-curl.sh $DATA "http://update.parity.io:1338/push-build/${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}/$DIR" + ../../tools/safe-curl.sh $DATA "http://update.parity.io:1337/push-build/${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}/$DIR" ;; esac cd .. diff --git a/scripts/gitlab/publish-snap.sh b/scripts/gitlab/publish-snap.sh index 5e0231af00e..d9f10ce3ee1 100755 --- a/scripts/gitlab/publish-snap.sh +++ b/scripts/gitlab/publish-snap.sh @@ -3,15 +3,11 @@ set -e # fail on any error set -u # treat unset variables as error -# some necromancy: -# gsub(/"/, "", $2) deletes "qoutes" -# gsub(/ /, "", $2) deletes whitespaces -TRACK=`awk -F '=' '/^track/ {gsub(/"/, "", $2); gsub(/ /, "", $2); print $2}' ./util/version/Cargo.toml` -echo Track is: $TRACK # prepare variables -VERSION=v"$(sed -r -n '1,/^version/s/^version = "([^"]+)".*$/\1/p' Cargo.toml)" +TRACK=$(cat ./tools/TRACK) +echo "Track is: ${TRACK}" +VERSION=$(cat ./tools/VERSION) SNAP_PACKAGE="parity_"$VERSION"_"$BUILD_ARCH".snap" -CARGO_TARGET="$(ls artifacts)" # Choose snap release channel based on parity ethereum version track case ${TRACK} in nightly) export GRADE="devel" CHANNEL="edge";; @@ -20,12 +16,8 @@ case ${TRACK} in *) echo "No release" && exit 0;; esac -# Release untagged versions from branches to the candidate snap channel -case ${CI_COMMIT_REF_NAME} in - beta|stable) export GRADE="stable" CHANNEL="candidate";; -esac echo "__________Create snap package__________" -echo "Release channel :" $GRADE " Branch/tag: " $CI_COMMIT_REF_NAME +echo "Release channel :" $GRADE " Branch/tag: " $CI_COMMIT_REF_NAME "Track: " ${TRACK} echo $VERSION:$GRADE:$BUILD_ARCH:$CARGO_TARGET sed -e 's/$VERSION/'"$VERSION"'/g' \ diff --git a/scripts/gitlab/test-linux.sh b/scripts/gitlab/test-linux.sh index 2854508bb56..d7e6da0bb62 100755 --- a/scripts/gitlab/test-linux.sh +++ b/scripts/gitlab/test-linux.sh @@ -6,7 +6,7 @@ set -e # fail on any error set -u # treat unset variables as error FEATURES="json-tests,ci-skip-tests" -OPTIONS="--release" +OPTIONS="" #use nproc `linux only THREADS=$(nproc) @@ -14,4 +14,5 @@ rustup default $1 rustup show echo "________Running Parity Full Test Suite________" -time cargo test $OPTIONS --features "$FEATURES" --locked --all --target $CARGO_TARGET --verbose --color=always -- --test-threads $THREADS +# Why are we using RUSTFLAGS? See https://github.com/paritytech/parity-ethereum/pull/10719 +CARGO_INCREMENTAL=0 RUSTFLAGS="-C opt-level=3 -C overflow-checks=on -C debuginfo=2" time cargo test $OPTIONS --features "$FEATURES" --locked --all --target $CARGO_TARGET --verbose --color=never -- --test-threads $THREADS diff --git a/util/version/Cargo.toml b/util/version/Cargo.toml index 9459303c685..edfb05ef5c2 100644 --- a/util/version/Cargo.toml +++ b/util/version/Cargo.toml @@ -3,7 +3,7 @@ [package] name = "parity-version" # NOTE: this value is used for Parity Ethereum version string (via env CARGO_PKG_VERSION) -version = "2.4.6" +version = "2.4.7" authors = ["Parity Technologies "] build = "build.rs"