-
Notifications
You must be signed in to change notification settings - Fork 699
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add bridge zombienet test back to the CI (#3264)
Related to #3176 This PR only adds the first bridge zombienet test back to the CI after fixing it, reverting #3071 Credits to @svyatonik for building all the CI infrastructure around this.
- Loading branch information
Showing
5 changed files
with
155 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# This file is part of .gitlab-ci.yml | ||
# Here are all jobs that are executed during "zombienet" stage for bridges | ||
|
||
# common settings for all zombienet jobs | ||
.zombienet-bridges-common: | ||
extends: | ||
- .kubernetes-env | ||
- .zombienet-refs | ||
rules: | ||
- !reference [.build-refs, rules] | ||
- if: $CI_COMMIT_REF_NAME =~ /^gh-readonly-queue.*$/ | ||
variables: | ||
DOCKER_IMAGES_VERSION: ${CI_COMMIT_SHORT_SHA} | ||
before_script: | ||
- echo "Zombienet Tests Config" | ||
- echo "${ZOMBIENET_IMAGE}" | ||
- echo "${GH_DIR}" | ||
- echo "${LOCAL_DIR}" | ||
- ls "${LOCAL_DIR}" | ||
- export DEBUG=zombie,zombie::network-node | ||
- export ZOMBIENET_INTEGRATION_TEST_IMAGE="${BRIDGES_ZOMBIENET_TESTS_IMAGE}":${BRIDGES_ZOMBIENET_TESTS_IMAGE_TAG} | ||
- echo "${ZOMBIENET_INTEGRATION_TEST_IMAGE}" | ||
stage: zombienet | ||
image: "${BRIDGES_ZOMBIENET_TESTS_IMAGE}:${BRIDGES_ZOMBIENET_TESTS_IMAGE_TAG}" | ||
needs: | ||
- job: build-push-image-bridges-zombienet-tests | ||
artifacts: true | ||
variables: | ||
BRIDGES_ZOMBIENET_TESTS_IMAGE_TAG: ${DOCKER_IMAGES_VERSION} | ||
BRIDGES_ZOMBIENET_TESTS_IMAGE: "docker.io/paritypr/bridges-zombienet-tests" | ||
GH_DIR: "https://github.com/paritytech/polkadot-sdk/tree/${CI_COMMIT_SHA}/bridges/zombienet" | ||
LOCAL_DIR: "/builds/parity/mirrors/polkadot-sdk/bridges/zombienet" | ||
FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: 1 | ||
RUN_IN_CONTAINER: "1" | ||
artifacts: | ||
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}_zombienet_bridge_tests" | ||
when: always | ||
expire_in: 2 days | ||
paths: | ||
- ./zombienet-logs | ||
after_script: | ||
- mkdir -p ./zombienet-logs | ||
# copy general logs | ||
- cp -r /tmp/bridges-tests-run-*/logs/* ./zombienet-logs/ | ||
# copy logs of rococo nodes | ||
- cp -r /tmp/bridges-tests-run-*/bridge_hub_rococo_local_network/*.log ./zombienet-logs/ | ||
# copy logs of westend nodes | ||
- cp -r /tmp/bridges-tests-run-*/bridge_hub_westend_local_network/*.log ./zombienet-logs/ | ||
|
||
zombienet-bridges-0001-asset-transfer-works: | ||
extends: | ||
- .zombienet-bridges-common | ||
script: | ||
- /home/nonroot/bridges-polkadot-sdk/bridges/zombienet/run-new-test.sh 0001-asset-transfer --docker | ||
- echo "Done" |
58 changes: 58 additions & 0 deletions
58
docker/dockerfiles/bridges_zombienet_tests_injected.Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# this image is built on top of existing Zombienet image | ||
ARG ZOMBIENET_IMAGE | ||
# this image uses substrate-relay image built elsewhere | ||
ARG SUBSTRATE_RELAY_IMAGE=docker.io/paritytech/substrate-relay:v2023-11-07-rococo-westend-initial-relayer | ||
|
||
# metadata | ||
ARG VCS_REF | ||
ARG BUILD_DATE | ||
ARG IMAGE_NAME | ||
|
||
# we need `substrate-relay` binary, built elsewhere | ||
FROM ${SUBSTRATE_RELAY_IMAGE} as relay-builder | ||
|
||
# the base image is the zombienet image - we are planning to run zombienet tests using native | ||
# provider here | ||
FROM ${ZOMBIENET_IMAGE} | ||
|
||
LABEL io.parity.image.authors="devops-team@parity.io" \ | ||
io.parity.image.vendor="Parity Technologies" \ | ||
io.parity.image.title="${IMAGE_NAME}" \ | ||
io.parity.image.description="Bridges Zombienet tests." \ | ||
io.parity.image.source="https://github.com/paritytech/polkadot-sdk/blob/${VCS_REF}/docker/dockerfiles/bridges_zombienet_tests_injected.Dockerfile" \ | ||
io.parity.image.revision="${VCS_REF}" \ | ||
io.parity.image.created="${BUILD_DATE}" \ | ||
io.parity.image.documentation="https://github.com/paritytech/polkadot-sdk/bridges/zombienet" | ||
|
||
# show backtraces | ||
ENV RUST_BACKTRACE 1 | ||
USER root | ||
|
||
# for native provider to work (TODO: fix in zn docker?) | ||
RUN apt-get update && apt-get install -y procps sudo | ||
RUN yarn global add @polkadot/api-cli | ||
|
||
# add polkadot binary to the docker image | ||
COPY ./artifacts/polkadot /usr/local/bin/ | ||
COPY ./artifacts/polkadot-execute-worker /usr/local/bin/ | ||
COPY ./artifacts/polkadot-prepare-worker /usr/local/bin/ | ||
# add polkadot-parachain binary to the docker image | ||
COPY ./artifacts/polkadot-parachain /usr/local/bin | ||
# copy substrate-relay to the docker image | ||
COPY --from=relay-builder /home/user/substrate-relay /usr/local/bin/ | ||
# we need bridges zombienet runner and tests | ||
RUN mkdir -p /home/nonroot/bridges-polkadot-sdk | ||
COPY ./artifacts/bridges-polkadot-sdk /home/nonroot/bridges-polkadot-sdk | ||
# also prepare `generate_hex_encoded_call` for running | ||
RUN set -eux; \ | ||
cd /home/nonroot/bridges-polkadot-sdk/cumulus/scripts/generate_hex_encoded_call; \ | ||
npm install | ||
|
||
# check if executable works in this container | ||
USER nonroot | ||
RUN /usr/local/bin/polkadot --version | ||
RUN /usr/local/bin/polkadot-parachain --version | ||
RUN /usr/local/bin/substrate-relay --version | ||
|
||
# https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:{PORT}#/explorer | ||
EXPOSE 9942 9910 8943 9945 9010 8945 |