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

Tracing runtime 2601 #78

Merged
merged 11 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from 10 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
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ indent_size=2

[*.md]
trim_trailing_whitespace=false

# ignore generated files
[tracing/*/runtime/**/*.rs]
indent_style=unset
indent_size=unset
max_line_length=unset
120 changes: 120 additions & 0 deletions .github/workflows/publish-docker-purestake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: Publish Docker (Legacy PureStake)

on:
workflow_dispatch:
inputs:
client_tag:
description: moonbeam client tag (ex. v0.8.3) to publish on docker
required: true
overrides_branch:
description: runtime overrides branch (default master)
required: true
default: "master"

jobs:
docker-moonbeam-tracing:
runs-on: ubuntu-latest
outputs:
sha: ${{ steps.get-sha.outputs.sha }}
sha4: ${{ steps.get-sha.outputs.sha4 }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.overrides_branch }}
- name: Get Sha
id: get-sha
run: |
echo ::set-output name=sha::$(git log -1 --format="%H")
echo ::set-output name=sha4::$(git log -1 --format="%H" | cut -c1-4)
- name: Get last tracing runtime spec version
id: get-last-spec-version
run: |
INTEGER_REGEX='^[0-9]+$'
MAX=0
cd tracing
for D in *; do
if [[ "${D}" =~ $INTEGER_REGEX ]] ; then
if [ "${D}" -gt "$MAX" ]; then
MAX=${D}
fi
fi
done
echo ::set-output name=last_spec_version::$MAX
echo "last_spec_version: $MAX"

- name: Prepare
id: prep
run: |
DOCKER_IMAGE=purestake/moonbeam-tracing
DOCKER_TAG="${DOCKER_IMAGE}:${{ github.event.inputs.client_tag }}-${{ steps.get-last-spec-version.outputs.last_spec_version }}-${{ steps.get-sha.outputs.sha4 }}"
DOCKER_LATEST_TAG="${DOCKER_IMAGE}:${{ github.event.inputs.client_tag }}-${{ steps.get-last-spec-version.outputs.last_spec_version }}-latest"
echo ::set-output name=docker_tag::${DOCKER_TAG}
echo ::set-output name=docker_latest_tag::${DOCKER_LATEST_TAG}
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Check existing docker image
id: check-docker-image
run: |
echo ::set-output name=image_exists::$(docker manifest inspect ${{ steps.prep.outputs.docker_tag }} > /dev/null && echo "true" || echo "false")
- name: Display variables
run: |
echo git_ref: ${{ github.event.inputs.overrides_branch }}
echo sha: ${{ steps.get-sha.outputs.sha }}
echo sha4: ${{ steps.get-sha.outputs.sha4 }}
echo image_tag: ${{ steps.prep.outputs.docker_tag }}
echo image_exists: ${{ steps.check-docker-image.outputs.image_exists }}
- name: Retrieve moonbeam client
run: |
mkdir build
CLIENT_TAG=${{ github.event.inputs.client_tag }}
CLIENT_IMAGE="purestake/moonbeam:$CLIENT_TAG"
docker create -ti --name dummy $CLIENT_IMAGE bash
docker cp dummy:/moonbeam/moonbeam build/moonbeam
docker rm -f dummy
- name: Add moonbase runtimes overrides
run: |
mkdir -p build/moonbase-substitutes-tracing
cp wasm/moonbase-* build/moonbase-substitutes-tracing/
- name: Add moonriver runtimes overrides
run: |
mkdir -p build/moonriver-substitutes-tracing
cp wasm/moonriver-* build/moonriver-substitutes-tracing/
- name: Add moonbeam runtimes overrides
run: |
mkdir -p build/moonbeam-substitutes-tracing
cp wasm/moonbeam-* build/moonbeam-substitutes-tracing/
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
driver-opts: |
image=moby/buildkit:master
- name: Login to DockerHub (LEGACY PureStake)
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push moonbeam-tracing
id: docker_build
if: ${{ steps.check-docker-image.outputs.image_exists }} == false
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/moonbeam-tracing.Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ steps.prep.outputs.docker_tag }}
${{ steps.prep.outputs.docker_latest_tag }}

labels: |
org.opencontainers.image.title="Moonbeam Tracing"
org.opencontainers.image.description=${{ github.event.repository.description }}
org.opencontainers.image.url=${{ github.event.repository.html_url }}
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }}
22 changes: 10 additions & 12 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ on:
default: "master"

