Skip to content

Commit

Permalink
Merge branch 'main' into benjamin
Browse files Browse the repository at this point in the history
  • Loading branch information
fbielejec authored Nov 7, 2022
2 parents 46a4020 + 33aca04 commit 53963f4
Show file tree
Hide file tree
Showing 85 changed files with 4,582 additions and 2,432 deletions.
13 changes: 9 additions & 4 deletions .github/actions/run-e2e-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ inputs:
runs:
using: 'composite'
steps:

- name: Download artifact with docker image
uses: actions/download-artifact@v2
with:
Expand All @@ -43,6 +44,10 @@ runs:
shell: bash
run: ./.github/scripts/run_consensus.sh -m ${{ inputs.min-validator-count }} -n ${{ inputs.node-count }}

- name: Sleep
shell: bash
run: sleep 60

- name: Display bootnode logs
shell: bash
run: docker logs Node0 --follow &
Expand All @@ -64,21 +69,21 @@ runs:
-r "${{ inputs.randomized }}"
-m "${{ inputs.min-validator-count }}"
)
RESERVED_SEATS="${{ inputs.reserved-seats }}"
NON_RESERVED_SEATS="${{ inputs.non-reserved-seats }}"
if [[ -n "${RANDOMIZED}" ]]; then
ARGS+=(-r "${RANDOMIZED}")
fi
if [[ -n "${RESERVED_SEATS}" && -n "${NON_RESERVED_SEATS}" ]]; then
ARGS+=(
-f "${RESERVED_SEATS}"
-n "${NON_RESERVED_SEATS}"
)
fi
./.github/scripts/run_e2e_test.sh "${ARGS[@]}"
- name: Run finalization e2e test
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
Node0:
environment:
- ONLY_LEGACY_PROTOCOL=true

Node1:
environment:
- ONLY_LEGACY_PROTOCOL=true
10 changes: 8 additions & 2 deletions .github/scripts/run_consensus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set -euo pipefail
# change when increasing the number of node containers
NODE_COUNT=5
MIN_VALIDATOR_COUNT=4
OVERRIDE_DOCKER_COMPOSE=${OVERRIDE_DOCKER_COMPOSE:-""}

