Skip to content

Commit

Permalink
Move zombienet cumulus pipeline to gha (#7529)
Browse files Browse the repository at this point in the history
Includes a fix on the `wait` job (for waiting images to be ready).
  • Loading branch information
pepoviola authored Feb 12, 2025
1 parent 848875a commit 43ae08f
Show file tree
Hide file tree
Showing 2 changed files with 335 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/zombienet-reusable-preflight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ on:
SOURCE_REF_SLUG:
value: ${{ jobs.preflight.outputs.SOURCE_REF_SLUG }}

BUILD_RUN_ID:
value: ${{ jobs.wait_build_images.outputs.BUILD_RUN_ID }}
description: |
Id of the build run, needed to download the artifacts.
# Zombie vars
PUSHGATEWAY_URL:
value: ${{ jobs.preflight.outputs.PUSHGATEWAY_URL }}
Expand Down Expand Up @@ -216,10 +221,13 @@ jobs:
needs: [ci-env]
runs-on: ubuntu-latest
timeout-minutes: 30
outputs:
BUILD_RUN_ID: ${{ steps.wait_build.outputs.BUILD_RUN_ID }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Wait until "Build and push images" workflow is done
id: wait_build
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand All @@ -239,4 +247,15 @@ jobs:
fi
sleep 10
done
echo "CI workflow is done."
#check if the build succeeded
RUN_INFO=($(gh run ls -c $SHA -w "Build and push images" --json name,conclusion,databaseId --jq '.[] | select(.name == "Build and push images") | .conclusion, .databaseId'))
CONCLUSION=${RUN_INFO[@]:0:1}
BUILD_RUN_ID=${RUN_INFO[@]:1:1}
if [[ $CONCLUSION == "success" ]]; then
echo "CI workflow succeeded. (build run_id: ${BUILD_RUN_ID})"
echo "BUILD_RUN_ID=${BUILD_RUN_ID}" >> $GITHUB_OUTPUT
else
echo "::warning:: CI workflow ('Build and push images') fails with conclusion: $CONCLUSION"
exit 1
fi;
315 changes: 315 additions & 0 deletions .github/workflows/zombienet_cumulus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,315 @@
name: Zombienet Cumulus

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
RUN_IN_CONTAINER: 1
FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: 1
LOCAL_DIR: "./cumulus/zombienet/tests"
GHA_CLUSTER_SERVER_ADDR: "https://kubernetes.default:443"

# only run if we have changes in [subtrate, cumulus, polkadot] directories or this workflow.
jobs:
preflight:
uses: ./.github/workflows/zombienet-reusable-preflight.yml

zombienet-cumulus-0001-sync_blocks_from_tip_without_connected_collator:
needs: [preflight]
if: ${{ needs.preflight.outputs.changes_substrate || needs.preflight.outputs.changes_cumulus || needs.preflight.outputs.changes_polkadot }}
runs-on: ${{ needs.preflight.outputs.ZOMBIENET_RUNNER }} # NOTE: should be zombienet-arc-runner (without quotes)
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.ZOMBIENET_IMAGE }}
env:
RELAY_IMAGE: "${{ needs.preflight.outputs.TEMP_IMAGES_BASE }}/polkadot-debug:${{ needs.preflight.outputs.DOCKER_IMAGES_VERSION }}"
COL_IMAGE: "${{ needs.preflight.outputs.TEMP_IMAGES_BASE }}/test-parachain:${{ needs.preflight.outputs.DOCKER_IMAGES_VERSION }}"
steps:
- name: Checkout
uses: actions/checkout@v4

