Skip to content

Commit 2ed97d2

Browse files
majuskomateuszaaagoncertenequmiStrike7
authored
Release/0.28.0 (#428)
Co-authored-by: mateuszaaa <mateusz@mangata.finance> Co-authored-by: goncer <gonza.cerro@gmail.com> Co-authored-by: Misha Kolesnik <tenequm@gmail.com> Co-authored-by: iStrike7 <40371953+iStrike7@users.noreply.github.com> Co-authored-by: Michal Danco <devdanco@gmail.com> Co-authored-by: Mateusz Nowakowski <mat13mn@gmail.com> Co-authored-by: Marian Vanderka <vanderka.marian@gmail.com>
1 parent 0b05fbb commit 2ed97d2

File tree

109 files changed

+6341
-5153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+6341
-5153
lines changed

.github/workflows/branch-develop.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,15 @@ jobs:
8282
with:
8383
env: fungible
8484
version: ${{ needs.init.outputs.GLOBAL_VERSION }}
85+
86+
performance-tests:
87+
name: performance tests
88+
needs: [init, deploy-fungible]
89+
if: |
90+
(github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == ':rocket: deploy' && contains(github.event.pull_request.labels.*.name, 'full-benchmarks')) ||
91+
(github.event_name == 'pull_request' && github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, ':rocket: deploy') && contains(github.event.pull_request.labels.*.name, 'full-benchmarks'))
92+
uses: ./.github/workflows/reusable-perfomance-tests.yml
93+
secrets: inherit
8594

8695
clean-up-fungible:
8796
name: Delete fungible environment
@@ -131,4 +140,4 @@ jobs:
131140
e2eBranch: ${{ github.event.inputs.e2eBranch }}
132141
parachainDocker: ${{ github.event.inputs.parachainDocker }}
133142
skipBuild: ${{ github.event.inputs.skipBuild }}
134-
globalVersion: ${{ needs.init.outputs.GLOBAL_VERSION }}
143+
globalVersion: ${{ needs.init.outputs.GLOBAL_VERSION }}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Deploy mangata-node to `rococo`
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "Version to be assigned to the built image"
8+
required: true
9+
type: string
10+
workflow_call:
11+
inputs:
12+
version:
13+
description: "Version to be assigned to the built image"
14+
required: true
15+
type: string
16+
17+
concurrency: rococo_environment
18+
19+
jobs:
20+
deploy_rococo:
21+
runs-on: ubuntu-latest
22+
environment: rococo
23+
env:
24+
version_file: helmfiles/rococo/.version
25+
GH_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
26+
steps:
27+
- name: Verify specified version exists
28+
run: docker pull mangatasolutions/mangata-node:${{ inputs.version }}
29+
30+
- name: Checkout `mangata-finance/gitops` repository
31+
uses: actions/checkout@v3
32+
with:
33+
repository: mangata-finance/gitops
34+
ref: main
35+
token: ${{ secrets.BOT_GITHUB_TOKEN }}
36+
37+
- name: Push updated version to `gitops` repository
38+
id: version
39+
run: |
40+
echo -n '${{ inputs.version }}' > ${{ env.version_file }}
41+
git config user.name mangatafinance
42+
git config user.email solutions@mangata.finance
43+
git add .
44+
git commit -m 'chore: deploy ${{ inputs.version }} to rococo environment' || \
45+
echo "changed=false" >> $GITHUB_OUTPUT
46+
git push
47+
48+
- name: Watch deployment workflow run
49+
run: |
50+
# Rerun previous workflow if version didn't change
51+
[ -n '${{ steps.version.outputs.changed }}' ] && gh run rerun $(gh run list -w deploy-rococo.yml -L1 --json databaseId --jq '.[].databaseId')
52+
53+
sleep 5 && gh run list -L10 -w deploy-rococo.yml
54+
export RUN_ID=$(gh run list -w deploy-rococo.yml -L1 --json databaseId --jq '.[].databaseId')
55+
56+
if [[ ($(gh run view "$RUN_ID" --json headSha --jq '.headSha') != $(git rev-parse HEAD)) && -z '${{ steps.version.outputs.changed }}' ]]; then
57+
echo "Commited git SHA doesn't match with the SHA of the retrieved Run ID"
58+
exit 1
59+
fi
60+
61+
echo "Deployed version: ${{ inputs.version }}" >> $GITHUB_STEP_SUMMARY
62+
echo "Deployment workflow URL: $(gh run view "$RUN_ID" --json url --jq '.url')" >> $GITHUB_STEP_SUMMARY
63+
gh run watch "$RUN_ID" --exit-status

.github/workflows/reusable-build-and-test.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
required: true
1414
type: string
1515
builder_image:
16-
default: mangatasolutions/node-builder:multi-nightly-2022-11-21
16+
default: mangatasolutions/node-builder:multi-nightly-2022-11-15
1717
description: Docker image used for Rust builds
1818
required: false
1919
type: string
@@ -51,15 +51,15 @@ jobs:
5151
/usr/local/cargo/registry
5252
~/.cache/sccache
5353
key: node-cache-${{ inputs.cache_version }}-${{ hashFiles('Cargo.lock') }}
54-
54+
5555
- name: Compile mangata-node code
5656
run: cargo build --release --no-default-features --features=mangata-rococo,mangata-kusama
5757

