Skip to content

Commit

Permalink
try main process workflow with dump
Browse files Browse the repository at this point in the history
  • Loading branch information
BuddyGlas committed Nov 28, 2024
1 parent fa004e3 commit e2477a2
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 10 deletions.
72 changes: 72 additions & 0 deletions .baedeker/main-process.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
local
m = import 'baedeker-library/mixin/spec.libsonnet',
rm = import 'baedeker-library/mixin/raw-spec.libsonnet',
;

function(relay_spec, forked_spec, dump_spec)

local relay = {
name: 'relay',
bin: 'bin/polkadot',
validatorIdAssignment: 'staking',
spec: {Genesis:{
chain: relay_spec,
modify:: m.genericRelay($),
}},
nodes: {
[name]: {
bin: $.bin,
wantedKeys: 'relay',
expectedDataPath: '/parity',
},
for name in ['alice', 'bob', 'charlie', 'dave', 'eve']
},
};

local unique = {
name: 'unique',
bin: 'bin/unique',
paraId: 1001,
spec: {Raw:{
local modifyRaw = bdk.mixer([
rm.resetNetworking($),
rm.decodeSpec(),
rm.polkaLaunchPara($),
rm.reencodeSpec(),
]),
raw_spec: modifyRaw({
name: "Unused",
id: "%s_local" % forked_spec,
bootNodes: error "override me",
chainType: error "override me",
telemetryEndpoints: error "override me",
codeSubstitutes: error "override me",
para_id: error "override me",
relay_chain: "unused",
genesis: {
raw: {
top: cql.fullDump(dump_spec),
childrenDefault: {},
},
},
}),
}},
nodes: {
[name]: {
bin: $.bin,
wantedKeys: 'para',
extraArgs: [
'--increase-future-pool',
'--pool-type=fork-aware',
],
},
for name in ['alice', 'bob', 'charlie']
},
};

relay + {
parachains: {
[para.name]: para,
for para in [unique]
},
}
2 changes: 1 addition & 1 deletion .docker/Dockerfile-unique
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ARG FEATURES

RUN cd unique-chain && \
echo "Using runtime features ${FEATURES}" && \
CARGO_INCREMENTAL=0; WASM_BUILD_TYPE=integration-tests; cargo build --profile integration-tests --features=fast-inflation,"${FEATURES}" --locked && \
CARGO_INCREMENTAL=0 WASM_BUILD_TYPE=integration-tests cargo build --profile integration-tests --features=fast-inflation,"${FEATURES}" --locked && \
mv ./target/integration-tests/unique-collator /workdir/unique-chain/ && \
cd target/integration-tests/wbuild && find . -name "*.wasm" -exec sh -c 'mkdir -p "../../../wasm/$(dirname {})"; cp {} "../../../wasm/{}"' \;

Expand Down
2 changes: 1 addition & 1 deletion .docker/Dockerfile-unique-release
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ARG FEATURES

RUN git clone -b "${CODE_VERSION}" https://github.com/uniquenetwork/unique-chain.git && \
cd unique-chain && git switch "${CODE_HASH}" --detach && \
CARGO_INCREMENTAL=0; cargo build --release --features="${FEATURES}" --locked && \
CARGO_INCREMENTAL=0 cargo build --release --features="${FEATURES}" --locked && \
mv ./target/release/unique-collator /workdir/unique-chain/ && \
cd target/release/wbuild && find . -name "*.wasm" -exec sh -c 'mkdir -p "../../../wasm/$(dirname {})"; cp {} "../../../wasm/{}"' \;

Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/main-process-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ jobs:
- name: Setup library
run: mkdir -p .baedeker/vendor/ && git clone https://github.com/UniqueNetwork/baedeker-library .baedeker/vendor/baedeker-library

- name: Get state from production
run: |
chainql -e 'cql.chain("${{ matrix.fork_source }}").latest._preloadKeys._raw' > .baedeker/vendor/dump.json

- name: Start network
uses: UniqueNetwork/baedeker-action@v1-no-debug-output
if: success()
Expand All @@ -161,9 +165,10 @@ jobs:
tla-str: |
relay_spec=${{ env.RELAY_CHAIN_TYPE }}-local
forked_spec=${{ matrix.network }}
fork_source=${{ matrix.fork_source }}
tla-code: |
dump_spec=import 'dump.json'
inputs: |
.baedeker/forkless-data.jsonnet
.baedeker/main-process.jsonnet
snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.image }}:${{ steps.polkadot.outputs.tag }}'}})
# with data build uses old runtime, but new node, thus we use mainnet image for spec generation, and then target image for nodes.
# snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.node.outputs.name }}'}}, extra_node_mixin={extraArgs: []}, for_chain = false)
Expand All @@ -179,7 +184,7 @@ jobs:
env:
RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}

- name: "Reconcile: all nodes are updated"
- name: "Reconcile: nodes updating"
if: ${{ !cancelled() && steps.alive1.outcome == 'success' }}
id: reconcile1
uses: UniqueNetwork/baedeker-action/reconcile@v1-no-debug-output
Expand All @@ -200,7 +205,7 @@ jobs:
env:
RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}

- name: "Reconcile: runtime is upgraded"
- name: "Reconcile: runtime updating"
working-directory: js-packages/tests
id: reconcile2
if: ${{ !cancelled() && steps.alive2.outcome == 'success' }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/xcm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ jobs:
reporter: mochawesome-json
fail-on-error: 'false'

# - name: Remove builder cache
# if: always()
# run: |
# docker system prune -a -f
- name: Remove builder cache
if: always()
run: |
docker system prune -a -f

0 comments on commit e2477a2

Please sign in to comment.