# default minimum validator count
MIN_VALIDATOR_COUNT=4
Expand Down Expand Up @@ -82,14 +83,19 @@ function generate_bootnode_peer_id {

function run_containers {
local authorities_count="$1"
local override_file="$2"

echo "Running ${authorities_count} containers..."
docker-compose -f docker/docker-compose.yml up -d
if [[ -z ${override_file} ]]; then
docker-compose -f docker/docker-compose.yml up -d
else
docker-compose -f docker/docker-compose.yml -f "${override_file}" up -d
fi
}

authorities=$(generate_authorities ${NODE_COUNT})
generate_chainspec "${authorities[@]}" "${MIN_VALIDATOR_COUNT}"
generate_bootnode_peer_id ${authorities[0]}
run_containers ${NODE_COUNT}
run_containers ${NODE_COUNT} "${OVERRIDE_DOCKER_COMPOSE}"

exit $?
12 changes: 12 additions & 0 deletions .github/scripts/run_e2e_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,18 @@ else
echo "Falling back on default test case param values."
fi

if [[ -n "${UPGRADE_VERSION:-}" && -n "${UPGRADE_SESSION:-}" && -n "${UPGRADE_FINALIZATION_WAIT_SESSIONS:-}" ]]; then
ARGS+=(
-e UPGRADE_VERSION
-e UPGRADE_SESSION
-e UPGRADE_FINALIZATION_WAIT_SESSIONS
)
fi

if [[ -n "${ONLY_LEGACY:-}" ]]; then
ARGS+=(-e ONLY_LEGACY)
fi

docker run -v $(pwd)/docker/data:/data "${ARGS[@]}" aleph-e2e-client:latest

exit $?
4 changes: 2 additions & 2 deletions .github/workflows/build-node-and-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
uses: ./.github/actions/restore-cache
with:
target-key: release
cache-version: v1
cache-version: v2

- name: Build binary and runtime
run: cargo build --profile production -p aleph-node
Expand All @@ -57,7 +57,7 @@ jobs:
retention-days: 7

- name: Build test binary
run: cargo build --release -p aleph-node --features "short_session enable_treasury_proposals"
run: cargo build --release -p aleph-node --features "short_session enable_treasury_proposals only_legacy"

- name: Upload test binary
uses: actions/upload-artifact@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-excluded-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
with:
target-key: excluded
cargo-key: excluded
cache-version: v1
cache-version: v2
cargo-targets: "${{ steps.format_output.outputs.targets }}"

- name: Check excluded packages
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
DOCKERHUB_TESTNET_IMAGE: cardinalcryptography/aleph-zero:testnet-${{ steps.vars.outputs.branch }}
DOCKERHUB_TESTNET_LATEST_IMAGE: cardinalcryptography/aleph-zero:testnet-latest
run: |
echo "FROM ${{ env.DOCKERHUB_TESTNET_IMAGE }}" > Dockerfile.dockerhub
echo "FROM ${{ env.TESTNET_IMAGE }}" > Dockerfile.dockerhub
echo 'ENTRYPOINT ["/usr/local/bin/aleph-node"]' >> Dockerfile.dockerhub
docker build -t ${{ env.DOCKERHUB_TESTNET_IMAGE }} -f Dockerfile.dockerhub .
docker tag ${{ env.DOCKERHUB_TESTNET_IMAGE }} ${{ env.DOCKERHUB_TESTNET_LATEST_IMAGE }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy-to-devnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ jobs:
kustomize edit remove resource send-runtime-hook.yaml
kustomize build . | kubectl apply -f -
sleep 2
kubectl rollout status --watch --timeout=2000s statefulset/aleph-node-validator -n devnet
kubectl rollout status --watch --timeout=3600s statefulset/aleph-node-validator -n devnet
echo "Waiting 10 minutes"
sleep 600
echo "Waiting 15 minutes"
sleep 900
kustomize edit set image "aleph-node-validator-image-placeholder=public.ecr.aws/p6e8q1z1/aleph-node:${RELEASE_TAG}"
kustomize build . | kubectl apply -f -
sleep 2
kubectl rollout status --watch --timeout=600s statefulset/aleph-node-validator -n devnet
kubectl rollout status --watch --timeout=3600s statefulset/aleph-node-validator -n devnet
kustomize edit add resource send-runtime-hook.yaml
kustomize build . | kubectl apply -f -
Expand Down
93 changes: 91 additions & 2 deletions .github/workflows/e2e-tests-main-devnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
with:
target-key: e2e
cargo-key: e2e
cache-version: v1
cache-version: v2
cargo-targets: e2e-tests/target/

- name: Build binary and docker image
Expand Down Expand Up @@ -402,6 +402,89 @@ jobs:
follow-up-finalization-check: true
timeout-minutes: 15

run-e2e-ban-automatic:
needs: [build-test-docker, build-test-client]
name: Run ban automatic test
runs-on: ubuntu-20.04
steps:
- name: Checkout source code
uses: actions/checkout@v2

- name: Run e2e test
uses: ./.github/actions/run-e2e-test
with:
test-case: ban_automatic
follow-up-finalization-check: true
timeout-minutes: 15

run-e2e-ban-counter-clearing:
needs: [build-test-docker, build-test-client]
name: Run ban counter clearing test
runs-on: ubuntu-20.04
steps:
- name: Checkout source code
uses: actions/checkout@v2

- name: Run e2e test
uses: ./.github/actions/run-e2e-test
with:
test-case: clearing_session_count
follow-up-finalization-check: true
timeout-minutes: 15

run-e2e-version-upgrade:
needs: [build-test-docker, build-test-client]
name: Run basic (positive) version-upgrade test
runs-on: ubuntu-20.04
steps:
- name: Checkout source code
uses: actions/checkout@v2

- name: Run e2e test
uses: ./.github/actions/run-e2e-test
with:
test-case: version_upgrade
env:
UPGRADE_VERSION: 1
UPGRADE_SESSION: 3
UPGRADE_FINALIZATION_WAIT_SESSIONS: 2
timeout-minutes: 10

run-e2e-failing-version-upgrade:
needs: [build-test-docker, build-test-client]
name: Run basic (failing) version-upgrade test
runs-on: ubuntu-20.04
steps:
- name: Checkout source code
uses: actions/checkout@v2

- name: Run e2e test
uses: ./.github/actions/run-e2e-test
with:
test-case: doomed_version_upgrade
env:
OVERRIDE_DOCKER_COMPOSE: ./.github/scripts/docker-compose.no_quorum_without_old.override.yml
UPGRADE_VERSION: 1
UPGRADE_SESSION: 3
UPGRADE_FINALIZATION_WAIT_SESSIONS: 2
ONLY_LEGACY: true
timeout-minutes: 10

run-e2e-ban-manual:
needs: [build-test-docker, build-test-client]
name: Run ban manual test
runs-on: ubuntu-20.04
steps:
- name: Checkout source code
uses: actions/checkout@v2

- name: Run e2e test
uses: ./.github/actions/run-e2e-test
with:
test-case: ban_manual
follow-up-finalization-check: true
timeout-minutes: 15

check-e2e-test-suite-completion:
needs: [
run-e2e-finalization-test,
Expand All @@ -422,6 +505,11 @@ jobs:
run-e2e-rewards-change-stake-force-new-era,
run-e2e-rewards-points-basic,
run-e2e-authorities-are-staking,
run-e2e-ban-automatic,
run-e2e-ban-counter-clearing,
run-e2e-ban-manual,
run-e2e-version-upgrade,
run-e2e-failing-version-upgrade,
]
name: Check e2e test suite completion
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -505,7 +593,7 @@ jobs:
python-version: '3.8'

- name: Test catch up
timeout-minutes: 6
timeout-minutes: 10
env:
# Relative to local-tests/ directory
ALEPH_NODE_BINARY: aleph-test-node/aleph-node
Expand Down Expand Up @@ -576,6 +664,7 @@ jobs:
uses: ./.github/actions/restore-cache
with:
target-key: try-runtime
cache-version: v2

- name: Build try-runtime
run: cargo build --release -p aleph-node --features "try-runtime"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nightly-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ jobs:
with:
target-key: e2e
cargo-key: e2e
cache-version: v1
cache-version: v2
cargo-targets: e2e-tests/target/

- name: Build binary and docker image
run: |
cd e2e-tests/
cargo build
cargo build --release
docker build --tag aleph-e2e-client:latest -f Dockerfile .
docker save -o aleph-e2e-client.tar aleph-e2e-client:latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
uses: ./.github/actions/restore-cache
with:
target-key: debug
cache-version: v1
cache-version: v2

- name: Run Format Checks
uses: actions-rs/cargo@v1
Expand Down
Loading

0 comments on commit 53963f4

Please sign in to comment.