Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into av/wasm-gen-recursions
Browse files Browse the repository at this point in the history
  • Loading branch information
StackOverflowExcept1on committed Oct 20, 2023
2 parents 1517c20 + 684cc76 commit fbb7208
Show file tree
Hide file tree
Showing 180 changed files with 4,074 additions and 9,800 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/CI-docker-gear.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: [kuberunner]
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v2
- uses: docker/setup-buildx-action@v3

- uses: actions/cache@v3
with:
Expand All @@ -25,7 +25,7 @@ jobs:
restore-keys: |
${{ runner.os }}-buildx-gear
- uses: docker/login-action@v2
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand All @@ -38,7 +38,7 @@ jobs:
echo "DOCKER_TAGS=ghcr.io/gear-tech/node:latest,ghcr.io/gear-tech/node:${{ env.RELEASE_VERSION }}" >> $GITHUB_ENV
fi
- uses: docker/build-push-action@v4
- uses: docker/build-push-action@v5
with:
file: ./docker/Dockerfile-release
push: true
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/Update-Vara-Prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ jobs:
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Vara-Dockerfile
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/Update-testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ jobs:
run: echo ${{ needs.tag-image.outputs.image_tag }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
Expand Down
19 changes: 5 additions & 14 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,10 @@ jobs:
- name: Run all benchmarks
run: |
./scripts/benchmarking/run_all_benchmarks.sh -c gear-dev -m
cp ./scripts/benchmarking/weights-output/* runtime/gear/src/weights
./scripts/benchmarking/run_all_benchmarks.sh -b -c vara-dev -m # -b to skip build
./scripts/benchmarking/run_all_benchmarks.sh -c vara-dev -m
cp ./scripts/benchmarking/weights-output/* runtime/vara/src/weights
# apply some patches for `pallets/gear/src/weights.rs`
cp runtime/gear/src/weights/pallet_gear.rs pallets/gear/src/weights.rs
cp runtime/vara/src/weights/pallet_gear.rs pallets/gear/src/weights.rs
sed -i -E 's/\w+::WeightInfo for SubstrateWeight/WeightInfo for SubstrateWeight/' pallets/gear/src/weights.rs
# clear the target directory because our benchmarking machine is not ephemeral
cargo clean
Expand All @@ -57,12 +55,6 @@ jobs:
path: scripts/benchmarking/benchmarking_errors.txt
if-no-files-found: ignore

- name: "ACTIONS: Upload artifact with updated weights (gear)"
uses: actions/upload-artifact@v3
with:
name: weights-gear
path: runtime/gear/src/weights/

- name: "ACTIONS: Upload artifact with updated weights (vara)"
uses: actions/upload-artifact@v3
with:
Expand All @@ -75,19 +67,18 @@ jobs:
- name: Create commit
if: ${{ inputs.change-type == 'commit' }}
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: >-
chore(runtime): update weights
file_pattern: "pallets/gear/src/ runtime/gear/src/weights/ runtime/vara/src/weights/"
file_pattern: "pallets/gear/src/ runtime/vara/src/weights/"

- name: Create Pull Request
if: ${{ inputs.change-type == 'pull_request' }}
uses: peter-evans/create-pull-request@v5
with:
add-paths: |
pallets/gear/src/
runtime/gear/src/weights/
runtime/vara/src/weights/
commit-message: update weights
branch: weights/patch
Expand All @@ -96,4 +87,4 @@ jobs:
chore(runtime): update weights
body: |
`run_all_benchmarks.sh` script is applied to update weights (branch: `${{ github.ref_name }}`, commit ${{ github.sha }})
**Note:** If CI fails, try manually updating the heuristic tests: `runtime/{gear, vara}/src/tests.rs`
**Note:** If CI fails, try manually updating the heuristic tests: `runtime/vara/src/tests.rs`
4 changes: 2 additions & 2 deletions .github/workflows/build-node-fuzzer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Log in to the github container registry
uses: docker/login-action@master
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ jobs:
- name: "Build fuzzer"
run: ./scripts/gear.sh build fuzz --locked --release

- name: "Check: Gear runtime imports"
run: ./target/release/wasm-proc --check-runtime-imports target/release/wbuild/gear-runtime/gear_runtime.compact.wasm

- name: "Check: Vara runtime imports"
run: ./target/release/wasm-proc --check-runtime-imports target/release/wbuild/vara-runtime/vara_runtime.compact.wasm

Expand Down Expand Up @@ -164,9 +161,6 @@ jobs:
cd target/wasm32-unknown-unknown/release
tar czvf ../../../artifact/examples.tar.gz *.wasm
cd ../../..
cp target/production/wbuild/gear-runtime/gear_runtime.compact.compressed.wasm artifact/
cp target/production/wbuild/gear-runtime/gear_runtime.compact.wasm artifact/
cp target/production/wbuild/gear-runtime/gear_runtime.wasm artifact/
cp target/production/wbuild/vara-runtime/vara_runtime.compact.compressed.wasm artifact/
cp target/production/wbuild/vara-runtime/vara_runtime.compact.wasm artifact/
cp target/production/wbuild/vara-runtime/vara_runtime.wasm artifact/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
steps:
- name: Cancel Previous Runs
if: ${{ github.event_name == 'pull_request' }}
uses: styfle/cancel-workflow-action@0.11.0
uses: styfle/cancel-workflow-action@0.12.0
with:
access_token: ${{ github.token }}

Expand Down
17 changes: 6 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ jobs:
- name: "Environment: Export versions"
run: |
echo "GEAR_SPEC=$(cat runtime/gear/src/lib.rs | grep "spec_version: " | awk -F " " '{print substr($2, 1, length($2)-1)}')" >> $GITHUB_ENV
echo "VARA_SPEC=$(cat runtime/vara/src/lib.rs | grep "spec_version: " | awk -F " " '{print substr($2, 1, length($2)-1)}')" >> $GITHUB_ENV
- name: "Environment: Make `artifact` directory"
Expand All @@ -79,27 +78,23 @@ jobs:
- name: "Build: Production `vara-runtime`"
run: cargo build -p vara-runtime --profile production --no-default-features --features std

- name: "Test: Production `vara-runtime`"
run: ./wasm-proc --check-runtime-imports target/production/wbuild/vara-runtime/vara_runtime.wasm

- name: "Artifact: Production `vara-runtime`"
run: cp target/production/wbuild/vara-runtime/vara_runtime.compact.compressed.wasm "artifact/vara_runtime_v$VARA_SPEC.wasm"

- name: "Build: Production node with development runtimes"
run: cargo build -p gear-cli --profile production

- name: "Test: Development runtimes"
run: |
./wasm-proc --check-runtime-imports target/production/wbuild/gear-runtime/gear_runtime.wasm
./wasm-proc --check-runtime-imports target/production/wbuild/vara-runtime/vara_runtime.wasm
- name: "Artifact: Production node and development runtimes"
- name: "Artifact: Production node client and development `vara-runtime`"
run: |
cp target/production/wbuild/gear-runtime/gear_runtime.compact.compressed.wasm "artifact/gear_devruntime_v$GEAR_SPEC.wasm"
cp target/production/wbuild/vara-runtime/vara_runtime.compact.compressed.wasm "artifact/vara_devruntime_v$VARA_SPEC.wasm"
cp target/production/gear artifact/gear
strip artifact/gear || true
- name: "Test: Runtimes"
run: |
./wasm-proc --check-runtime-imports --check-runtime-is-dev false "artifact/vara_runtime_v$VARA_SPEC.wasm"
./wasm-proc --check-runtime-imports --check-runtime-is-dev true "artifact/vara_devruntime_v$VARA_SPEC.wasm"
- name: Publish
uses: softprops/action-gh-release@v1
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ jobs:
run: echo ${{ needs.tag-image.outputs.image_tag }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
Expand Down
Loading

0 comments on commit fbb7208

Please sign in to comment.