Skip to content

Commit 6943547

Browse files
authored
synthetic-network for nightly-pipeline (#804)
* as_ref in aleph-client for Connection types * rust API for synthetic-network's json API * refactored synthetic-link * new e2e-tests: high out-latency * refactored synthetic-network bash scripts * added git submodule for synthetic-network * added nightly e2e test for synthetic-network * refactored synthetic-link library * added load_config for synthetic-network e2e test * more refactoring of synthetic-link * missing synthetic-link in Cargo.toml * e2e-tests/config.rs cleaned * Into -> From in synthetic-link * slightly cleaned code for synthetic-network * added RUST_SRC_PATH in shell.nix for better support for IDEs * slightly cleaned synthetic-link * refactored synthetic-link: more types for ranged parameters * refactored synthetic-link lib * added code-docs to synthetic-link * using try_from for PortRange in synthetic-lib for input validation * missing deps after merge for synthetic-network * REVERT ME testing nightly pipeline * fix after merge * say no to install-protoc in github pipelines * Revert "say no to install-protoc in github pipelines" This reverts commit b991f75. * GITHUB_TOKEN for "Install Protoc" action * reverted changed file permissions * reverted rust-toolchain file * typo in description for PortRange * e2e-tests: config.validator_names() uses validators_count * e2e-tests: added description for the `latency` tests * shell.nix: added description for new ENV var RUST_SRC_PATH - it's for rust-analyzer * BACKUP: e2e-tests/config.rs with iterators * new verion of the synthetic-network e2e-test that supports non-dockerized runs (urls) * fix for e2e-test `no_quorum_without_high_latency` - missing call for urls instead of names * extended README.md for the synthetic-network: how to run e2e-tests with synthetic-network locally * renamed e2e-tests for high-out-latency with synthetic-network * renamed one of the e2e-tests pipelines in nightly for high-latency (synthetic-network) * Revert "REVERT ME testing nightly pipeline" This reverts commit 8eb1410.
1 parent 917b76e commit 6943547

29 files changed

+2350
-74
lines changed

.github/actions/run-e2e-test/action.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ inputs:
3030
description: 'Whether to deploy the adder sample contract to the node.'
3131
required: false
3232
default: 'false'
33+
image-path:
34+
description: 'Custom path to docker image for aleph-node'
35+
required: false
36+
default: aleph-test-docker
37+
node-image:
38+
description: 'Custom name of aleph-node image'
39+
required: false
40+
default: aleph-node:latest
41+
compose-file:
42+
description: 'Custom docker-compose configuration'
43+
required: false
44+
default: ''
3345

3446
runs:
3547
using: 'composite'
@@ -38,15 +50,15 @@ runs:
3850
- name: Download artifact with docker image
3951
uses: actions/download-artifact@v2
4052
with:
41-
name: aleph-test-docker
53+
name: ${{ inputs.image-path }}
4254

4355
- name: Load node docker image
4456
shell: bash
4557
run: docker load -i aleph-node.tar
4658

4759
- name: Run consensus party
4860
shell: bash
49-
run: ./.github/scripts/run_consensus.sh -m ${{ inputs.min-validator-count }} -n ${{ inputs.node-count }}
61+
run: NODE_IMAGE=${{ inputs.node-image }} DOCKER_COMPOSE=${{ inputs.compose-file }} ./.github/scripts/run_consensus.sh -m ${{ inputs.min-validator-count }} -n ${{ inputs.node-count }}
5062

5163
- name: Sleep
5264
shell: bash

.github/scripts/run_consensus.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ NODE_COUNT=5
88
MIN_VALIDATOR_COUNT=4
99
DOCKER_COMPOSE=${DOCKER_COMPOSE:-"docker/docker-compose.yml"}
1010
OVERRIDE_DOCKER_COMPOSE=${OVERRIDE_DOCKER_COMPOSE:-""}
11+
NODE_IMAGE=${NODE_IMAGE:-aleph-node:latest}
1112

1213
# default minimum validator count
1314
MIN_VALIDATOR_COUNT=4
1415

15-
export NODE_IMAGE=aleph-node:latest
16+
export NODE_IMAGE
1617

1718
mkdir -p docker/data/
1819

.github/scripts/run_e2e_test.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ if [[ -n "${ADDER:-}" ]]; then
116116
ARGS+=(-e "ADDER_METADATA=/contracts/adder/target/ink/metadata.json")
117117
fi
118118

119+
if [[ -n "${OUT_LATENCY:-}" ]]; then
120+
ARGS+=(-e OUT_LATENCY)
121+
fi
122+
119123
docker run -v "$(pwd)/contracts:/contracts" -v "$(pwd)/docker/data:/data" "${ARGS[@]}" aleph-e2e-client:latest
120124

121125
exit $?

.github/workflows/build-and-push-cliain.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
uses: arduino/setup-protoc@v1
2222
with:
2323
version: '3.6.1'
24+
repo-token: ${{ secrets.GITHUB_TOKEN }}
2425

2526
- name: Cargo | Build release binary
2627
run: |
@@ -29,18 +30,18 @@ jobs:
2930
- name: GIT | Get branch name and commit SHA
3031
id: get_branch
3132
uses: ./.github/actions/get-branch
32-
33+
3334
- name: Login to ECR
3435
uses: docker/login-action@v1
3536
with:
3637
registry: public.ecr.aws
3738
username: ${{ secrets.AWS_MAINNET_ACCESS_KEY_ID }}
3839
password: ${{ secrets.AWS_MAINNET_SECRET_ACCESS_KEY }}
39-
40+
4041
- name: Set up Docker Buildx
4142
id: buildx
4243
uses: docker/setup-buildx-action@master
43-
44+
4445
- name: Build and push latest docker image
4546
id: build-image
4647
env:

.github/workflows/build-node-and-runtime.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
uses: arduino/setup-protoc@v1
3838
with:
3939
version: '3.6.1'
40+
repo-token: ${{ secrets.GITHUB_TOKEN }}
4041

4142
- name: Install WASM target
4243
run: rustup target add wasm32-unknown-unknown

.github/workflows/build-send-postsync-hook-runtime-image.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ jobs:
3636
- name: Install Protoc
3737
uses: arduino/setup-protoc@v1
3838
with:
39-
version: '3.6.1'
39+
version: '3.6.1'
40+
repo-token: ${{ secrets.GITHUB_TOKEN }}
4041

4142
- name: Build binary
4243
run: |
@@ -76,7 +77,7 @@ jobs:
7677
7778
docker tag ${{ env.ECR_PUSH_IMAGE }} ${{ env.ECR_LATEST }}
7879
docker push ${{ env.ECR_LATEST }}
79-
80+
8081
- name: GIT | Checkout aleph-apps repo
8182
uses: actions/checkout@master
8283
with:
@@ -89,8 +90,8 @@ jobs:
8990
with:
9091
kustomize-version: "3.8.6"
9192

92-
- name: Update postsync hook docker image
93-
env:
93+
- name: Update postsync hook docker image
94+
env:
9495
RELEASE_IMAGE: public.ecr.aws/p6e8q1z1/runtime-update-hook:${{ steps.vars.outputs.sha_short }}
9596
REGIONS_AWS: 'eu-central-1'
9697
run: |

.github/workflows/check-excluded-packages.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
uses: arduino/setup-protoc@v1
3232
with:
3333
version: '3.6.1'
34+
repo-token: ${{ secrets.GITHUB_TOKEN }}
3435

3536
- name: Read excluded packages from Cargo.toml
3637
id: read_excluded

.github/workflows/e2e-tests-main-devnet.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ jobs:
6868
- name: Install Protoc
6969
uses: arduino/setup-protoc@v1
7070
with:
71-
version: '3.6.1'
71+
version: '3.6.1'
72+
repo-token: ${{ secrets.GITHUB_TOKEN }}
7273

7374
- name: Restore cache
7475
uses: ./.github/actions/restore-cache
@@ -115,7 +116,8 @@ jobs:
115116
- name: Install Protoc
116117
uses: arduino/setup-protoc@v1
117118
with:
118-
version: '3.6.1'
119+
version: '3.6.1'
120+
repo-token: ${{ secrets.GITHUB_TOKEN }}
119121

120122
- name: Install WASM target
121123
run: rustup target add wasm32-unknown-unknown
@@ -153,7 +155,8 @@ jobs:
153155
- name: Install Protoc
154156
uses: arduino/setup-protoc@v1
155157
with:
156-
version: '3.6.1'
158+
version: '3.6.1'
159+
repo-token: ${{ secrets.GITHUB_TOKEN }}
157160

158161
- name: Restore cache
159162
uses: ./.github/actions/restore-cache
@@ -839,7 +842,8 @@ jobs:
839842
- name: Install Protoc
840843
uses: arduino/setup-protoc@v1
841844
with:
842-
version: '3.6.1'
845+
version: '3.6.1'
846+
repo-token: ${{ secrets.GITHUB_TOKEN }}
843847

844848
- name: Install WASM target
845849
run: rustup target add wasm32-unknown-unknown

.github/workflows/nightly-pipeline.yaml

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,37 @@ jobs:
4343
if-no-files-found: error
4444
retention-days: 7
4545

46+
build-synthetic-network-docker:
47+
needs: [build-test-docker]
48+
name: Build docker image with the test node artifact and support for synthetic-network
49+
runs-on: ubuntu-20.04
50+
steps:
51+
- name: Checkout source code
52+
uses: actions/checkout@v2
53+
54+
- name: Download artifact with docker image for aleph-node
55+
uses: actions/download-artifact@v2
56+
with:
57+
name: aleph-test-docker
58+
59+
- name: Load node docker image
60+
shell: bash
61+
run: docker load -i aleph-node.tar
62+
63+
- name: Build test docker image
64+
id: build-image
65+
run: |
66+
scripts/synthetic-network/build_synthetic-network.sh
67+
docker save -o aleph-node.tar aleph-node:syntheticnet
68+
69+
- name: Upload test docker image
70+
uses: actions/upload-artifact@v2
71+
with:
72+
name: aleph-test-synthetic-docker
73+
path: aleph-node.tar
74+
if-no-files-found: error
75+
retention-days: 7
76+
4677
check-determinism:
4778
needs: [build-new-node]
4879
name: Verify runtime build determinism
@@ -59,7 +90,8 @@ jobs:
5990
- name: Install Protoc
6091
uses: arduino/setup-protoc@v1
6192
with:
62-
version: '3.6.1'
93+
version: '3.6.1'
94+
repo-token: ${{ secrets.GITHUB_TOKEN }}
6395

6496
- name: Install WASM target
6597
run: rustup target add wasm32-unknown-unknown
@@ -96,7 +128,8 @@ jobs:
96128
- name: Install Protoc
97129
uses: arduino/setup-protoc@v1
98130
with:
99-
version: '3.6.1'
131+
version: '3.6.1'
132+
repo-token: ${{ secrets.GITHUB_TOKEN }}
100133

101134
- name: Restore cache
102135
uses: ./.github/actions/restore-cache
@@ -140,9 +173,45 @@ jobs:
140173
randomized: true
141174
timeout-minutes: 60
142175

176+
run-e2e-high-out-latency:
177+
needs: [build-synthetic-network-docker, build-test-client]
178+
name: Run high out-latency test
179+
runs-on: ubuntu-20.04
180+
steps:
181+
- name: Checkout source code
182+
uses: actions/checkout@v2
183+
184+
- name: Run e2e test
185+
uses: ./.github/actions/run-e2e-test
186+
with:
187+
test-case: high_out_latency_for_all
188+
image-path: aleph-test-synthetic-docker
189+
node-image: aleph-node:syntheticnet
190+
compose-file: docker/docker-compose.synthetic-network.yml
191+
timeout-minutes: 30
192+
193+
run-e2e-no-quorum-without-high-out-latency:
194+
needs: [build-synthetic-network-docker, build-test-client]
195+
name: Run high out-latency for every quorum
196+
runs-on: ubuntu-20.04
197+
steps:
198+
- name: Checkout source code
199+
uses: actions/checkout@v2
200+
201+
- name: Run e2e test
202+
uses: ./.github/actions/run-e2e-test
203+
with:
204+
test-case: high_out_latency_for_each_quorum
205+
image-path: aleph-test-synthetic-docker
206+
node-image: aleph-node:syntheticnet
207+
compose-file: docker/docker-compose.synthetic-network.yml
208+
timeout-minutes: 15
209+
143210
check-e2e-test-suite-completion:
144211
needs: [
145212
run-e2e-authorities-are-staking,
213+
run-e2e-high-out-latency,
214+
run-e2e-no-quorum-without-high-out-latency,
146215
]
147216
name: Check e2e test suite completion
148217
runs-on: ubuntu-20.04

.github/workflows/unit_tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ jobs:
3030
- name: Install Protoc
3131
uses: arduino/setup-protoc@v1
3232
with:
33-
version: '3.6.1'
33+
version: '3.6.1'
34+
repo-token: ${{ secrets.GITHUB_TOKEN }}
3435

3536
- name: Install clippy and fmt
3637
run: rustup component add clippy rustfmt

0 commit comments

Comments
 (0)