Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] add zombienet setup and run most integration tests from the encointer-node #230

Merged
merged 64 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
ed8b74e
[CI] fix typo
clangenb Jan 14, 2025
736bf73
[CI] copy integration tests from encointer-node
clangenb Jan 14, 2025
077bce6
[CI] add very simple integration tests
clangenb Jan 14, 2025
04d2ef2
[CI] first try in running a zombienet setup
clangenb Jan 14, 2025
eb8d35c
[CI] fix CI syntax
clangenb Jan 14, 2025
55bae3e
[CI] fix job dependency
clangenb Jan 14, 2025
bb0d384
debug integration test
clangenb Jan 14, 2025
6114a62
fix bin locations
clangenb Jan 14, 2025
90280f8
upload binary without github sha for debugging
clangenb Jan 14, 2025
8820ebc
FIX: re-introduce job dependency
clangenb Jan 14, 2025
a2fde83
fix zombienet dir
clangenb Jan 14, 2025
f385d4a
try fix other run download
clangenb Jan 14, 2025
8a81e33
print sleep statement
clangenb Jan 14, 2025
ef6aad4
fix script permissions
clangenb Jan 14, 2025
83ab614
fix signer in bootstrap script
clangenb Jan 14, 2025
09c87dd
check if default alice works
clangenb Jan 14, 2025
0729d68
re-enable build
clangenb Jan 15, 2025
07ef576
run the docker container with `-it`
clangenb Jan 15, 2025
d8fe3c2
remove -ti flag for node run, as this does not work
clangenb Jan 15, 2025
dc2a284
use new encointer-client docker image
clangenb Jan 15, 2025
d2d1b12
disable previous steps
clangenb Jan 15, 2025
b2560fc
disable previous steps
clangenb Jan 15, 2025
a0044c9
[CI] update docker commands
clangenb Jan 17, 2025
065bdab
[CI] bump docker tag
clangenb Jan 17, 2025
2d0e471
[CI] add signer alice run on test/ci
clangenb Jan 17, 2025
0db3c78
[CI] downgrade batch size for bootstrapping too
clangenb Jan 17, 2025
64aeb78
sleep longer in CI
clangenb Jan 17, 2025
fbf9673
sleep longer in CI
clangenb Jan 17, 2025
80d551f
add 2nd collator to integration test setup
clangenb Jan 18, 2025
a78d0cd
run integration tests on 20.04
clangenb Jan 18, 2025
bd5286a
make bob single councillor to prevent nonce collision with faucet
clangenb Jan 18, 2025
6c11e2d
re-enable the rest of the CI as it needs to rebuild the node
clangenb Jan 18, 2025
a146515
remove unnecessary encointer-deps
clangenb Jan 18, 2025
e625743
[CI] download collator from current run
clangenb Jan 18, 2025
2c45d2e
[CI] make alice single councillor again
clangenb Jan 18, 2025
78e1d44
[CI] conditionally start faucet/phase accelerator service and run boo…
clangenb Jan 18, 2025
c5a3725
[CI] conditionally start faucet/phase accelerator service and run boo…
clangenb Jan 18, 2025
a68459b
[CI] sleep less as we are async backing now!
clangenb Jan 18, 2025
af1f262
[CI] check if the issue is solved with only one relay/parachain node
clangenb Jan 19, 2025
dd6ffe3
Merge branch 'master' into cl/add-integration-tests
clangenb Jan 21, 2025
f6058d6
run CI on ubuntu 22.04
clangenb Jan 21, 2025
3125eb9
[zombienet] make pool type fork aware
clangenb Jan 21, 2025
a75ac7c
Revert "[zombienet] make pool type fork aware"
clangenb Jan 21, 2025
5f412a9
add new tests to the CI.
clangenb Jan 22, 2025
0247b46
[CI] introduce test flag env var
clangenb Jan 22, 2025
a00c1c3
[CI] update encointer client docker tag
clangenb Jan 22, 2025
4cf2219
Revert "[CI] introduce test flag env var"
clangenb Jan 22, 2025
b42b55a
[CI] add waiting blocks to call
clangenb Jan 22, 2025
d5c4f1f
[CI] fix syntax
clangenb Jan 22, 2025
c2ae926
[CI] remove obsolete stuff
clangenb Jan 22, 2025
b96ad18
[CI] fix test flag
clangenb Jan 22, 2025
fd25ab9
[CI] run with omni node
clangenb Jan 22, 2025
0cdcd07
[CI] skip build
clangenb Jan 22, 2025
c71dc1a
Revert "[CI] skip build"
clangenb Jan 22, 2025
f852cd6
[CI] skip build
clangenb Jan 22, 2025
836cd96
[CI] fix omni node link
clangenb Jan 22, 2025
1dd0afd
[CI] remove redundant chmod
clangenb Jan 22, 2025
fa47534
[CI] remove unnecessary step
clangenb Jan 22, 2025
9c2619c
[CI] bump encointer-client docker
clangenb Jan 22, 2025
8d2fb86
[CI] add 3 relay chain nodes
clangenb Jan 22, 2025
f28ebe2
[CI] add --is-parachain flag to tests
clangenb Jan 22, 2025
1499486
[CI] enable whole ci again
clangenb Jan 22, 2025
9a46420
[CI] disable bot-community test for now
clangenb Jan 22, 2025
cc391e0
[CI] Better comments
clangenb Jan 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 107 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-20.04 ]
os: [ ubuntu-22.04 ]
rust: [ stable ]
binary: [ release ]
env:
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
path: target/release/encointer-collator

