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

Fix try runtime and metadata diff ci workflows #558

Merged
Merged
Show file tree
Hide file tree
Changes from 4 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
7 changes: 4 additions & 3 deletions .github/workflows/metadata_diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,18 @@ jobs:
SCCACHE_DIR: /home/runner/.cache/sccache
run: |
source ${HOME}/.cargo/env
cargo build
cargo build --release
chmod +x target/release/manta
-
name: stop sccache server
run: sccache --stop-server || true
- name: Start local node
run: |
echo Running on $CHAIN
target/debug/manta --chain=$CHAIN &
target/release/manta --chain=$CHAIN -- --chain kusama &
- name: Prepare output
run: |
VERSION=$(./manta --version)
VERSION=$(./target/release/manta --version)
echo "Metadata comparison:" >> output.txt
echo "Date: $(date)" >> output.txt
echo "Reference: $REF_URL" >> output.txt
Expand Down
144 changes: 16 additions & 128 deletions .github/workflows/try-runtime-calamari-mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,67 +5,28 @@
# The try-runtime tool expects your local chain's runtime version to match
# the version of the chain that you're testing against. In this case Calamari mainnet.
# That's why this CI workflow has a manual trigger.
name: Execute try-runtime with latest Calamari mainnet state
name: Try-runtime check against latest Calamari mainnet state

# yamllint disable-line rule:truthy
on:
workflow_dispatch:
inputs:
prod_url:
description: The WebSocket url of the reference node
default: wss://ws.calamari.systems:443
required: true

env:
AWS_INSTANCE_SSH_PUBLIC_KEY: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPb24HEQ++aNFWaqVyMtIs6GotUB8R+q61XOoI2z6uMj
AWS_REGION: us-east-1
AWS_SUBNET_ID: subnet-08c26caf0a52b7c19
AWS_SECURITY_GROUP_ID: sg-0315bffea9042ac9b
AWS_INSTANCE_TYPE: r5dn.2xlarge
AWS_INSTANCE_ROOT_VOLUME_SIZE: 32
AWS_IMAGE_SEARCH_PATTERN: ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*
ghzlatarev marked this conversation as resolved.
Show resolved Hide resolved
AWS_IMAGE_SEARCH_OWNERS: '["099720109477"]' # canonical
PROD_URL: ${{github.event.inputs.prod_url}}

jobs:

build-node:
needs:
- start-node-builder
runs-on: ${{ needs.start-node-builder.outputs.runner-label }}
run-try-runtime:
name: try-runtime
runs-on: ubuntu-20.04
steps:
-
uses: actions/checkout@v2
-
name: install sccache

env:
SCCACHE_RELEASE_URL: https://github.com/mozilla/sccache/releases/download
SCCACHE_VERSION: v0.2.15
run: |
SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl
mkdir -p $HOME/.local/bin
curl -L "$SCCACHE_RELEASE_URL/$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz
mv -f $SCCACHE_FILE/sccache $HOME/.local/bin/sccache
chmod +x $HOME/.local/bin/sccache
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
-
name: cache cargo registry
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
key: cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-
-
name: cache sccache
uses: actions/cache@v2
continue-on-error: false
with:
path: /home/runner/.cache/sccache
key: sccache-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
sccache-
-
name: start sccache server
run: sccache --start-server
-
name: init
run: |
Expand All @@ -78,44 +39,14 @@ jobs:
rustup update
-
name: build
env:
RUST_BACKTRACE: full
RUSTC_WRAPPER: sccache
SCCACHE_CACHE_SIZE: 2G
SCCACHE_DIR: /home/runner/.cache/sccache
CARGO_TERM_COLOR: always
run: |
source ${HOME}/.cargo/env
cargo build --profile release --verbose --features=try-runtime
-
name: stop sccache server
run: sccache --stop-server || true
-
name: upload
uses: actions/upload-artifact@v2
with:
name: manta
path: target/release/manta

run-try-runtime:
name: try-runtime
needs:
- start-node-builder
- build-node
runs-on: ${{ needs.start-node-builder.outputs.runner-label }}
strategy:
matrix:
runtime:
-
name: calamari
steps:
-
uses: actions/download-artifact@v2
with:
name: manta
cargo build --features=try-runtime
-
name: move bin
run: |
mv manta $HOME/.local/bin/
mkdir -p $HOME/.local/bin
mv target/debug/manta $HOME/.local/bin/
chmod +x $HOME/.local/bin/manta
echo "$HOME/.local/bin" >> $GITHUB_PATH
-
Expand All @@ -129,50 +60,7 @@ jobs:
cd ${{ github.workspace }}/dev-tools-calamari/check-finalized-block
yarn install
yarn
yarn build
latest_hash=$(node get-latest-finalized-header-hash --address=wss://ws.calamari.systems:443)
$HOME/.local/bin/manta try-runtime --chain calamari-dev on-runtime-upgrade live --at $latest_hash --uri wss://ws.calamari.systems:443

start-node-builder:
runs-on: ubuntu-20.04
outputs:
runner-label: ${{ steps.start-self-hosted-runner.outputs.runner-label }}
aws-region: ${{ steps.start-self-hosted-runner.outputs.aws-region }}
aws-instance-id: ${{ steps.start-self-hosted-runner.outputs.aws-instance-id }}
steps:
-
id: start-self-hosted-runner
uses: audacious-network/aws-github-runner@v1.0.33
with:
mode: start
github-token: ${{ secrets.GH_SHR_TOKEN }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-instance-ssh-public-key: ${{ env.AWS_INSTANCE_SSH_PUBLIC_KEY }}
aws-region: ${{ env.AWS_REGION }}
aws-subnet-id: ${{ env.AWS_SUBNET_ID }}
aws-security-group-id: ${{ env.AWS_SECURITY_GROUP_ID }}
aws-instance-type: ${{ env.AWS_INSTANCE_TYPE }}
aws-instance-root-volume-size: 32
aws-image-search-pattern: ${{ env.AWS_IMAGE_SEARCH_PATTERN }}
aws-image-search-owners: ${{ env.AWS_IMAGE_SEARCH_OWNERS }} # canonical

stop-node-builder-current:
needs:
- start-node-builder
- build-node
runs-on: ubuntu-20.04
if: ${{ always() }}
steps:
-
uses: audacious-network/aws-github-runner@v1.0.33
with:
mode: stop
github-token: ${{ secrets.GH_SHR_TOKEN }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ needs.start-node-builder.outputs.aws-region }}
runner-label: ${{ needs.start-node-builder.outputs.runner-label }}
aws-instance-id: ${{ needs.start-node-builder.outputs.aws-instance-id }}
latest_hash=$(node get-latest-block-hash --address=$PROD_URL)
$HOME/.local/bin/manta try-runtime --chain calamari-dev on-runtime-upgrade live --at $latest_hash --uri $PROD_URL

# yamllint enable rule:line-length