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

Feat: add workflows to Nightly Dispatcher #2188

Merged
merged 5 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
38 changes: 33 additions & 5 deletions .github/workflows/aggregator-stress-test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Aggregator stress test

on:
workflow_call:
workflow_dispatch:
inputs:
commit_sha:
Expand All @@ -24,8 +25,33 @@ on:
default: false

jobs:
prepare:
runs-on: ubuntu-22.04
outputs:
branch: ${{ steps.set-env.outputs.branch }}
commit_sha: ${{ steps.set-env.outputs.commit_sha }}
num_signers: ${{ steps.set-env.outputs.num_signers }}
num_clients: ${{ steps.set-env.outputs.num_clients }}
enable_debug: ${{ steps.set-env.outputs.enable_debug }}
steps:
- name: Prepare env variables
id: set-env
shell: bash
run: |
if [[ "${{ github.event_name }}" == "schedule" ]]; then
echo "branch=main" >> $GITHUB_OUTPUT
echo "num_signers=100" >> $GITHUB_OUTPUT
echo "num_clients=100" >> $GITHUB_OUTPUT
echo "enable_debug=false" >> $GITHUB_OUTPUT
else
echo "commit_sha=${{ inputs.commit_sha }}" >> $GITHUB_OUTPUT
echo "num_signers=${{ inputs.num_signers }}" >> $GITHUB_OUTPUT
echo "num_clients=${{ inputs.num_clients }}" >> $GITHUB_OUTPUT
echo "enable_debug=${{ inputs.enable_debug }}"s >> $GITHUB_OUTPUT
fi
stress-test:
runs-on: ubuntu-22.04
needs: [prepare]
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand All @@ -34,7 +60,7 @@ jobs:
id: prepare
shell: bash
run: |
if [[ "${{ inputs.enable_debug }}" == "true" ]]; then
if [[ "${{ needs.prepare.outputs.enable_debug }}" == "true" ]]; then
echo "debug_level=-vvv" >> $GITHUB_OUTPUT
fi

Expand All @@ -48,7 +74,8 @@ jobs:
with:
name: mithril-distribution-Linux-X64
path: ./bin
commit: ${{ inputs.commit_sha }}
commit: ${{ needs.prepare.outputs.commit_sha }}
branch: ${{ needs.prepare.outputs.branch }}
workflow: ci.yml
workflow_conclusion: success

Expand All @@ -57,7 +84,8 @@ jobs:
with:
name: mithril-tooling-Linux-X64
path: ./bin
commit: ${{ inputs.commit_sha }}
commit: ${{ needs.prepare.outputs.commit_sha }}
branch: ${{ needs.prepare.outputs.branch }}
workflow: ci.yml
workflow_conclusion: success

Expand All @@ -73,5 +101,5 @@ jobs:
./bin/load-aggregator ${{ steps.prepare.outputs.debug_level }} \
--cardano-cli-path ./mithril-test-lab/mithril-end-to-end/script/mock-cardano-cli \
--aggregator-dir ./bin \
--num-signers=${{ inputs.num_signers }} \
--num-clients=${{ inputs.num_clients }}
--num-signers=${{ needs.prepare.outputs.num_signers }} \
--num-clients=${{ needs.prepare.outputs.num_clients }}
12 changes: 9 additions & 3 deletions .github/workflows/nightly-dispatcher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,21 @@ on:
- cron: "0 2 * * *"

jobs:
backward-compatibility:
uses: ./.github/workflows/backward-compatibility.yml

docker-builds:
uses: ./.github/workflows/docker-builds.yml

backward-compatibility:
uses: ./.github/workflows/backward-compatibility.yml
aggregator-stress-test:
uses: ./.github/workflows/aggregator-stress-test.yml

test-client:
uses: ./.github/workflows/test-client.yml

notify-on-failure:
runs-on: ubuntu-22.04
needs: [docker-builds]
needs: [docker-builds, aggregator-stress-test, test-client]
if: failure()
steps:
- name: Checkout repository
Expand Down
90 changes: 62 additions & 28 deletions .github/workflows/test-client.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Mithril Client multi-platform test