jobs:

docker-moonbeam-tracing:
runs-on: ubuntu-latest
outputs:
sha: ${{ steps.get-sha.outputs.sha }}
sha4: ${{ steps.get-sha.outputs.sha4 }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.overrides_branch }}
- name: Get Sha
Expand All @@ -46,14 +45,14 @@ jobs:
- name: Prepare
id: prep
run: |
DOCKER_IMAGE=purestake/moonbeam-tracing
DOCKER_IMAGE=moonbeamfoundation/moonbeam-tracing
DOCKER_TAG="${DOCKER_IMAGE}:${{ github.event.inputs.client_tag }}-${{ steps.get-last-spec-version.outputs.last_spec_version }}-${{ steps.get-sha.outputs.sha4 }}"
DOCKER_LATEST_TAG="${DOCKER_IMAGE}:${{ github.event.inputs.client_tag }}-${{ steps.get-last-spec-version.outputs.last_spec_version }}-latest"
echo ::set-output name=docker_tag::${DOCKER_TAG}
echo ::set-output name=docker_latest_tag::${DOCKER_LATEST_TAG}
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
- name: Check existing docker image
id: check-docker-image
run: |
Expand All @@ -69,7 +68,7 @@ jobs:
run: |
mkdir build
CLIENT_TAG=${{ github.event.inputs.client_tag }}
CLIENT_IMAGE="purestake/moonbeam:$CLIENT_TAG"
CLIENT_IMAGE="moonbeamfoundation/moonbeam:$CLIENT_TAG"
docker create -ti --name dummy $CLIENT_IMAGE bash
docker cp dummy:/moonbeam/moonbeam build/moonbeam
docker rm -f dummy
Expand All @@ -86,22 +85,22 @@ jobs:
mkdir -p build/moonbeam-substitutes-tracing
cp wasm/moonbeam-* build/moonbeam-substitutes-tracing/
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
with:
version: latest
driver-opts: |
image=moby/buildkit:master
- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ secrets.MBF_DOCKERHUB_USERNAME }}
password: ${{ secrets.MBF_DOCKERHUB_TOKEN }}
- name: Build and push moonbeam-tracing
id: docker_build
if: ${{ steps.check-docker-image.outputs.image_exists }} == false
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/moonbeam-tracing.Dockerfile
Expand All @@ -119,4 +118,3 @@ jobs:
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }}

14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,17 @@ So, to import the new runtimes with chain spec `XXX`:
1. Run command `./scripts/build-tracing-runtime.sh XXX`
1. Commit wasm blob and json digest for each new runtime
1. Push the branch `tracing-runtime-XXX` and submit a PR

### Publishing the docker runtime

There are two actions to publish the tracing runtime on docker:

