Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build images with cached Fil proof params #6

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/publish-proof-containers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Build

on:
push:
branches:
- 'main'
tags:
- 'v*'
pull_request:

jobs:
build:
name: Containers
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
network-version:
- name: v28
lotus-commit: ad39d8707d9c8efa567cd4306140988930f1ef57
lotus-versions:
- v1.23.1
- v1.23.2
- v1.23.3
- v1.23.4-rc1
sector-size:
- '8388608'
platform:
- linux/amd64,linux/arm64
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
platforms: ${{ matrix.platform }}
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Lotus ${{ matrix.lotus-version }} Sector Size ${{ matrix.sector-size }}
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=raw,value=fil-proof-params-${{ matrix.lotus-version }}-${{ matrix.sector-size }}
- uses: actions/github-script@v6
with:
script: |
${{ matrix.network-version.lotus-versions }}.forEach((v) => console.log(`fil-proof-params-${v}-${{ matrix.sector-size }}`));
- name: Build image for Lotus ${{ matrix.lotus-version }} Sector Size ${{ matrix.sector-size }}
uses: docker/build-push-action@v4
with:
context: proof-params-cache
cache-from: type=gha
cache-to: type=gha,mode=max
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ matrix.platform }}
build-args: |
LOTUS_VERSION=${{ matrix.lotus-version }}
SECTOR_SIZE=${{ matrix.sector-size }}
17 changes: 17 additions & 0 deletions proof-params-cache/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM golang:1.20-bullseye as paramfetch

ARG LOTUS_VERSION
ARG SECTOR_SIZE

RUN go install github.com/filecoin-project/go-paramfetch/[email protected]

WORKDIR /go/src/lotus
RUN git clone --depth 1 --branch ${LOTUS_VERSION} https://github.com/filecoin-project/lotus .
ENV FIL_PROOFS_PARAMETER_CACHE=/filecoin-proof-parameters
RUN paramfetch ${SECTOR_SIZE} build/proof-params/parameters.json build/proof-params/srs-inner-product.json

FROM scratch
COPY --from=paramfetch /filecoin-proof-parameter/ /filecoin-proof-parameters/

# This image is meant to be used for copying proofs; not to run. hence the dummy entrypoint.
ENTRYPOINT ["false"]