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

Refactor: enhance inputs for nightly workflows #2200

Merged
merged 3 commits into from
Jan 6, 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
59 changes: 26 additions & 33 deletions .github/workflows/aggregator-stress-test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Aggregator stress test

on:
workflow_call:
workflow_dispatch:
inputs:
commit_sha:
Expand All @@ -23,35 +22,24 @@ on:
required: true
type: boolean
default: false
workflow_call:
inputs:
num_signers:
required: true
type: string
default: "100"
num_clients:
required: true
type: string
default: "100"
enable_debug:
required: true
type: boolean
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 @@ -60,7 +48,12 @@ jobs:
id: prepare
shell: bash
run: |
if [[ "${{ needs.prepare.outputs.enable_debug }}" == "true" ]]; then
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

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

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

Expand All @@ -101,5 +94,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=${{ needs.prepare.outputs.num_signers }} \
--num-clients=${{ needs.prepare.outputs.num_clients }}
--num-signers=${{ inputs.num_signers }} \
--num-clients=${{ inputs.num_clients }}
38 changes: 20 additions & 18 deletions .github/workflows/backward-compatibility.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Backward compatibility

on:
workflow_call:
workflow_dispatch:
inputs:
total-releases:
Expand All @@ -19,32 +18,35 @@ on:
required: true
type: string
default: "CardanoTransactions,CardanoStakeDistribution"
workflow_call:
inputs:
total-releases:
required: true
type: number
default: 3
cardano-node-version:
required: true
type: string
default: "10.1.3"
signed-entity-types:
required: true
type: string
default: "CardanoTransactions,CardanoStakeDistribution"

jobs:
prepare-env-variables:
runs-on: ubuntu-22.04
outputs:
total_releases: ${{ steps.set-env.outputs.total_releases }}
cardano_node_version: ${{ steps.set-env.outputs.cardano_node_version }}
signed-entity-types: ${{ steps.set-env.outputs.signed-entity-types }}
steps:
- name: Prepare env variables
id: set-env
shell: bash
run: |
if [[ "${{ github.event_name }}" == "schedule" ]]; then
echo "total_releases=3" >> $GITHUB_OUTPUT
echo 'cardano_node_version=["10.1.3"]' >> $GITHUB_OUTPUT
echo 'signed-entity-types=CardanoTransactions,CardanoStakeDistribution' >> $GITHUB_OUTPUT
else
echo "total_releases=${{ inputs.total-releases }}" >> $GITHUB_OUTPUT
echo "cardano_node_version=[\"${{ inputs.cardano-node-version }}\"]" >> $GITHUB_OUTPUT
echo 'signed-entity-types=${{ inputs.signed-entity-types }}' >> $GITHUB_OUTPUT
fi
echo "cardano_node_version=[\"${{ inputs.cardano-node-version }}\"]" >> $GITHUB_OUTPUT

prepare-binaries:
runs-on: ubuntu-22.04
needs: [prepare-env-variables]
outputs:
tags: ${{ steps.tags-test-lab.outputs.tags }}
steps:
Expand All @@ -56,7 +58,7 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
./.github/workflows/scripts/download-distribution-binaries.sh ${{ needs.prepare-env-variables.outputs.total_releases }}
./.github/workflows/scripts/download-distribution-binaries.sh ${{ inputs.total-releases }}

- name: Install stable toolchain
uses: dtolnay/rust-toolchain@master
Expand Down Expand Up @@ -134,7 +136,7 @@ jobs:
--cardano-node-version ${{ matrix.cardano_node_version }} \
--cardano-slot-length 0.25 \
--cardano-epoch-length 45.0 \
--signed-entity-types ${{ needs.prepare-env-variables.outputs.signed-entity-types }}
--signed-entity-types ${{ inputs.signed-entity-types }}
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
echo "SUCCESS=true" >> $GITHUB_ENV
Expand Down Expand Up @@ -200,7 +202,7 @@ jobs:

summarize-test-results:
runs-on: ubuntu-22.04
needs: [prepare-env-variables, e2e]
needs: [e2e]
if: success() || failure()

steps:
Expand Down Expand Up @@ -228,8 +230,8 @@ jobs:
echo "This is the compatibility report of previous distributions nodes with the current unstable nodes." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

echo "**Signed entity types**: ${{ needs.prepare-env-variables.outputs.signed-entity-types }}" >> $GITHUB_STEP_SUMMARY
echo "**Cardano nodes**: ${{ needs.prepare-env-variables.outputs.cardano_node_version }}" >> $GITHUB_STEP_SUMMARY
echo "**Signed entity types**: ${{ inputs.signed-entity-types }}" >> $GITHUB_STEP_SUMMARY
echo "**Cardano nodes**: ${{ inputs.cardano_node_version }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

echo "| Compatibility | mithril-signer | mithril-aggregator | mithril-client |" >> $GITHUB_STEP_SUMMARY
Expand Down
119 changes: 57 additions & 62 deletions .github/workflows/test-client.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Mithril Client multi-platform test

on:
workflow_call:
workflow_dispatch:
inputs:
commit_sha:
Expand Down Expand Up @@ -41,70 +40,65 @@ on:
required: true
type: boolean
default: false
workflow_call:
inputs:
commit_sha:
required: false
type: string
docker_image_id:
required: true
type: string
default: latest
network:
required: true
type: string
default: preview
aggregator_endpoint:
required: true
type: string
default: https://aggregator.testing-preview.api.mithril.network/aggregator
genesis_verification_key:
required: true
type: string
default: https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/testing-preview/genesis.vkey
transactions_hashes_to_certify:
required: true
type: string
default: 1f7dbc899a898ceb4274bbc33b31ca5f0de497753c6c6795fa34838fc252de9b,c43e809de628f7c1ba41a44f188ed3872bb1f97aa101271e35424a8e1d95bea9,c61e22ac4a79a02b28ed36217369ff6959465790a4fe9e66738b7a820e174fcd
enable_debug:
required: true
type: boolean
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 variables
- name: Prepare environment variables
id: prepare
shell: bash
run: |
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
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

- name: Assessing aggregator capabilities (Unix)
id: aggregator_capability_unix
Expand Down Expand Up @@ -219,18 +213,20 @@ jobs:
matrix:
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
needs: [prepare]
steps:
- name: Prepare variables
- name: Prepare environment variables
id: prepare
shell: bash
run: |
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
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

- name: Assessing aggregator capabilities
id: aggregator_capability
Expand Down Expand Up @@ -313,7 +309,6 @@ jobs:
matrix:
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
needs: [prepare]
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand All @@ -339,9 +334,9 @@ jobs:
- name: Create .env file
working-directory: mithril-client-wasm
run: |
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
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

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