cargo-toml-fmt:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
container: "tamasfe/taplo:0.7.0-alpine"
steps:
- uses: actions/checkout@v4
Expand All @@ -83,7 +83,7 @@ jobs:

create_artifacts:
needs: [ build_primary_binaries ]
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
CHAIN_SPEC: ${{ matrix.chain }}-${{ matrix.config }}
strategy:
Expand Down Expand Up @@ -126,6 +126,109 @@ jobs:
${{ env.CHAIN_SPEC }}.json
${{ env.CHAIN_SPEC }}.json.state

integration-test:
# name: ${{ matrix.test }}
name: integration-test
runs-on: ubuntu-22.04
needs: build_primary_binaries
strategy:
fail-fast: false
matrix:
include:
- test: bootstrap_demo_community.py --signer //Alice -w collective --batch-size 7 --waiting-blocks 5 --is-parachain --test cc-fee-payment
brenzi marked this conversation as resolved.
Show resolved Hide resolved
# Don't start phase/faucet. It is not needed and there might be occasional nonce collisions with Alice.
needs_phase_and_faucet: false
- test: bootstrap_demo_community.py --signer //Alice -w collective --batch-size 7 --waiting-blocks 5 --is-parachain --test faucet
needs_phase_and_faucet: false
# Fixme #232: Script does not support purging a community for the parachain, as root is required.
# - test: bootstrap_demo_community.py --signer //Alice -w collective --batch-size 7 --waiting-blocks 5 --is-parachain --test reputation-caching
# needs_phase_and_faucet: false
- test: bootstrap_demo_community.py --signer //Alice -w collective --batch-size 7 --waiting-blocks 5 --is-parachain --test endorsement
needs_phase_and_faucet: false
- test: bootstrap_demo_community.py --signer //Alice -w collective --batch-size 7 --waiting-blocks 5 --is-parachain --test unregister-and-upgrade-registration
needs_phase_and_faucet: false
# Fixme #232: Democracy params are runtime constants we cannot change, hence the democracy cycle takes too long to execute for the CI.
# - test: bootstrap_demo_community.py --signer //Alice -w collective --batch-size 7 --waiting-blocks 5 --is-parachain --test democracy
# needs_phase_and_faucet: false
# Fixme #232: Consistently fails at some random point due to:
# 1. wrong phase in the beginning (phase.py switches phase due to long idle times as we wait for a few blocks).
# 2. due to a nonce collision with Alice in phase/faucet.
# - test: bot-community-test -f http://host.docker.internal:5000/api -w collective --batch-size 7 --waiting-blocks 3
# needs_phase_and_faucet: true
env:
ZOMBIENET_VERSION: v1.3.116
POLKADOT_VERSION: polkadot-stable2412
ENCOINTER_CLIENT_DOCKER_TAG: 1.16.2
steps:
- uses: actions/checkout@v4

- name: Create testing directories
run: mkdir -p zombienet-tests/bin

- name: Setup zombienet binaries
run: |
mkdir -p zombienet-tests/bin
cd zombienet-tests/bin
wget -q "https://github.com/paritytech/zombienet/releases/download/${{ env.ZOMBIENET_VERSION }}/zombienet-linux-x64"
chmod +x zombienet-linux-x64
./zombienet-linux-x64 setup polkadot -y || :
./zombienet-linux-x64 version

- name: Get Omni-Node
run: |
cd zombienet-tests/bin
wget -q "https://github.com/paritytech/polkadot-sdk/releases/download/${{ env.POLKADOT_VERSION }}/polkadot-omni-node"
chmod +x polkadot-omni-node
./polkadot-omni-node --version

- name: Download Encointer Collator
uses: actions/download-artifact@v4
with:
name: encointer-collator-${{ github.sha }}
# for debugging the integration tests, we can just download an image from a previous run
# name: encointer-collator-859e7ba3e64e971a91b1174a4d9423bb854be9d9
# github-token: ${{ github.token }}
# run-id: 12904591738