1. Publish Docker
publishes the tracing runtime to the [moonbeamfoundation DockerHub registry](https://hub.docker.com/r/moonbeamfoundation/moonbeam-tracing/tags)


2. Publish Docker (Legacy PureStake)
publishes the tracing runtime to the legagy [purestake DockerHub registry](https://hub.docker.com/r/purestake/moonbeam-tracing/tags)

Until the legagy docker registry is abandoned it is necessary to publish the image on both registries
noandrea marked this conversation as resolved.
Show resolved Hide resolved

4 changes: 2 additions & 2 deletions scripts/import-tracing-runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ else
echo "Get moonbeam snapshot..."
rm -rf tmp
mkdir tmp
git clone https://github.com/PureStake/moonbeam --depth 1 -b $GIT_REF $MOONBEAM_PATH
git clone https://github.com/moonbeam-foundation/moonbeam --depth 1 -b $GIT_REF $MOONBEAM_PATH
fi

# Copy relevant files
Expand All @@ -35,7 +35,7 @@ rm -rf tracing/$SPEC_VERSION/runtime/relay-encoder

echo "Run migration script"
cd scripts
cargo run -q --bin migrate-imported -- --dir ../tracing/$SPEC_VERSION --repo "https://github.com/PureStake/moonbeam" $GIT_DEP_REF
cargo run -q --bin migrate-imported -- --dir ../tracing/$SPEC_VERSION --repo "https://github.com/moonbeam-foundation/moonbeam" $GIT_DEP_REF
cd ..

echo "Running ./scripts/update-tracing-runtime-lock.sh $SPEC_VERSION ..."
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"gen":"srtool v0.11.1","src":"zip","version":"0.8.4","commit":"","tag":"","branch":"","rustc":"rustc 1.70.0 (90c541806 2023-05-31)","pkg":"moonbase-runtime","tmsp":"2023-11-13T21:15:41Z","size":"1852048","prop":"0x51f29acf08c008137111afd67c98808b91284c1743cc6163463bc44b0b41c459","authorize_upgrade_prop":"0xfbe0f0b1d767c8df6440c162fe1d16cde6f91810652c556d4a4aa9b034382538","ipfs":"QmZqXMx7NH4Lo7b5MAjWbNQQjS38S3Qo2D2sXNQ3GwM6Hz","sha256":"0x58c2da101626b2b52435e20f7d53eb51abadfa5201e06cf59e326fc27e9b1d54","wasm":"runtime/moonbase/target/srtool/release/wbuild/moonbase-runtime/moonbase_runtime.compact.compressed.wasm","info":{"generator":{"name":"srtool","version":"0.11.1"},"src":"zip","version":"0.8.4","git":{"commit":"","tag":"","branch":""},"rustc":"rustc 1.70.0 (90c541806 2023-05-31)","pkg":"moonbase-runtime","profile":"release"},"context":{"package":"moonbase-runtime","runtime_dir":"runtime/moonbase","docker":{"image":"paritytech/srtool","tag":"1.70.0"},"profile":"release"},"runtimes":{"compact":{"tmsp":"2023-11-13T21:15:20Z","size":"9078540","prop":"0xf072651a4b91998021fefc50b23514e5a61156c4f2282087a3ef6cca979639a6","authorize_upgrade_prop":"0x4303e53749cc5df90071f7fd532baede9380279d2f09595c102b62b6b138d528","blake2_256":"0xf319862e1575e7ce44ab07bd8b0ea8be93cbec6c077d10de9f21275dbb45a1ce","ipfs":"QmRPy3fZp674dqp8RC3546Pm6aDN9Lny5h5UFLg9HVjQG2","sha256":"0x571026e5580edd1ae322075d869ccb3267f6174d08b8a99c92f8c9370b409153","wasm":"runtime/moonbase/target/srtool/release/wbuild/moonbase-runtime/moonbase_runtime.compact.wasm","subwasm":{"size":9078540,"compression":{"size_compressed":9078540,"size_decompressed":9078540,"compressed":false},"reserved_meta":[109,101,116,97],"reserved_meta_valid":true,"metadata_version":14,"core_version":{"specName":"moonbase","implName":"moonbase","authoringVersion":4,"specVersion":2601,"implVersion":0,"apis":[["0xd2bc9897eed08f15",3],["0xdf6acb689907609b",4],["0x37e397fc7c91f5e4",2],["0x40fe3ad401f8959a",6],["0xf78b278be53f454c",2],["0xab3c0572291feb8b",1],["0xbc9d89904f5b923f",1],["0xbd78255d4feeea1f",4],["0xa33d43f58731ad84",2],["0x582211f65bb14b89",5],["0xe65b00e46cedd0aa",2],["0x37c8bb1350a9a2a8",4],["0x2aa62120049dd2d2",1],["0xea93e3f16f3d6962",2],["0xba8173bf23b2e6f8",1]],"transactionVersion":2,"stateVersion":0},"proposal_hash":"0xf072651a4b91998021fefc50b23514e5a61156c4f2282087a3ef6cca979639a6","parachain_authorize_upgrade_hash":"0x4303e53749cc5df90071f7fd532baede9380279d2f09595c102b62b6b138d528","ipfs_hash":"QmRPy3fZp674dqp8RC3546Pm6aDN9Lny5h5UFLg9HVjQG2","blake2_256":"0xf319862e1575e7ce44ab07bd8b0ea8be93cbec6c077d10de9f21275dbb45a1ce"}},"compressed":{"tmsp":"2023-11-13T21:13:43Z","size":"1852048","prop":"0x51f29acf08c008137111afd67c98808b91284c1743cc6163463bc44b0b41c459","authorize_upgrade_prop":"0xfbe0f0b1d767c8df6440c162fe1d16cde6f91810652c556d4a4aa9b034382538","blake2_256":"0xc8dbc636986655eb1ca14f8b3481c23df4d9651de9d345526d24beb259317b4e","ipfs":"QmZqXMx7NH4Lo7b5MAjWbNQQjS38S3Qo2D2sXNQ3GwM6Hz","sha256":"0x58c2da101626b2b52435e20f7d53eb51abadfa5201e06cf59e326fc27e9b1d54","wasm":"runtime/moonbase/target/srtool/release/wbuild/moonbase-runtime/moonbase_runtime.compact.compressed.wasm","subwasm":{"size":1852048,"compression":{"size_compressed":1852048,"size_decompressed":9078540,"compressed":true},"reserved_meta":[109,101,116,97],"reserved_meta_valid":true,"metadata_version":14,"core_version":{"specName":"moonbase","implName":"moonbase","authoringVersion":4,"specVersion":2601,"implVersion":0,"apis":[["0xd2bc9897eed08f15",3],["0xdf6acb689907609b",4],["0x37e397fc7c91f5e4",2],["0x40fe3ad401f8959a",6],["0xf78b278be53f454c",2],["0xab3c0572291feb8b",1],["0xbc9d89904f5b923f",1],["0xbd78255d4feeea1f",4],["0xa33d43f58731ad84",2],["0x582211f65bb14b89",5],["0xe65b00e46cedd0aa",2],["0x37c8bb1350a9a2a8",4],["0x2aa62120049dd2d2",1],["0xea93e3f16f3d6962",2],["0xba8173bf23b2e6f8",1]],"transactionVersion":2,"stateVersion":0},"proposal_hash":"0x51f29acf08c008137111afd67c98808b91284c1743cc6163463bc44b0b41c459","parachain_authorize_upgrade_hash":"0xfbe0f0b1d767c8df6440c162fe1d16cde6f91810652c556d4a4aa9b034382538","ipfs_hash":"QmZqXMx7NH4Lo7b5MAjWbNQQjS38S3Qo2D2sXNQ3GwM6Hz","blake2_256":"0xc8dbc636986655eb1ca14f8b3481c23df4d9651de9d345526d24beb259317b4e"}}}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"gen":"srtool v0.11.1","src":"zip","version":"0.8.4","commit":"","tag":"","branch":"","rustc":"rustc 1.70.0 (90c541806 2023-05-31)","pkg":"moonbeam-runtime","tmsp":"2023-11-13T21:28:23Z","size":"1815459","prop":"0xe53ed91f549519212d77cdbfe36416674cc40486d2e93719d000f6bb3e260f5b","authorize_upgrade_prop":"0x43afa37f6a713f5b2c8e485504711e43d920ec60ddfeef850a6ff2bc7df70141","ipfs":"QmTNzkptgmFc7vGQtah1UdNdMkAN27SvG9GwmysY1d9qVk","sha256":"0x22eb3f6d98e8c7342d0e71c9cd67eae04494c308ba5825fa119934a497afaf80","wasm":"runtime/moonbeam/target/srtool/release/wbuild/moonbeam-runtime/moonbeam_runtime.compact.compressed.wasm","info":{"generator":{"name":"srtool","version":"0.11.1"},"src":"zip","version":"0.8.4","git":{"commit":"","tag":"","branch":""},"rustc":"rustc 1.70.0 (90c541806 2023-05-31)","pkg":"moonbeam-runtime","profile":"release"},"context":{"package":"moonbeam-runtime","runtime_dir":"runtime/moonbeam","docker":{"image":"paritytech/srtool","tag":"1.70.0"},"profile":"release"},"runtimes":{"compact":{"tmsp":"2023-11-13T21:28:02Z","size":"8857478","prop":"0x3eedd25b435756d1315a8c1ed2608755bec5d8f70180147730f549acbce433d0","authorize_upgrade_prop":"0x4a4ed9be0cd1f14d5e940f9dc72ad18950f232bdeac4a904c4610045a5a9bb45","blake2_256":"0x6bdbadf5c9bfbc9f3e888fb3760a521a315e21845f97e3ae4af5a08c15a7bdb0","ipfs":"QmXgBBbVx5BXJYSrXUVpNx6g2gzuD8Yhn6cySjje4nbQnc","sha256":"0x4605aae478ddb973316784b13d9597db1d6085ca8101c0b8ef36811d3839d684","wasm":"runtime/moonbeam/target/srtool/release/wbuild/moonbeam-runtime/moonbeam_runtime.compact.wasm","subwasm":{"size":8857478,"compression":{"size_compressed":8857478,"size_decompressed":8857478,"compressed":false},"reserved_meta":[109,101,116,97],"reserved_meta_valid":true,"metadata_version":14,"core_version":{"specName":"moonbeam","implName":"moonbeam","authoringVersion":3,"specVersion":2601,"implVersion":0,"apis":[["0xd2bc9897eed08f15",3],["0xdf6acb689907609b",4],["0x37e397fc7c91f5e4",2],["0x40fe3ad401f8959a",6],["0xf78b278be53f454c",2],["0xab3c0572291feb8b",1],["0xbc9d89904f5b923f",1],["0xbd78255d4feeea1f",4],["0xa33d43f58731ad84",2],["0x582211f65bb14b89",5],["0xe65b00e46cedd0aa",2],["0x37c8bb1350a9a2a8",4],["0x2aa62120049dd2d2",1],["0xea93e3f16f3d6962",2],["0xba8173bf23b2e6f8",1]],"transactionVersion":2,"stateVersion":0},"proposal_hash":"0x3eedd25b435756d1315a8c1ed2608755bec5d8f70180147730f549acbce433d0","parachain_authorize_upgrade_hash":"0x4a4ed9be0cd1f14d5e940f9dc72ad18950f232bdeac4a904c4610045a5a9bb45","ipfs_hash":"QmXgBBbVx5BXJYSrXUVpNx6g2gzuD8Yhn6cySjje4nbQnc","blake2_256":"0x6bdbadf5c9bfbc9f3e888fb3760a521a315e21845f97e3ae4af5a08c15a7bdb0"}},"compressed":{"tmsp":"2023-11-13T21:26:26Z","size":"1815459","prop":"0xe53ed91f549519212d77cdbfe36416674cc40486d2e93719d000f6bb3e260f5b","authorize_upgrade_prop":"0x43afa37f6a713f5b2c8e485504711e43d920ec60ddfeef850a6ff2bc7df70141","blake2_256":"0xaddf86e60c170b9af020642a6748341195b925b811c67c2adef953f1aac9bd3d","ipfs":"QmTNzkptgmFc7vGQtah1UdNdMkAN27SvG9GwmysY1d9qVk","sha256":"0x22eb3f6d98e8c7342d0e71c9cd67eae04494c308ba5825fa119934a497afaf80","wasm":"runtime/moonbeam/target/srtool/release/wbuild/moonbeam-runtime/moonbeam_runtime.compact.compressed.wasm","subwasm":{"size":1815459,"compression":{"size_compressed":1815459,"size_decompressed":8857478,"compressed":true},"reserved_meta":[109,101,116,97],"reserved_meta_valid":true,"metadata_version":14,"core_version":{"specName":"moonbeam","implName":"moonbeam","authoringVersion":3,"specVersion":2601,"implVersion":0,"apis":[["0xd2bc9897eed08f15",3],["0xdf6acb689907609b",4],["0x37e397fc7c91f5e4",2],["0x40fe3ad401f8959a",6],["0xf78b278be53f454c",2],["0xab3c0572291feb8b",1],["0xbc9d89904f5b923f",1],["0xbd78255d4feeea1f",4],["0xa33d43f58731ad84",2],["0x582211f65bb14b89",5],["0xe65b00e46cedd0aa",2],["0x37c8bb1350a9a2a8",4],["0x2aa62120049dd2d2",1],["0xea93e3f16f3d6962",2],["0xba8173bf23b2e6f8",1]],"transactionVersion":2,"stateVersion":0},"proposal_hash":"0xe53ed91f549519212d77cdbfe36416674cc40486d2e93719d000f6bb3e260f5b","parachain_authorize_upgrade_hash":"0x43afa37f6a713f5b2c8e485504711e43d920ec60ddfeef850a6ff2bc7df70141","ipfs_hash":"QmTNzkptgmFc7vGQtah1UdNdMkAN27SvG9GwmysY1d9qVk","blake2_256":"0xaddf86e60c170b9af020642a6748341195b925b811c67c2adef953f1aac9bd3d"}}}}
Loading
Loading