Skip to content

Commit bc80b96

Browse files
wilwadedemisx
authored andcommitted
Switch to the new version of jacogr/polkadot-js-tools (#1594)
# 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 <[email protected]>
1 parent 2378d40 commit bc80b96

File tree

2 files changed

+55
-35
lines changed

2 files changed

+55
-35
lines changed

.github/workflows/release.yml

+54-34
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
5252
- name: Check Out Repo
5353
uses: actions/checkout@v3
5454
with:
55+
token: ${{secrets.GHA_GIT_COMMIT || github.token}}
5556
fetch-depth: 0
5657
- name: Create Release Branch?
5758
id: create-release-branch
@@ -120,6 +121,7 @@ jobs:
120121
uses: actions/checkout@v3
121122
with:
122123
ref: ${{env.RELEASE_BRANCH_NAME}}
124+
fetch-depth: 0
123125
- name: Version Code
124126
shell: bash
125127
run: |
@@ -153,7 +155,8 @@ jobs:
153155
matrix:
154156
# This job intermittently fails on EKS runners and must be run on standalone until
155157
# https://www.pivotaltracker.com/story/show/185045683 is resolved.
156-
os: [[self-hosted, Linux, X64, build]]
158+
# os: [[self-hosted, Linux, X64, testing, v2], [self-hosted, Linux, ARM64, testing, v2]]
159+
os: [[self-hosted, Linux, X64, testing, v2]]
157160
network: [dev, local, rococo, mainnet]
158161
include:
159162
- network: dev
@@ -172,7 +175,7 @@ jobs:
172175
spec: frequency
173176
build-profile: release
174177
release-file-name-prefix: frequency
175-
- os: [self-hosted, Linux, X64, build]
178+
- os: [self-hosted, Linux, X64, testing, v2]
176179
arch: amd64
177180
# - os: [self-hosted, Linux, ARM64]
178181
# arch: arm64
@@ -239,6 +242,8 @@ jobs:
239242
runtime_filename_dev: ${{steps.set-env-vars.outputs.runtime_filename_dev}}
240243
runtime_filename_rococo: ${{steps.set-env-vars.outputs.runtime_filename_rococo}}
241244
runtime_filename_mainnet: ${{steps.set-env-vars.outputs.runtime_filename_mainnet}}
245+
# env:
246+
# HOME: /root
242247
strategy:
243248
fail-fast: true
244249
matrix:
@@ -334,7 +339,7 @@ jobs:
334339
build-rust-developer-docs:
335340
needs: version-code
336341
name: Build Rust Developer Docs
337-
runs-on: [self-hosted, Linux, X64, build]
342+
runs-on: [self-hosted, Linux, X64, testing, v2]
338343
container: ghcr.io/libertydsnp/frequency/ci-base-image
339344
steps:
340345
- name: Check Out Repo
@@ -343,9 +348,13 @@ jobs:
343348
ref: ${{env.RELEASE_BRANCH_NAME}}
344349
- name: Setup Pages
345350
uses: actions/configure-pages@v3
351+
# cargo doc requires a toolchain version ^nightly-2022-11-15 because of a bug that causes a panic
352+
# When the toolchain is updated to ^nightly-2023-06-01, this can be removed
346353
- name: Build Docs
347354
run: |
348-
RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo doc --no-deps --features frequency
355+
rustup install nightly-2023-06-01
356+
rustup target add wasm32-unknown-unknown --toolchain nightly-2023-06-01
357+
RUSTDOCFLAGS="--enable-index-page --check -Zunstable-options" cargo +nightly-2023-06-01 doc --no-deps --features frequency
349358
- name: Upload Docs
350359
uses: actions/upload-pages-artifact@v1
351360
with:
@@ -517,40 +526,48 @@ jobs:
517526
run: |
518527
chmod 755 $TEST_BIN_FILENAME
519528
chmod 755 $REF_BIN_FILENAME
529+
- name: Docker network
530+
run: docker network create net-${{env.RELEASE_BRANCH_NAME}}
520531
- name: Start Test Node
521532
working-directory: ${{env.BIN_DIR}}
522533
run: |
523-
./${{env.TEST_BIN_FILENAME}} \
524-
--chain=frequency-bench \
525-
--rpc-external \
526-
--rpc-cors=all \
527-
--ws-external \
528-
--rpc-methods=Unsafe \
529-
--no-telemetry \
530-
--no-prometheus \
531-
--ws-port $((9944)) \
532-
--reserved-only \
533-
--tmp \
534-
-- \
535-
--reserved-only \
536-
&
534+
docker run -d --rm --net=net-${{env.RELEASE_BRANCH_NAME}} \
535+
-v `pwd`:/app \
536+
--name test-node \
537+
ubuntu:22.04 \
538+
/bin/sh -c "chmod +x /app/${{env.TEST_BIN_FILENAME}} && /app/${{env.TEST_BIN_FILENAME}} \
539+
--chain=frequency-bench \
540+
--rpc-external \
541+
--rpc-cors=all \
542+
--ws-external \
543+
--rpc-methods=Unsafe \
544+
--no-telemetry \
545+
--no-prometheus \
546+
--reserved-only \
547+
--no-hardware-benchmarks \
548+
--tmp \
549+
-- \
550+
--reserved-only"
537551
- name: Start Reference Node
538552
working-directory: ${{env.BIN_DIR}}
539553
run: |
540-
./${{env.REF_BIN_FILENAME}} \
541-
--chain=frequency-bench \
542-
--rpc-external \
543-
--rpc-cors=all \
544-
--ws-external \
545-
--rpc-methods=Unsafe \
546-
--no-telemetry \
547-
--no-prometheus \
548-
--ws-port $((9946)) \
549-
--reserved-only \
550-
--tmp \
551-
-- \
552-
--reserved-only \
553-
&
554+
docker run -d --rm --net=net-${{env.RELEASE_BRANCH_NAME}} \
555+
-v `pwd`:/app \
556+
--name ref-node \
557+
ubuntu:22.04 \
558+
/bin/sh -c "chmod +x /app/${{env.REF_BIN_FILENAME}} && /app/${{env.REF_BIN_FILENAME}} \
559+
--chain=frequency-bench \
560+
--rpc-external \
561+
--rpc-cors=all \
562+
--ws-external \
563+
--rpc-methods=Unsafe \
564+
--no-telemetry \
565+
--no-prometheus \
566+
--reserved-only \
567+
--no-hardware-benchmarks \
568+
--tmp \
569+
-- \
570+
--reserved-only"
554571
- name: Prepare Output
555572
working-directory: ${{env.OUTPUT_DIR}}
556573
run: |
@@ -562,8 +579,9 @@ jobs:
562579
echo "Test version: $BIN_VERSION" >> ${{env.OUTPUT_FILENAME}}
563580
echo "----------------------------------------------------------------------" >> ${{env.OUTPUT_FILENAME}}
564581
- name: Compare Metadata
582+
timeout-minutes: 10
565583
run: |
566-
CMD="docker run --pull always --network host frequencychain/polkadot-js-tools:v0.52.29 metadata ws://localhost:9946 ws://localhost:9944"
584+
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"
567585
echo -e "Running:\n$CMD"
568586
$CMD >> ${{env.OUTPUT_DIR}}/${{env.OUTPUT_FILENAME}}
569587
sed -z -i 's/\n\n/\n/g' ${{env.OUTPUT_DIR}}/${{env.OUTPUT_FILENAME}}
@@ -585,7 +603,9 @@ jobs:
585603
if: always()
586604
run: |
587605
echo "Attempting to kill all frequency processes..."
588-
pkill -9 ${{env.FREQUENCY_PROCESS_NAME}}
606+
docker stop ref-node || true
607+
docker stop test-node || true
608+
docker network rm net-${{env.RELEASE_BRANCH_NAME}}
589609
590610
wait-for-all-builds:
591611
needs:

.github/workflows/verify-pr-commit.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ jobs:
208208
uses: actions/checkout@v3
209209
# cargo doc requires a toolchain version ^nightly-2022-11-15 because of a bug that causes a panic
210210
# When the toolchain is updated to ^nightly-2023-06-01, this can be removed
211-
- name: Install Rust Nightly-2023-06-01 and Build Docs
211+
- name: Build Docs
212212
run: |
213213
rustup install nightly-2023-06-01
214214
rustup target add wasm32-unknown-unknown --toolchain nightly-2023-06-01

0 commit comments

Comments
 (0)