- name: script
run: |
echo "RELAY_IMAGE: $RELAY_IMAGE"
echo "COL_IMAGE: $COL_IMAGE"
export DEBUG=${{ needs.preflight.outputs.DEBUG }}
/home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh \
--local-dir="$(pwd)/$LOCAL_DIR" \
--concurrency=1 \
--test="0001-sync_blocks_from_tip_without_connected_collator.zndsl"
- name: upload logs
uses: actions/upload-artifact@v4
with:
name: zombienet-logs-${{ github.job }}-${{ github.sha }}
path: |
/tmp/zombie*/logs/*
zombienet-cumulus-0002-pov_recovery:
needs: [preflight]
if: ${{ needs.preflight.outputs.changes_substrate || needs.preflight.outputs.changes_cumulus || needs.preflight.outputs.changes_polkadot }}
runs-on: ${{ needs.preflight.outputs.ZOMBIENET_RUNNER }} # NOTE: should be zombienet-arc-runner (without quotes)
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.ZOMBIENET_IMAGE }}
env:
RELAY_IMAGE: "${{ needs.preflight.outputs.TEMP_IMAGES_BASE }}/polkadot-debug:${{ needs.preflight.outputs.DOCKER_IMAGES_VERSION }}"
COL_IMAGE: "${{ needs.preflight.outputs.TEMP_IMAGES_BASE }}/test-parachain:${{ needs.preflight.outputs.DOCKER_IMAGES_VERSION }}"
steps:
- name: Checkout
uses: actions/checkout@v4

- name: script
run: |
echo "RELAY_IMAGE: $RELAY_IMAGE"
echo "COL_IMAGE: $COL_IMAGE"
export DEBUG=${{ needs.preflight.outputs.DEBUG }}
/home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh \
--local-dir="$(pwd)/$LOCAL_DIR" \
--concurrency=1 \
--test="0002-pov_recovery.zndsl"
- name: upload logs
uses: actions/upload-artifact@v4
with:
name: zombienet-logs-${{ github.job }}-${{ github.sha }}
path: |
/tmp/zombie*/logs/*
zombienet-cumulus-0003-full_node_catching_up:
needs: [preflight]
if: ${{ needs.preflight.outputs.changes_substrate || needs.preflight.outputs.changes_cumulus || needs.preflight.outputs.changes_polkadot }}
runs-on: ${{ needs.preflight.outputs.ZOMBIENET_RUNNER }} # NOTE: should be zombienet-arc-runner (without quotes)
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.ZOMBIENET_IMAGE }}
env:
RELAY_IMAGE: "${{ needs.preflight.outputs.TEMP_IMAGES_BASE }}/polkadot-debug:${{ needs.preflight.outputs.DOCKER_IMAGES_VERSION }}"
COL_IMAGE: "${{ needs.preflight.outputs.TEMP_IMAGES_BASE }}/test-parachain:${{ needs.preflight.outputs.DOCKER_IMAGES_VERSION }}"
steps:
- name: Checkout
uses: actions/checkout@v4

- name: script
run: |
echo "RELAY_IMAGE: $RELAY_IMAGE"
echo "COL_IMAGE: $COL_IMAGE"
export DEBUG=${{ needs.preflight.outputs.DEBUG }}
/home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh \
--local-dir="$(pwd)/$LOCAL_DIR" \
--concurrency=1 \
--test="0003-full_node_catching_up.zndsl"
- name: upload logs
uses: actions/upload-artifact@v4
with:
name: zombienet-logs-${{ github.job }}-${{ github.sha }}
path: |
/tmp/zombie*/logs/*
zombienet-cumulus-0004-runtime_upgrade:
needs: [preflight]
if: ${{ needs.preflight.outputs.changes_substrate || needs.preflight.outputs.changes_cumulus || needs.preflight.outputs.changes_polkadot }}
runs-on: ${{ needs.preflight.outputs.ZOMBIENET_RUNNER }} # NOTE: should be zombienet-arc-runner (without quotes)
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.ZOMBIENET_IMAGE }}
env:
RELAY_IMAGE: "${{ needs.preflight.outputs.TEMP_IMAGES_BASE }}/polkadot-debug:${{ needs.preflight.outputs.DOCKER_IMAGES_VERSION }}"
COL_IMAGE: "${{ needs.preflight.outputs.TEMP_IMAGES_BASE }}/test-parachain:${{ needs.preflight.outputs.DOCKER_IMAGES_VERSION }}"
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/[email protected]
with:
name: build-test-parachain-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ needs.preflight.outputs.BUILD_RUN_ID }}

- name: tar
run: tar -xvf artifacts.tar

- name: script
run: |
echo "RELAY_IMAGE: $RELAY_IMAGE"
echo "COL_IMAGE: $COL_IMAGE"
ls -ltr *
cp ./artifacts/zombienet/wasm_binary_spec_version_incremented.rs.compact.compressed.wasm /tmp/
ls /tmp
export DEBUG=${{ needs.preflight.outputs.DEBUG }}
/home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh \
--local-dir="$(pwd)/$LOCAL_DIR" \
--concurrency=1 \
--test="0004-runtime_upgrade.zndsl"
- name: upload logs
uses: actions/upload-artifact@v4
with:
name: zombienet-logs-${{ github.job }}-${{ github.sha }}
path: |
/tmp/zombie*/logs/*
zombienet-cumulus-0005-migrate_solo_to_para:
needs: [preflight]
if: ${{ needs.preflight.outputs.changes_substrate || needs.preflight.outputs.changes_cumulus || needs.preflight.outputs.changes_polkadot }}
runs-on: ${{ needs.preflight.outputs.ZOMBIENET_RUNNER }} # NOTE: should be zombienet-arc-runner (without quotes)
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.ZOMBIENET_IMAGE }}
env:
RELAY_IMAGE: "${{ needs.preflight.outputs.TEMP_IMAGES_BASE }}/polkadot-debug:${{ needs.preflight.outputs.DOCKER_IMAGES_VERSION }}"
COL_IMAGE: "${{ needs.preflight.outputs.TEMP_IMAGES_BASE }}/test-parachain:${{ needs.preflight.outputs.DOCKER_IMAGES_VERSION }}"
steps:
- name: Checkout
uses: actions/checkout@v4

- name: script
run: |
echo "RELAY_IMAGE: $RELAY_IMAGE"
echo "COL_IMAGE: $COL_IMAGE"
export DEBUG=${{ needs.preflight.outputs.DEBUG }}
/home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh \
--local-dir="$(pwd)/$LOCAL_DIR" \
--concurrency=1 \
--test="0005-migrate_solo_to_para.zndsl"
- name: upload logs
uses: actions/upload-artifact@v4
with:
name: zombienet-logs-${{ github.job }}-${{ github.sha }}
path: |
/tmp/zombie*/logs/*
zombienet-cumulus-0006-rpc_collator_builds_blocks:
needs: [preflight]
if: ${{ needs.preflight.outputs.changes_substrate || needs.preflight.outputs.changes_cumulus || needs.preflight.outputs.changes_polkadot }}
runs-on: ${{ needs.preflight.outputs.ZOMBIENET_RUNNER }} # NOTE: should be zombienet-arc-runner (without quotes)
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.ZOMBIENET_IMAGE }}
env:
RELAY_IMAGE: "${{ needs.preflight.outputs.TEMP_IMAGES_BASE }}/polkadot-debug:${{ needs.preflight.outputs.DOCKER_IMAGES_VERSION }}"
COL_IMAGE: "${{ needs.preflight.outputs.TEMP_IMAGES_BASE }}/test-parachain:${{ needs.preflight.outputs.DOCKER_IMAGES_VERSION }}"
steps:
- name: Checkout
uses: actions/checkout@v4

- name: script
run: |
echo "RELAY_IMAGE: $RELAY_IMAGE"
echo "COL_IMAGE: $COL_IMAGE"
export DEBUG=${{ needs.preflight.outputs.DEBUG }}
/home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh \
--local-dir="$(pwd)/$LOCAL_DIR" \
--concurrency=1 \
--test="0006-rpc_collator_builds_blocks.zndsl"
- name: upload logs
uses: actions/upload-artifact@v4
with:
name: zombienet-logs-${{ github.job }}-${{ github.sha }}
path: |
/tmp/zombie*/logs/*
zombienet-cumulus-0007-full_node_warp_sync:
needs: [preflight]
if: ${{ needs.preflight.outputs.changes_substrate || needs.preflight.outputs.changes_cumulus || needs.preflight.outputs.changes_polkadot }}
runs-on: ${{ needs.preflight.outputs.ZOMBIENET_RUNNER }} # NOTE: should be zombienet-arc-runner (without quotes)
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.ZOMBIENET_IMAGE }}
env:
RELAY_IMAGE: "${{ needs.preflight.outputs.TEMP_IMAGES_BASE }}/polkadot-debug:${{ needs.preflight.outputs.DOCKER_IMAGES_VERSION }}"
COL_IMAGE: "${{ needs.preflight.outputs.TEMP_IMAGES_BASE }}/test-parachain:${{ needs.preflight.outputs.DOCKER_IMAGES_VERSION }}"
steps:
- name: Checkout
uses: actions/checkout@v4

- name: script
run: |
echo "RELAY_IMAGE: $RELAY_IMAGE"
echo "COL_IMAGE: $COL_IMAGE"
export DEBUG=${{ needs.preflight.outputs.DEBUG }}
/home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh \
--local-dir="$(pwd)/$LOCAL_DIR" \
--concurrency=1 \
--test="0007-full_node_warp_sync.zndsl"
- name: upload logs
uses: actions/upload-artifact@v4
with:
name: zombienet-logs-${{ github.job }}-${{ github.sha }}
path: |
/tmp/zombie*/logs/*
zombienet-cumulus-0008-elastic_authoring:
needs: [preflight]
if: ${{ needs.preflight.outputs.changes_substrate || needs.preflight.outputs.changes_cumulus || needs.preflight.outputs.changes_polkadot }}
runs-on: ${{ needs.preflight.outputs.ZOMBIENET_RUNNER }} # NOTE: should be zombienet-arc-runner (without quotes)
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.ZOMBIENET_IMAGE }}
env:
RELAY_IMAGE: "${{ needs.preflight.outputs.TEMP_IMAGES_BASE }}/polkadot-debug:${{ needs.preflight.outputs.DOCKER_IMAGES_VERSION }}"
COL_IMAGE: "${{ needs.preflight.outputs.TEMP_IMAGES_BASE }}/test-parachain:${{ needs.preflight.outputs.DOCKER_IMAGES_VERSION }}"
steps:
- name: Checkout
uses: actions/checkout@v4

- name: script
run: |
echo "RELAY_IMAGE: $RELAY_IMAGE"
echo "COL_IMAGE: $COL_IMAGE"
export DEBUG=${{ needs.preflight.outputs.DEBUG }}
/home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh \
--local-dir="$(pwd)/$LOCAL_DIR" \
--concurrency=1 \
--test="0008-elastic_authoring.zndsl"
- name: upload logs
uses: actions/upload-artifact@v4
with:
name: zombienet-logs-${{ github.job }}-${{ github.sha }}
path: |
/tmp/zombie*/logs/*
zombienet-cumulus-0009-elastic_pov_recovery:
needs: [preflight]
if: ${{ needs.preflight.outputs.changes_substrate || needs.preflight.outputs.changes_cumulus || needs.preflight.outputs.changes_polkadot }}
runs-on: ${{ needs.preflight.outputs.ZOMBIENET_RUNNER }} # NOTE: should be zombienet-arc-runner (without quotes)
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.ZOMBIENET_IMAGE }}
env:
RELAY_IMAGE: "${{ needs.preflight.outputs.TEMP_IMAGES_BASE }}/polkadot-debug:${{ needs.preflight.outputs.DOCKER_IMAGES_VERSION }}"
COL_IMAGE: "${{ needs.preflight.outputs.TEMP_IMAGES_BASE }}/test-parachain:${{ needs.preflight.outputs.DOCKER_IMAGES_VERSION }}"
steps:
- name: Checkout
uses: actions/checkout@v4

- name: script
run: |
echo "RELAY_IMAGE: $RELAY_IMAGE"
echo "COL_IMAGE: $COL_IMAGE"
export DEBUG=${{ needs.preflight.outputs.DEBUG }}
/home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh \
--local-dir="$(pwd)/$LOCAL_DIR" \
--concurrency=1 \
--test="0009-elastic_pov_recovery.zndsl"
- name: upload logs
uses: actions/upload-artifact@v4
with:
name: zombienet-logs-${{ github.job }}-${{ github.sha }}
path: |
/tmp/zombie*/logs/*

0 comments on commit 43ae08f

Please sign in to comment.