5858
- name: Rename wasms
5959
run: |
6060
cp target/release/wbuild/mangata-kusama-runtime/mangata_kusama_runtime.compact.compressed.wasm ./mangata_kusama_runtime-${{ inputs.version }}.compact.compressed.wasm
6161
cp target/release/wbuild/mangata-rococo-runtime/mangata_rococo_runtime.compact.compressed.wasm ./mangata_rococo_runtime-${{ inputs.version }}.compact.compressed.wasm
62-
62+
6363
- name: Build and push Docker image
6464
run: |
6565
docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}
@@ -80,7 +80,7 @@ jobs:
8080
run: |
8181
cp target/release/wbuild/mangata-kusama-runtime/mangata_kusama_runtime.compact.compressed.wasm ./mangata_kusama_runtime-${{ inputs.version }}-fast.compact.compressed.wasm
8282
cp target/release/wbuild/mangata-rococo-runtime/mangata_rococo_runtime.compact.compressed.wasm ./mangata_rococo_runtime-${{ inputs.version }}-fast.compact.compressed.wasm
83-
83+
8484
- name: Build and push Docker image with fast runtime
8585
run: |
8686
docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}
@@ -102,7 +102,7 @@ jobs:
102102
./mangata_rococo_runtime-${{ inputs.version }}.compact.compressed.wasm
103103
./mangata_kusama_runtime-${{ inputs.version }}-fast.compact.compressed.wasm
104104
./mangata_rococo_runtime-${{ inputs.version }}-fast.compact.compressed.wasm
105-
105+
106106
- name: Fix permissions on self-hosted runner
107107
if: always()
108108
run: chown -R 1003:1004 $GITHUB_WORKSPACE
@@ -216,11 +216,11 @@ jobs:
216216
key: cargo-try-runtime-${{ inputs.cache_version }}-${{ hashFiles('Cargo.lock') }}
217217

218218
- name: Run try-runtime Rococo testnet
219-
run: cargo run --release --features=try-runtime,mangata-rococo try-runtime --chain=public-testnet --execution=Native on-runtime-upgrade live --uri wss://roccoco-testnet-collator-01.mangatafinance.cloud:443
219+
run: cargo run --release --features=try-runtime,mangata-rococo try-runtime --chain=public-testnet --runtime=target/release/wbuild/mangata-rococo-runtime/mangata_rococo_runtime.wasm on-runtime-upgrade live --uri wss://roccoco-testnet-collator-01.mangatafinance.cloud:443
220220

221221
- name: Run try-runtime Kusama Mainnet
222-
run: cargo run --release --features=try-runtime try-runtime --chain=kusama-mainnet --execution=Native on-runtime-upgrade live --uri wss://prod-kusama-collator-01.mangatafinance.cloud:443
223-
222+
run: cargo run --release --features=try-runtime try-runtime --chain=kusama-mainnet --runtime=target/release/wbuild/mangata-kusama-runtime/mangata_kusama_runtime.wasm on-runtime-upgrade live --uri wss://prod-kusama-collator-01.mangatafinance.cloud:443
223+
224224
- name: Fix permissions on self-hosted runner
225225
if: always()
226226
run: chown -R 1003:1004 $GITHUB_WORKSPACE
@@ -274,7 +274,7 @@ jobs:
274274
--repeat ${{ env.REPEATS }} \
275275
--template ./templates/module-weight-template.hbs \
276276
--output ./benchmarks/
277-
277+
278278
- name: Run block & extrinsic overhead benchmarks
279279
run: |
280280
target/release/mangata-node benchmark overhead --execution native --chain dev -lblock_builder=debug --max-ext-per-block 50000 --base-path .

.github/workflows/reusable-deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ jobs:
7373
- run: |
7474
export ENVIRONMENT=${{ env.ENV_REF }}
7575
export IMAGE_TAG=${{ inputs.version }}
76+
77+
# https://dev.to/derlin/helmfile-difference-between-sync-and-apply-helm-3-28o1
78+
export HELM_DIFF_THREE_WAY_MERGE=true
7679
helmfile apply -e ${{ inputs.env }}
7780
working-directory: devops/helmfiles
7881

.github/workflows/reusable-e2e-tests.yml

Lines changed: 50 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11
name: Reusable e2e tests workflow
22