on:
workflow_call:
workflow_dispatch:
inputs:
commit_sha:
Expand Down Expand Up @@ -42,34 +43,68 @@ on:
default: false

jobs:
prepare:
runs-on: ubuntu-22.04
outputs:
network: ${{ steps.set-env.outputs.network }}
aggregator_endpoint: ${{ steps.set-env.outputs.aggregator_endpoint }}
genesis_verification_key: ${{ steps.set-env.outputs.genesis_verification_key }}
transactions_hashes_to_certify: ${{ steps.set-env.outputs.transactions_hashes_to_certify }}
docker_image_id: ${{ steps.set-env.outputs.docker_image_id }}
sha: ${{ steps.set-env.outputs.sha }}
branch: ${{ steps.set-env.outputs.branch }}
enable_debug: ${{ steps.set-env.outputs.enable_debug }}
steps:
- name: Prepare variables
id: set-env
shell: bash
run: |
if [[ "${{ github.event_name }}" == "schedule" ]]; then
echo "network=preview" >> $GITHUB_OUTPUT
echo "aggregator_endpoint=https://aggregator.testing-preview.api.mithril.network/aggregator" >> $GITHUB_OUTPUT
echo "genesis_verification_key=$(curl -s https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/testing-preview/genesis.vkey)" >> $GITHUB_OUTPUT
echo "transactions_hashes_to_certify=1f7dbc899a898ceb4274bbc33b31ca5f0de497753c6c6795fa34838fc252de9b,c43e809de628f7c1ba41a44f188ed3872bb1f97aa101271e35424a8e1d95bea9,c61e22ac4a79a02b28ed36217369ff6959465790a4fe9e66738b7a820e174fcd" >> $GITHUB_OUTPUT
echo "docker_image_id=latest" >> $GITHUB_OUTPUT
echo "debug_level=-vvv" >> $GITHUB_OUTPUT
echo "branch=main" >> $GITHUB_OUTPUT
else
echo "network=${{ inputs.network }}" >> $GITHUB_OUTPUT
echo "aggregator_endpoint=${{ inputs.aggregator_endpoint }}" >> $GITHUB_OUTPUT
echo "genesis_verification_key=$(curl -s ${{ inputs.genesis_verification_key }})" >> $GITHUB_OUTPUT
echo "transactions_hashes_to_certify=${{ inputs.transactions_hashes_to_certify }}" >> $GITHUB_OUTPUT
echo "docker_image_id=${{ inputs.docker_image_id }}" >> $GITHUB_OUTPUT
if [[ "${{ inputs.enable_debug }}" == "true" ]]; then
echo "debug_level=-vvv" >> $GITHUB_OUTPUT
fi
if [[ -n "${{ inputs.commit_sha }}" ]]; then
echo "sha=${{ inputs.commit_sha }}" >> $GITHUB_OUTPUT
else
echo "branch=main" >> $GITHUB_OUTPUT
fi
fi

test-binaries:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-14, macos-14-large, windows-latest]
runs-on: ${{ matrix.os }}
needs: [prepare]
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Prepare environment variables
- name: Prepare variables
id: prepare
shell: bash
run: |
if [[ -n "${{ inputs.commit_sha }}" ]]; then
echo "sha=${{ inputs.commit_sha }}" >> $GITHUB_OUTPUT
else
echo "branch=main" >> $GITHUB_OUTPUT
fi

if [[ "${{ inputs.enable_debug }}" == "true" ]]; then
echo "debug_level=-vvv" >> $GITHUB_OUTPUT
fi

