Skip to content

Commit

Permalink
Feature/upgrades (#811)
Browse files Browse the repository at this point in the history
  • Loading branch information
vanderian authored Sep 25, 2024
1 parent 5b4d271 commit c2529bb
Show file tree
Hide file tree
Showing 77 changed files with 3,547 additions and 3,866 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:
id-token: write
runs-on: [compile-gke]
container:
image: mangatasolutions/node-builder:multi-nightly-2023-05-22
image: mangatasolutions/node-builder:multi-1.77-nightly-2024-01-20
env:
JOB_CACHE_PREFIX: node-docs-cache-1
CACHE_ARCHIVE_NAME: cache_archive.tar.zst
steps:
- uses: actions/checkout@v4

- uses: google-github-actions/auth@v2
id: auth
with:
Expand All @@ -32,25 +32,25 @@ jobs:
CACHE_KEY="${{ env.JOB_CACHE_PREFIX }}-${{ hashFiles('**/Cargo.lock') }}"
ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}"
CACHE_FOUND=false
if gcloud storage cp "gs://mangata-node-ci-cache/$CACHE_KEY/$ARCHIVE_NAME" - | zstd -d | tar -xf - -C / ; then
if gcloud storage cp "gs://mangata-node-ci-cache/$CACHE_KEY/$ARCHIVE_NAME" - | zstd -d | tar -xf - -C / ; then
CACHE_FOUND=true
fi
echo "cache_found=$CACHE_FOUND" >> $GITHUB_OUTPUT
echo "cache_key=$CACHE_KEY" >> $GITHUB_OUTPUT
- uses: mozilla-actions/sccache-action@v0.0.5
- run: |
echo "SCCACHE_GCS_BUCKET=mangata-node-ci-cache" >> $GITHUB_ENV
echo "SCCACHE_GCS_RW_MODE=READ_WRITE" >> $GITHUB_ENV
echo "SCCACHE_GCS_KEY_PREFIX=${{ env.JOB_CACHE_PREFIX }}" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV
- name: Build docs
run: cargo doc

- name: Deploy to GCP
uses: google-github-actions/upload-cloud-storage@v2.1.0
with:
Expand All @@ -59,7 +59,7 @@ jobs:
parent: false
concurrency: 50
process_gcloudignore: false

- name: Upload cargo build cache
shell: bash
run: |
Expand All @@ -73,9 +73,9 @@ jobs:
"/usr/local/cargo/registry/cache/"
"/usr/local/cargo/git/db/"
)
SECONDS=0; tar -cf - "${CACHE_PATHS[@]}" | zstd -T0 -5 > "$ARCHIVE_NAME"
echo "Compression completed in $SECONDS seconds" && echo "Archive size: $(du -h "$ARCHIVE_NAME" | cut -f1)"
SECONDS=0; gcloud storage cp "$ARCHIVE_NAME" "gs://mangata-node-ci-cache/$CACHE_KEY/$ARCHIVE_NAME"
echo "Upload completed in $SECONDS seconds"
echo "Upload completed in $SECONDS seconds"
23 changes: 11 additions & 12 deletions .github/workflows/reusable-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
required: true
type: string
builder_image:
default: mangatasolutions/node-builder:multi-nightly-2023-05-22
default: mangatasolutions/node-builder:multi-1.77-nightly-2024-01-20
description: Docker image used for Rust builds
required: false
type: string
Expand Down Expand Up @@ -198,21 +198,21 @@ jobs:
platforms: linux/${{ matrix.platform.name }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ env.NODE_DOCKER_IMAGE_REPOSITORY }},push-by-digest=true,name-canonical=true,push=true

- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: fast-digests-linux-${{ matrix.platform.name }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1

- name: Upload cargo build cache
if: inputs.cache-enabled && steps.cache.outputs.cache_found == 'false'
shell: bash
Expand Down Expand Up @@ -280,7 +280,7 @@ jobs:
with:
name: wasm-${{ inputs.version }}
path: ./rollup_runtime-${{ inputs.version }}.compact.compressed.wasm

create-fast-docker-image-manifest-and-export-wasms:
name: Generate multiplatform Docker image manifest for fast runtime image
needs: [build-node-image-with-fast-runtime]
Expand All @@ -292,10 +292,10 @@ jobs:
path: /tmp/digests
pattern: fast-digests-*
merge-multiple: true

- uses: docker/setup-buildx-action@v3
- run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
Expand All @@ -304,28 +304,27 @@ jobs:
tags: |
type=raw,value=${{ inputs.version }}-fast
type=raw,value=${{ inputs.branch }}-fast
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.NODE_DOCKER_IMAGE_REPOSITORY }}@sha256:%s ' *)
- name: Inspect image
run: docker buildx imagetools inspect ${{ env.NODE_DOCKER_IMAGE_REPOSITORY }}:${{ steps.meta.outputs.version }}

- name: Export WASM artifacts from built images
run: |
# Export WASM artifact from image with fast runtime
container_id_fast=$(docker create ${{ env.NODE_DOCKER_IMAGE_REPOSITORY }}:${{ inputs.version }}-fast) && \
docker cp $container_id_fast:/app/rollup_runtime.compact.compressed.wasm ./rollup_runtime-${{ inputs.version }}-fast.compact.compressed.wasm && \
docker rm $container_id_fast
- uses: actions/upload-artifact@v3
with:
name: wasm-fast-${{ inputs.version }}
path: ./rollup_runtime-${{ inputs.version }}-fast.compact.compressed.wasm

rustfmt-check:
name: Formatting check
runs-on: ubuntu-latest
Expand Down
Loading

0 comments on commit c2529bb

Please sign in to comment.