33
on:
4+
workflow_dispatch:
5+
inputs:
6+
e2eBranch:
7+
description: "Name of the e2e target branch"
8+
type: string
9+
required: false
10+
default: "main"
11+
parachainDocker:
12+
description: "Name of the parachain docker reference"
13+
type: string
14+
required: false
15+
default: "mangatasolutions/mangata-node:latest"
16+
skipBuild:
17+
description: "Skip build phase"
18+
type: string
19+
required: false
20+
default: false
21+
globalVersion:
22+
description: "Set Mangata node version."
23+
type: string
24+
required: true
425
workflow_call:
526
inputs:
627
e2eBranch:
@@ -33,7 +54,19 @@ jobs:
3354
e2e-test-matrix:
3455
strategy:
3556
matrix:
36-
command: ["yarn test-parallel --max-workers=32", "yarn test-sequential-no-bootstrap"]
57+
include:
58+
- command: "yarn test-parallel --max-workers=32"
59+
fast: false
60+
- command: "yarn test-sequential-no-bootstrap"
61+
fast: false
62+
- command: "yarn test-seqgasless"
63+
fast: false
64+
- command: "yarn test-bootstrap"
65+
fast: false
66+
- command: "yarn test-rewards-bootstrap"
67+
fast: false
68+
- command: "yarn test-sequential-autocompound"
69+
fast: true
3770
runs-on: [self-hosted, compile]
3871
timeout-minutes: 180
3972
env:
@@ -51,6 +84,10 @@ jobs:
5184
####IDK, but this is neccesary for reports
5285
- uses: actions/checkout@v3
5386

87+
- name: Adapt if fast runtime
88+
if: ${{ !contains(env.PARACHAIN_DOCKER_IMAGE, 'fast') && matrix.fast == true }}
89+
run: echo "PARACHAIN_DOCKER_IMAGE=${{ env.PARACHAIN_DOCKER_IMAGE }}-fast" >> $GITHUB_ENV
90+
5491
- name: Download node Docker image
5592
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-build') && inputs.skipBuild != 'true' }}
5693
run: docker pull ${{ env.PARACHAIN_DOCKER_IMAGE }}
@@ -84,6 +121,12 @@ jobs:
84121
repository: mangata-finance/mangata-e2e
85122
ref: "${{ env.E2EBRANCHNAME }}"
86123
path: e2eTests
124+
125+
- uses: actions/setup-node@v3
126+
with:
127+
node-version: '16'
128+
cache: 'yarn'
129+
cache-dependency-path: '**/yarn.lock'
87130

88131
- name: Print parachain docker image reference
89132
run: |
@@ -93,9 +136,13 @@ jobs:
93136
working-directory: launch
94137
run: sed -i 's+mangatasolutions/mangata-node:dev+${{ env.PARACHAIN_DOCKER_IMAGE }}+g' config.yml
95138

96-
- name: Install parachain launch
139+
- name: Install parachain launch dependencies
97140
working-directory: launch
98141
run: yarn
142+
143+
- name: Install e2e tests dependencies
144+
working-directory: e2eTests
145+
run: yarn
99146

100147
- name: Generate parachain launch config
101148
working-directory: launch
@@ -109,12 +156,8 @@ jobs:
109156
working-directory: launch
110157
run: yarn up
111158

112-
- name: Install dependencies
113-
working-directory: e2eTests
114-
run: yarn
115-
116159
- name: Docker ps
117-
run: docker ps
160+
run: docker ps --no-trunc
118161

119162
- name: Sleep for 2 minutes
120163
run: sleep 120s #close buffers of videos.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Performance tests workflow
2+
on:
3+
workflow_call:
4+
5+
permissions:
6+
contents: write
7+
id-token: write
8+
deployments: write
9+
checks: write
10+
11+
jobs:
12+
performance-tests:
13+
runs-on: [self-hosted, compile]
14+
timeout-minutes: 180
15+
env:
16+
ENV_REF: ${{ format('pr-{0}', github.event.number) }}
17+
steps:
18+
####IDK, but this is neccesary for reports
19+
- uses: actions/checkout@v3
20+
21+
- name: Checkout performance-tests
22+
uses: actions/checkout@v3
23+
with:
24+
token: ${{ secrets.DEV_TOOLS_REPO_ACCESS_TOKEN }}
25+
repository: mangata-finance/dev-tools
26+
path: dev-tools
27+
28+
- name: Install parachain launch
29+
working-directory: dev-tools/fill-block-with-txs
30+
run: npm install
31+
32+
- name: Run performance tests
33+
working-directory: dev-tools/fill-block-with-txs
34+
run: |
35+
./index.js --url "wss://node-01-ws-${{ env.ENV_REF }}.mangata.online" \
36+
--url "wss://node-02-ws-${{ env.ENV_REF }}.mangata.online" \
37+
--mnemonic ${{ secrets.E2E_TEST_SUDO_NAME }} \
38+
--txs_count 800 \
39+
--workers_count 8 \
40+
--timeout 300 \
41+
--output ../../performance-benchmark.png \
42+
--expected_throughput 300 \
43+
--number_of_blocks 50
44+
45+
- name: Upload reports
46+
uses: actions/upload-artifact@v3.1.1
47+
with:
48+
name: performance-benchmark
49+
path: ./performance-benchmark.png

0 commit comments

Comments
 (0)