echo "NETWORK=${{ inputs.network }}" >> $GITHUB_ENV
echo "AGGREGATOR_ENDPOINT=${{ inputs.aggregator_endpoint }}" >> $GITHUB_ENV
echo "GENESIS_VERIFICATION_KEY=$(curl -s ${{ inputs.genesis_verification_key }})" >> $GITHUB_ENV
echo "TRANSACTIONS_HASHES_TO_CERTIFY=${{ inputs.transactions_hashes_to_certify }}" >> $GITHUB_ENV
echo "sha=${{ needs.prepare.outputs.commit_sha }}" >> $GITHUB_OUTPUT
echo "branch=${{ needs.prepare.outputs.branch }}" >> $GITHUB_OUTPUT
echo "debug_level=${{ needs.prepare.outputs.enable_debug }}" >> $GITHUB_OUTPUT
echo "NETWORK=${{ needs.prepare.outputs.network }}" >> $GITHUB_ENV
echo "AGGREGATOR_ENDPOINT=${{ needs.prepare.outputs.aggregator_endpoint }}" >> $GITHUB_ENV
echo "GENESIS_VERIFICATION_KEY=${{ needs.prepare.outputs.genesis_verification_key }}" >> $GITHUB_ENV
echo "TRANSACTIONS_HASHES_TO_CERTIFY=${{ needs.prepare.outputs.transactions_hashes_to_certify }}" >> $GITHUB_ENV

- name: Assessing aggregator capabilities (Unix)
id: aggregator_capability_unix
Expand Down Expand Up @@ -184,20 +219,18 @@ jobs:
matrix:
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
needs: [prepare]
steps:
- name: Prepare environment variables
- name: Prepare variables
id: prepare
shell: bash
run: |
if [[ "${{ inputs.enable_debug }}" == "true" ]]; then
echo "debug_level=-vvv" >> $GITHUB_OUTPUT
fi

echo "MITHRIL_IMAGE_ID=${{ inputs.docker_image_id }}" >> $GITHUB_ENV
echo "NETWORK=${{ inputs.network }}" >> $GITHUB_ENV
echo "AGGREGATOR_ENDPOINT=${{ inputs.aggregator_endpoint }}" >> $GITHUB_ENV
echo "GENESIS_VERIFICATION_KEY=$(curl -s ${{ inputs.genesis_verification_key }})" >> $GITHUB_ENV
echo "TRANSACTIONS_HASHES_TO_CERTIFY=${{ inputs.transactions_hashes_to_certify }}" >> $GITHUB_ENV
echo "debug_level=${{ needs.prepare.outputs.enable_debug }}" >> $GITHUB_OUTPUT
echo "MITHRIL_IMAGE_ID=${{ needs.prepare.outputs.docker_image_id }}" >> $GITHUB_ENV
echo "NETWORK=${{ needs.prepare.outputs.network }}" >> $GITHUB_ENV
echo "AGGREGATOR_ENDPOINT=${{ needs.prepare.outputs.aggregator_endpoint }}" >> $GITHUB_ENV
echo "GENESIS_VERIFICATION_KEY=${{ needs.prepare.outputs.genesis_verification_key }}" >> $GITHUB_ENV
echo "TRANSACTIONS_HASHES_TO_CERTIFY=${{ needs.prepare.outputs.transactions_hashes_to_certify }}" >> $GITHUB_ENV

- name: Assessing aggregator capabilities
id: aggregator_capability
Expand Down Expand Up @@ -280,6 +313,7 @@ jobs:
matrix:
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
needs: [prepare]
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand All @@ -305,9 +339,9 @@ jobs:
- name: Create .env file
working-directory: mithril-client-wasm
run: |
echo "AGGREGATOR_ENDPOINT=${{ inputs.aggregator_endpoint }}" > ./ci-test/.env
echo "GENESIS_VERIFICATION_KEY=$(curl -s ${{ inputs.genesis_verification_key }})" >> ./ci-test/.env
echo "TRANSACTIONS_HASHES_TO_CERTIFY=${{ inputs.transactions_hashes_to_certify }}" >> ./ci-test/.env
echo "AGGREGATOR_ENDPOINT=${{ needs.prepare.outputs.aggregator_endpoint }}" > ./ci-test/.env
echo "GENESIS_VERIFICATION_KEY=${{ needs.prepare.outputs.genesis_verification_key }}" >> ./ci-test/.env
echo "TRANSACTIONS_HASHES_TO_CERTIFY=${{ needs.prepare.outputs.transactions_hashes_to_certify }}" >> ./ci-test/.env

- name: Start the server
working-directory: mithril-client-wasm
Expand Down