- name: fix permissions of artifacts and move to test directory
run: |
chmod +x encointer-collator
cp encointer-collator zombienet-tests/bin

- name: Start zombienet-setup and sleep until the parachain produces blocks (approx 100 seconds)
run: |
zombienet-tests/bin/zombienet-linux-x64 spawn --provider native zombienet/github-actions-setup.toml &
echo "setup zombienet, sleep for 100 secs until parachain produces blocks"
sleep 90

- name: start faucet service
if: ${{ matrix.needs_phase_and_faucet }}
run: |
docker run -p 5000:5000 \
--add-host host.docker.internal:host-gateway \
encointer/encointer-client-notee:${{ env.ENCOINTER_CLIENT_DOCKER_TAG }} faucet.py \
-u ws://host.docker.internal \
--port 9944 &

- name: start phase accelerator service
if: ${{ matrix.needs_phase_and_faucet }}
# 5 idle blocks needed, which is more than the solochain because fewer extrinsics fit into a block
run: |
docker run \
--add-host host.docker.internal:host-gateway \
encointer/encointer-client-notee:${{ env.ENCOINTER_CLIENT_DOCKER_TAG }} phase.py \
-u ws://host.docker.internal \
--port 9944 --idle-blocks 5 &

- name: Test ${{ matrix.test }}
run: |
docker run \
--add-host host.docker.internal:host-gateway \
encointer/encointer-client-notee:${{ env.ENCOINTER_CLIENT_DOCKER_TAG }} ${{ matrix.test }} \
-u ws://host.docker.internal \
--port 9944 \


release:
name: Draft Release
if: startsWith(github.ref, 'refs/tags/')
Expand All @@ -137,7 +240,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Download Integritee Collator
- name: Download Encointer Collator
uses: actions/download-artifact@v4
with:
name: encointer-collator-${{ github.sha }}
Expand Down
Empty file modified scripts/temp_parachain_types.json
100644 → 100755
Empty file.
46 changes: 46 additions & 0 deletions zombienet/github-actions-setup.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[settings]
timeout = 10000

[relaychain]
default_command = "zombienet-tests/bin/polkadot"
default_args = ["-lparachain=debug,xcm=trace"]

chain = "rococo-local"

[[relaychain.nodes]]
name = "alice"
validator = true
ws_port = 9999

[[relaychain.nodes]]
name = "bob"
validator = true
ws_port = 9988

[[relaychain.nodes]]
name = "charlie"
validator = true
ws_port = 9977

[[parachains]]
id = 1003
addToGenesis = true
cumulus_based = true
chain = "encointer-rococo-local-dev"

[[parachains.collators]]
name = "encointer-collator01"
command = "zombienet-tests/bin/encointer-collator"
args = [
"--enable-offchain-indexing=true",
"-lencointer=debug,xcm=trace",
]
ws_port = 9944

[[parachains.collators]]
name = "encointer-collator02"
command = "zombienet-tests/bin/polkadot-omni-node"
args = [
"--pool-type=fork-aware"
]
ws_port = 9945
59 changes: 29 additions & 30 deletions zombienet/rococo-local-with-encointer.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,45 @@ timeout = 10000

[relaychain]
default_command = "~/bin/polkadot"
default_args = [ "-lparachain=debug,xcm=trace" ]
default_args = ["-lparachain=debug,xcm=trace"]

chain = "rococo-local"

[[relaychain.nodes]]
name = "alice"
validator = true
ws_port = 9999
[[relaychain.nodes]]
name = "alice"
validator = true
ws_port = 9999

[[relaychain.nodes]]
name = "bob"
validator = true
ws_port = 9988
[[relaychain.nodes]]
name = "bob"
validator = true
ws_port = 9988

[[relaychain.nodes]]
name = "charlie"
validator = true
ws_port = 9977
[[relaychain.nodes]]
name = "charlie"
validator = true
ws_port = 9977

[[parachains]]
id = 1003
addToGenesis = true
cumulus_based = true
chain = "encointer-rococo-local-dev"

[[parachains.collators]]
name = "encointer-collator01"
command = "./target/release/encointer-collator"
args = [
"--enable-offchain-indexing=true",
"-lencointer=debug,xcm=trace",
]
ws_port = 9944

[[parachains.collators]]
name = "encointer-collator02"
command = "./target/release/encointer-collator"
args = [
"--enable-offchain-indexing=true",
"-lencointer=debug,xcm=trace",
]
ws_port = 9945
[[parachains.collators]]
name = "encointer-collator01"
command = "./target/release/encointer-collator"
args = [
"--enable-offchain-indexing=true",
"-lencointer=debug,xcm=trace",
]
ws_port = 9944

[[parachains.collators]]
name = "encointer-collator02"
command = "~/bin/polkadot-omni-node"
args = [
"--pool-type=fork-aware"
]
ws_port = 9945

Loading