diff --git a/.circleci/config.yml b/.circleci/config.yml index 2a3b83f473..9aa477369f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,10 +32,11 @@ jobs: libusb-dev -y RUST_BACKTRACE=1 cargo test --package=parity-rabbitmq no_output_timeout: 30m - deploy_docker_image: + image: <<: *defaults environment: FINAL_IMAGE: registry.dev.infra.chronicled.com/blockchain-interface + QUAY_IMAGE: quay.io/chronicled/blockchain-interface steps: - add_ssh_keys: fingerprints: @@ -49,33 +50,53 @@ jobs: - setup_remote_docker: docker_layer_caching: false version: 18.09.3 - - run: - name: Setup Docker credentials - command: mkdir -p ~/.docker; echo -n "${REGISTRY_AUTH}" > ~/.docker/config.json; - run: name: Build docker image command: | export SHORT_COMMIT="$(echo $CIRCLE_SHA1 | cut -c1-7)"; - export PREV_IMAGE=`docker images "${FINAL_IMAGE}:latest" --format "{{.Repository}}:{{.Tag}}" | head -n 1`; + export PREV_IMAGE=`docker images "${FINAL_IMAGE}:${CIRCLE_BRANCH}" --format "{{.Repository}}:{{.Tag}}" | head -n 1`; ssh-add -L - docker build -c 1024 --rm=false -f scripts/docker/debian/Dockerfile --tag "${FINAL_IMAGE}:${SHORT_COMMIT}" --tag "${FINAL_IMAGE}:develop" --tag "${FINAL_IMAGE}:latest" . --cache-from="${PREV_IMAGE}" --ssh default; + docker build -c 1024 --rm=false -f scripts/docker/debian/Dockerfile --tag "${FINAL_IMAGE}:${SHORT_COMMIT}" --tag "${FINAL_IMAGE}:${CIRCLE_BRANCH}" --tag "${QUAY_IMAGE}:${SHORT_COMMIT}" --tag "${QUAY_IMAGE}:${CIRCLE_BRANCH}" . --cache-from="${PREV_IMAGE}" --ssh default; no_output_timeout: 60m - run: - name: Deploy to dockerhub + name: Deploy to dev registry command: | + mkdir -p ~/.docker; echo -n "${REGISTRY_AUTH}" > ~/.docker/config.json; SHORT_COMMIT="$(echo $CIRCLE_SHA1 | cut -c1-7)"; docker push "${FINAL_IMAGE}:${SHORT_COMMIT}"; - docker push "${FINAL_IMAGE}:develop"; - docker push "${FINAL_IMAGE}:latest"; - docker logout; + docker push "${FINAL_IMAGE}:${CIRCLE_BRANCH}" + - run: + name: Deploy to quay + command: | + mkdir -p ~/.docker; echo -n "${QUAY_AUTH}" > ~/.docker/config.json; + SHORT_COMMIT="$(echo $CIRCLE_SHA1 | cut -c1-7)"; + docker push "${QUAY_IMAGE}:${SHORT_COMMIT}"; + docker push "${QUAY_IMAGE}:${CIRCLE_BRANCH}" + + system_tests: + machine: + image: ubuntu-1604:201903-01 + environment: + - FINAL_IMAGE: quay.io/chronicled/blockchain-interface + steps: + - run: mkdir -p ~/.docker ; echo -n "${QUAY_AUTH}" > ~/.docker/config.json + - run: SHORT_COMMIT="$(echo $CIRCLE_SHA1 | cut -c1-7)"; + docker run quay.io/chronicled/c-rex + run-patch + --token "${CIRCLE_TOKEN}" + --origin-branch "${CIRCLE_BRANCH}" + --branch "develop" + --merge-origin-branch "develop" + blockchain blockchain "${FINAL_IMAGE}:${SHORT_COMMIT}" + workflows: version: 2 blockchain-interface-workflow: jobs: - test - - deploy_docker_image: + - image: requires: - test - filters: - branches: - only: blockchain-interface + - system_tests: + requires: + - image diff --git a/Cargo.lock b/Cargo.lock index f0056ac458..f04bacb170 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2401,25 +2401,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "lapin" -version = "0.28.2" -source = "registry+https://github.com/rust-lang/crates.io-index" +version = "0.28.3" +source = "registry+https://dl.cloudsmith.io/ItqwH3F8rYFNB5vv/chronicled/platform-v2/cargo/index.git" dependencies = [ "amq-protocol 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "amq-protocol-codegen 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-channel 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "lapin-futures" -version = "0.28.2" -source = "registry+https://github.com/rust-lang/crates.io-index" +version = "0.28.3" +source = "registry+https://dl.cloudsmith.io/ItqwH3F8rYFNB5vv/chronicled/platform-v2/cargo/index.git" dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "lapin 0.28.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lapin 0.28.3 (registry+https://dl.cloudsmith.io/ItqwH3F8rYFNB5vv/chronicled/platform-v2/cargo/index.git)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3179,14 +3179,14 @@ dependencies = [ "kvdb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-memorydb 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-rocksdb 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "lapin-futures 0.28.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lapin-futures 0.28.3 (registry+https://dl.cloudsmith.io/ItqwH3F8rYFNB5vv/chronicled/platform-v2/cargo/index.git)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "macros 0.1.0", "parity-runtime 0.1.0", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "prometheus 0.8.0 (git+https://github.com/pingcap/rust-prometheus.git)", - "rabbitmq_adaptor 0.4.3 (registry+https://dl.cloudsmith.io/ItqwH3F8rYFNB5vv/chronicled/platform-v2/cargo/index.git)", + "rabbitmq_adaptor 0.4.4 (registry+https://dl.cloudsmith.io/ItqwH3F8rYFNB5vv/chronicled/platform-v2/cargo/index.git)", "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3468,6 +3468,15 @@ dependencies = [ "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "parking_lot" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lock_api 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot_core 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "parking_lot_core" version = "0.3.1" @@ -3509,6 +3518,19 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "parking_lot_core" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "patricia-trie-ethereum" version = "0.1.0" @@ -3793,7 +3815,7 @@ dependencies = [ [[package]] name = "rabbitmq_adaptor" -version = "0.4.3" +version = "0.4.4" source = "registry+https://dl.cloudsmith.io/ItqwH3F8rYFNB5vv/chronicled/platform-v2/cargo/index.git" dependencies = [ "amq-protocol 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3804,7 +3826,7 @@ dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "futures-retry 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "futures-util 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lapin-futures 0.28.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lapin-futures 0.28.3 (registry+https://dl.cloudsmith.io/ItqwH3F8rYFNB5vv/chronicled/platform-v2/cargo/index.git)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4465,6 +4487,11 @@ name = "smallvec" version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "smallvec" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "socket2" version = "0.3.11" @@ -5594,8 +5621,8 @@ dependencies = [ "checksum kvdb-memorydb 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "296c12309ed36cb74d59206406adbf1971c3baa56d5410efdb508d8f1c60a351" "checksum kvdb-rocksdb 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "96eb0e0112bb66fe5401294ca0f43c9cb771456af9270443545026e55fd00912" "checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" -"checksum lapin 0.28.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f965cb3ae24cffb7b0fb052b221bbd58068e99d37aed0b019095232352351ded" -"checksum lapin-futures 0.28.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4e0bc15acf68eafaed7c5f1560cd55f808db8b0bcb3aa67a096efd6ceceff5f7" +"checksum lapin 0.28.3 (registry+https://dl.cloudsmith.io/ItqwH3F8rYFNB5vv/chronicled/platform-v2/cargo/index.git)" = "8be17594e6c381a168dee69d88919a0c4a3326a8a021a8b98364cc90834a669b" +"checksum lapin-futures 0.28.3 (registry+https://dl.cloudsmith.io/ItqwH3F8rYFNB5vv/chronicled/platform-v2/cargo/index.git)" = "fcdd837603b01f834c2122b3ace73545f350d3190536286c884d83a4904d4b2f" "checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" "checksum lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" @@ -5666,12 +5693,14 @@ dependencies = [ "checksum parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)" = "511379a8194230c2395d2f5fa627a5a7e108a9f976656ce723ae68fca4097bfc" "checksum parity-wordlist 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "573d08f0d3bc8a6ffcdac1de2725b5daeed8db26345a9c12d91648e2d6457f3e" "checksum parity-ws 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2fec5048fba72a2e01baeb0d08089db79aead4b57e2443df172fb1840075a233" +"checksum parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "92e98c49ab0b7ce5b222f2cc9193fc4efe11c6d0bd4f648e374684a6857b1cfc" "checksum parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0802bff09003b291ba756dc7e79313e51cc31667e94afbe847def490424cde5" "checksum parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ab41b4aed082705d1056416ae4468b6ea99d52599ecf3169b00088d43113e337" "checksum parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" "checksum parking_lot_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad7f7e6ebdc79edff6fdcb87a55b620174f7a989e3eb31b65231f4af57f00b8c" "checksum parking_lot_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94c8c7923936b28d546dfd14d4472eaf34c99b14e1c973a32b3e6d4eb04298c9" "checksum parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" +"checksum parking_lot_core 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7582838484df45743c8434fbff785e8edf260c28748353d44bc0da32e0ceabf1" "checksum pbkdf2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0c09cddfbfc98de7f76931acf44460972edb4023eb14d0c6d4018800e552d8e0" "checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" "checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" @@ -5701,7 +5730,7 @@ dependencies = [ "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" "checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" "checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" -"checksum rabbitmq_adaptor 0.4.3 (registry+https://dl.cloudsmith.io/ItqwH3F8rYFNB5vv/chronicled/platform-v2/cargo/index.git)" = "dc0f695e96713145f8ca65247041ad38c391ef60279e970677e2a5fd9a257ff1" +"checksum rabbitmq_adaptor 0.4.4 (registry+https://dl.cloudsmith.io/ItqwH3F8rYFNB5vv/chronicled/platform-v2/cargo/index.git)" = "7d05ba52e3f2951ef2fae3c0219b9a942e4e45d9bf5fcdb3bf81585dd0cad1a5" "checksum rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" "checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" "checksum rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c618c47cd3ebd209790115ab837de41425723956ad3ce2e6a7f09890947cacb9" @@ -5776,6 +5805,7 @@ dependencies = [ "checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23" "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" "checksum smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ab606a9c5e214920bb66c458cd7be8ef094f813f20fe77a54cc7dbfff220d4b7" +"checksum smallvec 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5c2fb2ec9bcd216a5b0d0ccf31ab17b5ed1d627960edff65bbe95d3ce221cefc" "checksum socket2 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "e8b74de517221a2cb01a53349cf54182acdc31a074727d3079068448c0676d85" "checksum spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" "checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" diff --git a/rabbitmq/Cargo.toml b/rabbitmq/Cargo.toml index 73c27fc5f5..fa6353ae6d 100644 --- a/rabbitmq/Cargo.toml +++ b/rabbitmq/Cargo.toml @@ -10,7 +10,7 @@ failure = "0.1.6" futures = "0.1.6" hex = "0.3.2" hyper = "0.12" -lapin-futures = "0.28.1" +lapin-futures = { version = "0.28.3", registry = "chronicled-platform-v2" } lazy_static = "1.4" log = "0.4" parking_lot = "0.7" @@ -30,7 +30,7 @@ common-types = { path = "../ethcore/types" } ethereum-types = "0.4" futures-executor = "0.2.1" parity-runtime = { path = "../util/runtime" } -rabbitmq_adaptor = { version = "0.4.3", registry = "chronicled-platform-v2" } +rabbitmq_adaptor = { version = "0.4.4", registry = "chronicled-platform-v2" } rlp = { version = "0.3.0", features = ["ethereum"] } vm = { path = "../ethcore/vm" } diff --git a/rabbitmq/src/client.rs b/rabbitmq/src/client.rs index 1eed696744..596a0b6b2c 100644 --- a/rabbitmq/src/client.rs +++ b/rabbitmq/src/client.rs @@ -315,8 +315,6 @@ fn publish_new_block( info!(target: LOG_TARGET, "Error publishing: {}", err); handle_fatal_error(err); }) - .timeout(Duration::from_secs(10)) - .map_err(|_| ()) .map(move |_| { info!(target: LOG_TARGET, "Block message published: {:?}", block_number); ()