Skip to content

Commit

Permalink
Switch to the new version of jacogr/polkadot-js-tools (#1594)
Browse files Browse the repository at this point in the history
# Goal
The goal of this PR is to upgrade the polkadotjs tools for metadata
comparison.

Closes #1230 

This also includes PR #1601 for expediency. So also part of #1362

Ended up needing to run each one in a docker container with a new docker
network. This allowed everything to talk correctly.

# Checklist
- [x] Tested with: make start + docker run --rm --platform=linux/amd64
--pull always jacogr/polkadot-js-tools:0.55.3 metadata
wss://1.rpc.frequency.xyz ws://host.docker.internal:9944
- [x] Tested with test release Running:
https://github.com/LibertyDSNP/frequency/actions/runs/5282806513

---------

Co-authored-by: Dmitri <4452412+demisx@users.noreply.github.com>
  • Loading branch information
wilwade and demisx committed Jun 15, 2023
1 parent 6d9e542 commit 517cb2b
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 35 deletions.
88 changes: 54 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
- name: Check Out Repo
uses: actions/checkout@v3
with:
token: ${{secrets.GHA_GIT_COMMIT || github.token}}
fetch-depth: 0
- name: Create Release Branch?
id: create-release-branch
Expand Down Expand Up @@ -120,6 +121,7 @@ jobs:
uses: actions/checkout@v3
with:
ref: ${{env.RELEASE_BRANCH_NAME}}
fetch-depth: 0
- name: Version Code
shell: bash
run: |
Expand Down Expand Up @@ -153,7 +155,8 @@ jobs:
matrix:
# This job intermittently fails on EKS runners and must be run on standalone until
# https://www.pivotaltracker.com/story/show/185045683 is resolved.
os: [[self-hosted, Linux, X64, build]]
# os: [[self-hosted, Linux, X64, testing, v2], [self-hosted, Linux, ARM64, testing, v2]]
os: [[self-hosted, Linux, X64, testing, v2]]
network: [dev, local, rococo, mainnet]
include:
- network: dev
Expand All @@ -172,7 +175,7 @@ jobs:
spec: frequency
build-profile: release
release-file-name-prefix: frequency
- os: [self-hosted, Linux, X64, build]
- os: [self-hosted, Linux, X64, testing, v2]
arch: amd64
# - os: [self-hosted, Linux, ARM64]
# arch: arm64
Expand Down Expand Up @@ -239,6 +242,8 @@ jobs:
runtime_filename_dev: ${{steps.set-env-vars.outputs.runtime_filename_dev}}
runtime_filename_rococo: ${{steps.set-env-vars.outputs.runtime_filename_rococo}}
runtime_filename_mainnet: ${{steps.set-env-vars.outputs.runtime_filename_mainnet}}
# env:
# HOME: /root
strategy:
fail-fast: true
matrix:
Expand Down Expand Up @@ -334,7 +339,7 @@ jobs:
build-rust-developer-docs:
needs: version-code
name: Build Rust Developer Docs
runs-on: [self-hosted, Linux, X64, build]
runs-on: [self-hosted, Linux, X64, testing, v2]
container: ghcr.io/libertydsnp/frequency/ci-base-image
steps:
- name: Check Out Repo
Expand All @@ -343,9 +348,13 @@ jobs:
ref: ${{env.RELEASE_BRANCH_NAME}}
- name: Setup Pages
uses: actions/configure-pages@v3
# cargo doc requires a toolchain version ^nightly-2022-11-15 because of a bug that causes a panic
# When the toolchain is updated to ^nightly-2023-06-01, this can be removed
- name: Build Docs
run: |
RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo doc --no-deps --features frequency
rustup install nightly-2023-06-01
rustup target add wasm32-unknown-unknown --toolchain nightly-2023-06-01
RUSTDOCFLAGS="--enable-index-page --check -Zunstable-options" cargo +nightly-2023-06-01 doc --no-deps --features frequency
- name: Upload Docs
uses: actions/upload-pages-artifact@v1
with:
Expand Down Expand Up @@ -517,40 +526,48 @@ jobs:
run: |
chmod 755 $TEST_BIN_FILENAME
chmod 755 $REF_BIN_FILENAME
- name: Docker network
run: docker network create net-${{env.RELEASE_BRANCH_NAME}}
- name: Start Test Node
working-directory: ${{env.BIN_DIR}}
run: |
./${{env.TEST_BIN_FILENAME}} \
--chain=frequency-bench \
--rpc-external \
--rpc-cors=all \
--ws-external \
--rpc-methods=Unsafe \
--no-telemetry \
--no-prometheus \
--ws-port $((9944)) \
--reserved-only \
--tmp \
-- \
--reserved-only \
&
docker run -d --rm --net=net-${{env.RELEASE_BRANCH_NAME}} \
-v `pwd`:/app \
--name test-node \
ubuntu:22.04 \
/bin/sh -c "chmod +x /app/${{env.TEST_BIN_FILENAME}} && /app/${{env.TEST_BIN_FILENAME}} \
--chain=frequency-bench \
--rpc-external \
--rpc-cors=all \
--ws-external \
--rpc-methods=Unsafe \
--no-telemetry \
--no-prometheus \
--reserved-only \
--no-hardware-benchmarks \
--tmp \
-- \
--reserved-only"
- name: Start Reference Node
working-directory: ${{env.BIN_DIR}}
run: |
./${{env.REF_BIN_FILENAME}} \
--chain=frequency-bench \
--rpc-external \
--rpc-cors=all \
--ws-external \
--rpc-methods=Unsafe \
--no-telemetry \
--no-prometheus \
--ws-port $((9946)) \
--reserved-only \
--tmp \
-- \
--reserved-only \
&
docker run -d --rm --net=net-${{env.RELEASE_BRANCH_NAME}} \
-v `pwd`:/app \
--name ref-node \
ubuntu:22.04 \
/bin/sh -c "chmod +x /app/${{env.REF_BIN_FILENAME}} && /app/${{env.REF_BIN_FILENAME}} \
--chain=frequency-bench \
--rpc-external \
--rpc-cors=all \
--ws-external \
--rpc-methods=Unsafe \
--no-telemetry \
--no-prometheus \
--reserved-only \
--no-hardware-benchmarks \
--tmp \
-- \
--reserved-only"
- name: Prepare Output
working-directory: ${{env.OUTPUT_DIR}}
run: |
Expand All @@ -562,8 +579,9 @@ jobs:
echo "Test version: $BIN_VERSION" >> ${{env.OUTPUT_FILENAME}}
echo "----------------------------------------------------------------------" >> ${{env.OUTPUT_FILENAME}}
- name: Compare Metadata
timeout-minutes: 10
run: |
CMD="docker run --pull always --network host frequencychain/polkadot-js-tools:v0.52.29 metadata ws://localhost:9946 ws://localhost:9944"
CMD="docker run --pull always --net=net-${{env.RELEASE_BRANCH_NAME}} jacogr/polkadot-js-tools:0.55.3 metadata ws://ref-node:9944 ws://test-node:9944"
echo -e "Running:\n$CMD"
$CMD >> ${{env.OUTPUT_DIR}}/${{env.OUTPUT_FILENAME}}
sed -z -i 's/\n\n/\n/g' ${{env.OUTPUT_DIR}}/${{env.OUTPUT_FILENAME}}
Expand All @@ -585,7 +603,9 @@ jobs:
if: always()
run: |
echo "Attempting to kill all frequency processes..."
pkill -9 ${{env.FREQUENCY_PROCESS_NAME}}
docker stop ref-node || true
docker stop test-node || true
docker network rm net-${{env.RELEASE_BRANCH_NAME}}
wait-for-all-builds:
needs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify-pr-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ jobs:
uses: actions/checkout@v3
# cargo doc requires a toolchain version ^nightly-2022-11-15 because of a bug that causes a panic
# When the toolchain is updated to ^nightly-2023-06-01, this can be removed
- name: Install Rust Nightly-2023-06-01 and Build Docs
- name: Build Docs
run: |
rustup install nightly-2023-06-01
rustup target add wasm32-unknown-unknown --toolchain nightly-2023-06-01
Expand Down

0 comments on commit 517cb2b

Please sign in to comment.