Files
linea-monorepo/.github/workflows/prover-build-and-publish.yml
Leo Jeong a3972f3baa Prover: go-corset as submodule (#759)
* feat(go-corset): go-corset as submodule (#743)

* remove corset submodule

* add go-corset submodule

* use go-corst in Makefile

* use go-corset v0.9.2

* update go-corset submodule url

* fix(go-corset): typo in submodule url

* fix: use go-corset instead of corset

* add zkevm_for_old_trace.bin without 2B block gas limit constraint to test old traces

---------

Signed-off-by: Leo Jeong <dreamerty@postech.ac.kr>
2025-03-07 16:02:09 +09:00

134 lines
4.3 KiB
YAML

name: Prover build and publish CI
on:
workflow_call:
inputs:
commit_tag:
required: true
type: string
develop_tag:
required: true
type: string
image_name:
required: true
type: string
push_image:
required: false
type: boolean
default: false
secrets:
DOCKERHUB_USERNAME:
required: false
DOCKERHUB_TOKEN:
required: false
workflow_dispatch:
inputs:
commit_tag:
description: 'Image tag'
required: true
type: string
develop_tag:
description: 'Image tag will be "develop" if target branch is main'
required: true
type: choice
options:
- develop
default: 'develop'
image_name:
description: 'Image name'
required: true
type: string
default: 'consensys/linea-prover'
push_image:
description: 'Toggle whether to push image to docker registry'
required: false
type: boolean
default: true
concurrency:
group: prover-build-and-publish-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
env:
GOPROXY: "https://proxy.golang.org"
jobs:
build-and-publish:
# ~1 min saved vs small
runs-on: gha-runner-scale-set-ubuntu-22.04-amd64-med
name: Prover build
env:
COMMIT_TAG: ${{ inputs.commit_tag }}
DEVELOP_TAG: ${{ inputs.develop_tag }}
IMAGE_NAME: ${{ inputs.image_name }}
PUSH_IMAGE: ${{ inputs.push_image }}
TAGS: ${{ inputs.image_name }}:${{ inputs.commit_tag }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
steps:
- name: Set develop tag if main branch
if: ${{ github.ref == 'refs/heads/main' }}
run: |
echo "TAGS=${{ env.IMAGE_NAME }}:${{ env.COMMIT_TAG }},${{ env.IMAGE_NAME }}:${{ env.DEVELOP_TAG }}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Login to Docker Hub
if: ${{ env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != '' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Show the "version" build argument
run: |
echo "We inject the commit tag in the docker image ${{ env.COMMIT_TAG }}"
echo COMMIT_TAG=${{ env.COMMIT_TAG }} >> $GITHUB_ENV
- name: Build and push prover image
uses: docker/build-push-action@v6
if: ${{ env.PUSH_IMAGE == 'false' }}
with:
context: .
file: ./prover/Dockerfile
build-args: |
RUSTFLAGS="-C target-cpu=x86-64-v3"
build-contexts: |
prover=prover/
go-corset=go-corset/
constraints=constraints/
platforms: linux/amd64
load: true
push: false
tags: ${{ env.IMAGE_NAME }}:${{ env.COMMIT_TAG }}
- name: Save Docker image as artifact
if: ${{ env.PUSH_IMAGE == 'false' }}
run: |
docker save ${{ env.IMAGE_NAME }}:${{ env.COMMIT_TAG }} | gzip > linea-prover-docker-image.tar.gz
shell: bash
- name: Upload Docker image artifact
if: ${{ env.PUSH_IMAGE == 'false' }}
uses: actions/upload-artifact@v4
with:
name: linea-prover
path: linea-prover-docker-image.tar.gz
- name: Build and push prover image
uses: docker/build-push-action@v6
if: ${{ env.PUSH_IMAGE == 'true' || github.event_name == 'workflow_dispatch' }}
with:
context: .
file: ./prover/Dockerfile
build-args: |
RUSTFLAGS="-C target-cpu=x86-64-v3"
build-contexts: |
prover=prover/
go-corset=go-corset/
constraints=constraints/
platforms: linux/amd64
load: false
push: true
tags: ${{ env.TAGS }}
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max