Skip to content

Commit

Permalink
chore: add fflonk setup key for proof-fri-gpu-compressor (#3426)
Browse files Browse the repository at this point in the history
## What ❔
Add fflonk key for proof fri GPU compressor

## Why ❔
New version require it

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [x] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [x] Tests for the changes have been added / updated.
- [x] Documentation comments have been added / updated.
- [x] Code has been formatted via `zkstack dev fmt` and `zkstack dev
lint`.
  • Loading branch information
otani88 authored Jan 8, 2025
1 parent 2c778fd commit 1000f61
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/build-docker-from-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,13 @@ jobs:
setup_keys_id: ${{ needs.setup.outputs.prover_fri_gpu_key_id }}
image_tag_suffix: ${{ needs.setup.outputs.image_tag_suffix }}
protocol_version: ${{ needs.build-push-prover-images.outputs.protocol_version }}

build-gar-proof-fri-gpu-compressor-gar:
name: Build GAR prover FRI GPU
needs: [setup, build-push-prover-images]
uses: ./.github/workflows/build-proof-fri-gpu-compressor-gar.yml
if: contains(github.ref_name, 'prover')
with:
setup_keys_id: ${{ needs.setup.outputs.prover_fri_gpu_key_id }}
image_tag_suffix: ${{ needs.setup.outputs.image_tag_suffix }}
protocol_version: ${{ needs.build-push-prover-images.outputs.protocol_version }}
71 changes: 71 additions & 0 deletions .github/workflows/build-proof-fri-gpu-compressor-gar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Build Proof FRI GPU Compressor with builtin setup fflonk key

on:
workflow_call:
inputs:
image_tag_suffix:
description: "Commit sha or git tag for Docker tag"
required: true
type: string
setup_keys_id:
description: "Commit sha for downloading setup data from bucket dir"
required: true
type: string
protocol_version:
description: "Protocol version to be included in the images tag"
required: true
type: string

jobs:
build:
name: Build proof FRI GPU Compressor gar
runs-on: [matterlabs-ci-runner-high-performance]
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
with:
submodules: "recursive"

- name: Download FFLONK key and setup data
run: |
gsutil -m rsync -r gs://matterlabs-setup-keys-us/setup-keys/setup_fflonk_compact.key docker/proof-fri-gpu-compressor-gar
gsutil -m rsync -r gs://matterlabs-setup-data-us/${{ inputs.setup_keys_id }} docker/proof-fri-gpu-compressor-gar
- name: Login to us-central1 GAR
run: |
gcloud auth print-access-token --lifetime=7200 --impersonate-service-account=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com | docker login -u oauth2accesstoken --password-stdin https://us-docker.pkg.dev
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1

- name: Login to Asia GAR
run: |
gcloud auth print-access-token --lifetime=7200 --impersonate-service-account=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com | docker login -u oauth2accesstoken --password-stdin https://asia-docker.pkg.dev
- name: Login to Europe GAR
run: |
gcloud auth print-access-token --lifetime=7200 --impersonate-service-account=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com | docker login -u oauth2accesstoken --password-stdin https://europe-docker.pkg.dev
- name: Build and push proof-fri-gpu-compressor-gar
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: docker/proof-fri-gpu-compressor-gar
build-args: |
PROOF_COMPRESSOR_IMAGE=${{ inputs.protocol_version }}-${{ inputs.image_tag_suffix }}
push: true
tags: |
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/proof-fri-gpu-compressor-gar:2.0-${{ inputs.protocol_version }}-${{ inputs.image_tag_suffix }}
- name: Build and push prover-gpu-fri-gar to Asia GAR
run: |
docker buildx imagetools create \
--tag asia-docker.pkg.dev/matterlabs-infra/matterlabs-docker/proof-fri-gpu-compressor-gar:2.0-${{ inputs.protocol_version }}-${{ inputs.image_tag_suffix }} \
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/proof-fri-gpu-compressor-gar:2.0-${{ inputs.protocol_version }}-${{ inputs.image_tag_suffix }}
- name: Build and push prover-gpu-fri-gar to Europe GAR
run: |
docker buildx imagetools create \
--tag europe-docker.pkg.dev/matterlabs-infra/matterlabs-docker/proof-fri-gpu-compressor-gar:2.0-${{ inputs.protocol_version }}-${{ inputs.image_tag_suffix }} \
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/proof-fri-gpu-compressor-gar:2.0-${{ inputs.protocol_version }}-${{ inputs.image_tag_suffix }}
10 changes: 10 additions & 0 deletions .github/workflows/release-test-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,13 @@ jobs:
setup_keys_id: ${{ needs.setup.outputs.prover_fri_gpu_key_id }}
image_tag_suffix: ${{ needs.setup.outputs.image_tag_suffix }}
protocol_version: ${{ needs.build-push-prover-images.outputs.protocol_version }}

build-gar-proof-fri-gpu-compressor-gar:
name: Build GAR proof FRI GPU compressor
needs: [setup, build-push-prover-images]
uses: ./.github/workflows/build-proof-fri-gpu-compressor-gar.yml
if: needs.changed_files.outputs.prover == 'true' || needs.changed_files.outputs.all == 'true'
with:
setup_keys_id: ${{ needs.setup.outputs.prover_fri_gpu_key_id }}
image_tag_suffix: ${{ needs.setup.outputs.image_tag_suffix }}
protocol_version: ${{ needs.build-push-prover-images.outputs.protocol_version }}
21 changes: 21 additions & 0 deletions docker/proof-fri-gpu-compressor-gar/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ARG PROOF_COMPRESSOR_IMAGE
FROM us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/proof-fri-gpu-compressor:2.0-$PROOF_COMPRESSOR_IMAGE as proof_fri_gpu
FROM nvidia/cuda:12.4.0-runtime-ubuntu22.04 as app

# HACK copying to root is the only way to make Docker layer caching work for these files for some reason
COPY *.bin /
COPY ./setup_fflonk_compact.key /setup_fflonk_compact.key

RUN apt-get update && apt-get install -y curl libpq5 ca-certificates && rm -rf /var/lib/apt/lists/*


# copy finalization hints required for assembly generation
COPY --from=proof_fri_gpu /setup_2\^24.key /setup_2\^24.key
COPY --from=proof_fri_gpu /prover/data/keys/ /prover/data/keys/
COPY --from=proof_fri_gpu /usr/bin/zksync_proof_fri_compressor /usr/bin/

ENV CRS_FILE=/setup_2\^24.key
ENV COMPACT_CRS_FILE=/setup_fflonk_compact.key


ENTRYPOINT ["zksync_proof_fri_compressor"]

0 comments on commit 1000f61

Please sign in to comment.