Skip to content

Commit

Permalink
Prepare for next rustc version (#70)
Browse files Browse the repository at this point in the history
* Upgrade to Rust 1.72.0
* Bump srtool version
* Upgrade to Rust 1.73.0
* Use ENGINE variable for the container engine
* Remove old repos
* Remove polkadot and cumulus manual workflows
* Remove bridges from test
  • Loading branch information
chevdor authored Nov 7, 2023
1 parent 0a72a28 commit f5cc56b
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 150 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/manual-acala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
inputs:
srtool_tag:
description: The SRTOOL tag to use
default: 1.70.0
default: 1.73.0
required: false
ref:
description: The ref to be used for the repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual-fellow-runtimes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
default: paritytech/srtool
srtool_tag:
description: The SRTOOL tag to use
default: 1.70.0
default: 1.73.0
required: false
repo:
description: The repo to be used to build runtimes from
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual-moonbeam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
inputs:
srtool_tag:
description: The SRTOOL tag to use
default: 1.70.0
default: 1.73.0
required: false
ref:
description: The ref to be used for the repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual-polkadot-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
default: paritytech/srtool
srtool_tag:
description: The SRTOOL tag to use
default: 1.70.0
default: 1.73.0
repo:
description: The repo to be used to build runtimes from
default: paritytech/polkadot-sdk
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual-shiden.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
inputs:
srtool_tag:
description: The SRTOOL tag to use
default: 1.70.0
default: 1.73.0
required: false
ref:
description: The ref to be used for the repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
inputs:
srtool_tag:
description: The SRTOOL tag to use
default: 1.70.0
default: 1.73.0
required: false
srtool_image:
description: The SRTOOL image to use
Expand Down
110 changes: 0 additions & 110 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -509,113 +509,3 @@ jobs:
cumulus/${{ steps.srtool_build.outputs.wasm }}
cumulus/${{ steps.srtool_build.outputs.wasm_compressed }}
cumulus/${{ matrix.chain }}-srtool-digest.json
bridges:
runs-on: ubuntu-latest
needs: build
continue-on-error: true
strategy:
fail-fast: false
matrix:
chain: ["millau", "rialto"]
steps:
- name: Cache the image
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11
with:
key: srtool-docker-image-${{ github.sha }}
path: |
srtool.tar.gz
- name: Load Docker image
run: |
docker load -i srtool.tar.gz
docker images --digests
- name: Check out the Bridges repo
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
with:
repository: paritytech/parity-bridges-common
ref: ${{ github.event.inputs.ref }}
fetch-depth: 0
path: bridges

- name: Run srtool info
env:
PACKAGE: ${{ matrix.chain }}-runtime
RUNTIME_DIR: bin/${{ matrix.chain }}/runtime
working-directory: bridges
run: |
INFO=$(docker run --rm -i \
-e PACKAGE=$PACKAGE \
-e RUNTIME_DIR=$RUNTIME_DIR \
-v "${PWD}":/build \
srtool info -cM)
if [ $( echo $INFO | jq .src -r ) != "git" ] ; then
echo Invalid info output, got $( echo $INFO | jq .src -r )
exit 1
else
echo $INFO
fi
- name: Run srtool build for ${{ matrix.chain }}
id: srtool_build
env:
PACKAGE: ${{ matrix.chain }}-runtime
RUNTIME_DIR: bin/${{ matrix.chain }}/runtime
working-directory: bridges
run: |
CMD="docker run --rm -i \
-e PACKAGE=$PACKAGE \
-e RUNTIME_DIR=$RUNTIME_DIR \
-v ${PWD}:/build \
srtool build --app --json"
echo ::debug::build::docker_run $CMD
echo "::group::SRTOOL Build Output"
stdbuf -oL $CMD | {
while IFS= read -r line
do
echo ║ $line
JSON="$line"
done
echo "json=$JSON" >> $GITHUB_OUTPUT
echo "JSON=$JSON" >> $GITHUB_ENV
echo $JSON | jq .
WASM=`echo $JSON | jq -r .runtimes.compact.wasm`
echo "wasm=$WASM" >> $GITHUB_OUTPUT
Z_WASM=`echo $JSON | jq -r .runtimes.compressed.wasm`
echo "wasm_compressed=$Z_WASM" >> $GITHUB_OUTPUT
}
echo "::endgroup::"
- name: Summary for ${{ matrix.chain }}
working-directory: bridges
run: |
echo "::group::JSON digest"
echo $JSON | jq . | tee ${{ matrix.chain }}-srtool-digest.json
echo "::endgroup::"
echo "::group::Runtimes paths"
echo "Compact Runtime: ${{ steps.srtool_build.outputs.wasm }}"
echo "Compressed Runtime: ${{ steps.srtool_build.outputs.wasm_compressed }}"
echo "::endgroup::"
echo "::group::Debugging"
pwd; ls -al
ls -al ${{ steps.srtool_build.outputs.wasm_compressed }}
ls -al ${{ steps.srtool_build.outputs.wasm_compressed }}
echo "::endgroup::"
- name: Archive Artifacts for ${{ matrix.chain }}
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
with:
name: ${{ matrix.chain }}-runtime
path: |
bridges/${{ steps.srtool_build.outputs.wasm }}
bridges/${{ steps.srtool_build.outputs.wasm_compressed }}
bridges/${{ matrix.chain }}-srtool-digest.json
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM docker.io/library/ubuntu:22.04
LABEL maintainer "[email protected]"
LABEL description="This image contains tools for Substrate blockchains runtimes."

ARG RUSTC_VERSION="1.70.0"
ARG RUSTC_VERSION="1.73.0"
ENV RUSTC_VERSION=$RUSTC_VERSION
ENV DOCKER_IMAGE="paritytech/srtool"
ENV PROFILE=release
Expand Down
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# Substrate Runtime Toolbox: srtool v0.11.1
# Substrate Runtime Toolbox: srtool v0.12.0

<figure>
<img src="resources/srtool-docker_128px.png" alt="srtool docker 128px" />
</figure>

## Intro

`srtool` is a collection of dockerized tools helping with [Substrate](https://substrate.io) & [Polkadot](https://polkadot.network) Runtime development. `srtool` especially allows building WASM runtimes in a deterministic way, allowing CIs and users, with various machines and OS, to produce a strictly identical WASM runtime.
`srtool` is a collection of containerized tools helping with building WASM Runtimes for the
[Polkadot Network](https://polkadot.network). `srtool` especially allows building WASM runtimes in a
**deterministic** way, allowing CIs and users, with various machines and OS, to produce a strictly identical WASM runtime.

`srtool` can run on various Operating Systems supporting Docker. That includes Linux, MacOS and Windows.
`srtool` can run on various Operating Systems supporting Podman or Docker. That includes Linux, MacOS and Windows.

`srtool` especially helps with building and verifying WASM Runtimes. The Docker image is named `paritytech/srtool`. You can find the project’s repository at <https://hub.docker.com/r/paritytech/srtool>.
`srtool` helps building and verifying WASM Runtimes. The Docker image is named `paritytech/srtool`. You can find the project’s repository at <https://hub.docker.com/r/paritytech/srtool>.

## Docker image naming scheme

The Docker images are tagged with both the rustc version used internally as well as the version of the build script.

You may find for instance the following:

- `paritytech/srtool:1.70.0-0.9.19`
- `paritytech/srtool:1.73.0-0.12.0`

- `paritytech/srtool:1.70.0-0.11.1`
- `paritytech/srtool:1.73.0`

- `paritytech/srtool:1.70.0`

The tags not mentioning the build version always point to the latest one. In the example above, `paritytech/srtool:1.70.0` is the same image than `paritytech/srtool:1.70.0-0.11.1`.
The tags not mentioning the build version always point to the latest one. In the example above, `paritytech/srtool:1.73.0` is the same image than `paritytech/srtool:1.73.0-0.12.0`.

## Related tools

Expand All @@ -51,7 +51,7 @@ You may also want to have a look at [subwasm](https://github.com/chevdor/subwasm
The project was initially developed by <https://gitlab.com/chevdor>.
It has now moved to Github under the [Parity Technologies](https://www.github.com/paritytech) organisation to simplify the developement and the integration with other Parity products such as Polkadot and Kusama.

The last version hosted on Gitlab has been built using Rust Stable 1.70.0. It is tagged as v0.11.1 and there is no plan on updating the Gitlab repository further. New versions will be available from [this repository](https://www.github.com/paritytech/srtool) only. The functionalities remain the same so you can (and should!) simply swap `chevdor/srtool` for `paritytech/srtool` in your workflows. The [srtool-actions](https://github.com/chevdor/srtool-actions) will remain available as `chevdor/srtool-actions@<version>` and will be updated to point at the paritytech image.
The last version hosted on Gitlab has been built using Rust Stable 1.73.0. It is tagged as v0.12.0 and there is no plan on updating the Gitlab repository further. New versions will be available from [this repository](https://www.github.com/paritytech/srtool) only. The functionalities remain the same so you can (and should!) simply swap `chevdor/srtool` for `paritytech/srtool` in your workflows. The [srtool-actions](https://github.com/chevdor/srtool-actions) will remain available as `chevdor/srtool-actions@<version>` and will be updated to point at the paritytech image.

## Install

Expand All @@ -67,7 +67,7 @@ This method is legacy and deprecated. It is recommended to use the `srtool-cli`

Creating an alias helps hiding the docker complexity behind one simple command. We will see more powerful options but this one is simple enough.

export RUSTC_VERSION=1.70.0; export PACKAGE=kusama-runtime; alias srtool='docker run --rm -it -e PACKAGE=$PACKAGE -v $PWD:/build -v $TMPDIR/cargo:/cargo-home paritytech/srtool:$RUSTC_VERSION'
export RUSTC_VERSION=1.73.0; export PACKAGE=kusama-runtime; alias srtool='docker run --rm -it -e PACKAGE=$PACKAGE -v $PWD:/build -v $TMPDIR/cargo:/cargo-home paritytech/srtool:$RUSTC_VERSION'

Note that defining the alias as done above will hardcode the runtime. Using `kusama-runtime` as shown above means you will **always** check the Kusama runtime. If you need more, check the next chapter.

Expand Down Expand Up @@ -95,9 +95,9 @@ Invoking `srtool build` with

will output something that looks like this:

🧰 Substrate Runtime Toolbox - srtool v0.11.1 🧰
🧰 Substrate Runtime Toolbox - srtool v0.12.0 🧰
- by Chevdor -
🏗 Building polkadot-runtime as release using rustc 1.70.0
🏗 Building polkadot-runtime as release using rustc 1.73.0
⏳ That can take a little while, be patient... subsequent builds will be faster.
Since you have to wait a little, you may want to learn more about Substrate runtimes:
https://docs.substrate.io/learn/architecture/
Expand All @@ -108,7 +108,7 @@ and finally …​

✨ Your Substrate WASM Runtime is ready! ✨
Summary:
Generator : srtool v0.11.1
Generator : srtool v0.12.0
Version : null
GIT commit : 56b9e95a9b634695f59a7c699bc68a5cfb695f03
GIT tag : moonriver-genesis
Expand Down Expand Up @@ -138,13 +138,13 @@ If you prefer a json output, srtool has you covered:
The output will look something like:

{
"gen": "srtool v0.11.1",
"gen": "srtool v0.12.0",
"src": "git",
"version": "1.0.0",
"commit": "85cad2ef48f123d7475385b00d113bc900324ad6",
"tag": "statemine-v1.0.0",
"branch": "wk-gh-actions",
"rustc": "rustc 1.70.0 (...)",
"rustc": "rustc 1.73.0 (...)",
"pkg": "statemine-runtime",
"tmsp": "2021-06-22T18:08:50Z",
"size": "1538747",
Expand All @@ -155,7 +155,7 @@ The output will look something like:
"info": {
"generator": {
"name": "srtool",
"version": "0.11.1"
"version": "0.12.0"
},
"src": "git",
"version": "1.0.0",
Expand All @@ -164,7 +164,7 @@ The output will look something like:
"tag": "statemine-v1.0.0",
"branch": "wk-gh-actions"
},
"rustc": "rustc 1.70.0 (...)",
"rustc": "rustc 1.73.0 (...)",
"pkg": "statemine-runtime",
"profile": "release"
},
Expand Down Expand Up @@ -305,7 +305,7 @@ You can see the list of available scripts in the `/scripts` folder:

- `scan`: Scan a repo for runtimes

The `info` and `version` scripts pass any arguments you pass to the script to `jq`. So you can play with `c` (compact), `-M` (monochrome), `-C` color output. For instance `docker run --rm -it -v $PWD:/build chevdor/srtool:1.70.0 info -cM` shows a monochrome output on a single line.
The `info` and `version` scripts pass any arguments you pass to the script to `jq`. So you can play with `c` (compact), `-M` (monochrome), `-C` color output. For instance `docker run --rm -it -v $PWD:/build chevdor/srtool:1.73.0 info -cM` shows a monochrome output on a single line.

## Build your custom chain / parachain

Expand Down Expand Up @@ -336,7 +336,7 @@ If you mount this docker volume, you will find the wasm on your local filesystem
# REPO=fellowship-runtimes
podman run --rm -it \
-v $REPO:/build \
`paritytech/srtool:1.70.0-0.11.1` scan
`paritytech/srtool:1.73.0-0.12.0` scan

## ZSH/ Zinit users

Expand Down Expand Up @@ -364,6 +364,6 @@ First you may want to double check what rustc versions are available as you will

rustup check

So say you want to build a builder for rustc 1.70.0:
So say you want to build a builder for rustc 1.73.0:

RUSTC_VERSION=1.70.0 && docker build --build-arg RUSTC_VERSION=$RUSTC_VERSION -t paritytech/srtool:$RUSTC_VERSION .
RUSTC_VERSION=1.73.0 && docker build --build-arg RUSTC_VERSION=$RUSTC_VERSION -t paritytech/srtool:$RUSTC_VERSION .
13 changes: 7 additions & 6 deletions README_src.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:name: paritytech/srtool
:rsversion: 1.70.0
:version: 0.11.1
:rsversion: 1.73.0
:version: 0.12.0
// :rsversion: pass:m[include:RUSTC_VERSION[]] // TODO: not working...
:toc: right
:sectnums:
Expand All @@ -11,19 +11,20 @@ image::resources/srtool-docker_128px.png[align=center, width=128px]

== Intro

`srtool` is a collection of dockerized tools helping with https://substrate.io[Substrate] & https://polkadot.network[Polkadot] Runtime development. `srtool` especially allows building WASM runtimes in a deterministic way, allowing CIs and users, with various machines and OS, to produce a strictly identical WASM runtime.
`srtool` is a collection of containerized tools helping with building WASM Runtimes for the
https://polkadot.network[Polkadot Network]. `srtool` especially allows building WASM runtimes in a
**deterministic** way, allowing CIs and users, with various machines and OS, to produce a strictly identical WASM runtime.

`srtool` can run on various Operating Systems supporting Docker. That includes Linux, MacOS and Windows.
`srtool` can run on various Operating Systems supporting Podman or Docker. That includes Linux, MacOS and Windows.

`srtool` especially helps with building and verifying WASM Runtimes. The Docker image is named `{name}`. You can find the project's repository at https://hub.docker.com/r/{name}.
`srtool` helps building and verifying WASM Runtimes. The Docker image is named `{name}`. You can find the project's repository at https://hub.docker.com/r/{name}.

== Docker image naming scheme

The Docker images are tagged with both the rustc version used internally as well as the version of the build script.

You may find for instance the following:

- `{name}:{rsversion}-0.9.19`
- `{name}:{rsversion}-{version}`
- `{name}:{rsversion}`

Expand Down
2 changes: 1 addition & 1 deletion RUSTC_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.70.0
1.73.0
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.11.1
0.12.0
6 changes: 3 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ build:
@echo Building $REPO:$RUSTC_VERSION
@echo If you encounter issues, try running `just cleanup` and try building again.
@echo Any arg you pass is forward to 'podman build'... You can pass'`--no-cache' for instance
podman build $@ --build-arg RUSTC_VERSION=$RUSTC_VERSION \
$ENGINE build $@ --build-arg RUSTC_VERSION=$RUSTC_VERSION \
-t $REGISTRY/chevdor/srtool:$RUSTC_VERSION-$TAG-$COMMIT \
-t $REGISTRY/$REPO:$RUSTC_VERSION-$TAG \
-t $REGISTRY/$REPO \
-t $REGISTRY/${REPO#*/} \
.
podman images | grep srtool
$ENGINE images | grep srtool

# Build and Publish the container image
publish: build
@echo Pushing podman image $REPO:$RUSTC_VERSION
podman push $REGISTRY/$REPO:$RUSTC_VERSION
$ENGINE push $REGISTRY/$REPO:$RUSTC_VERSION

# Set a git tag
tag:
Expand Down

0 comments on commit f5cc56b

Please sign in to comment.