Skip to content

Commit 6c24eaf

Browse files
committed
Build images with cached Fil proof params
Build docker images with already donwloaded filecoin proof params for well known sector sizes.
1 parent 2f86b1b commit 6c24eaf

File tree

3 files changed

+78
-0
lines changed

3 files changed

+78
-0
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
tags:
8+
- 'v*'
9+
pull_request:
10+
11+
jobs:
12+
build:
13+
name: Containers
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
lotus-version:
22+
- v1.23.1
23+
- v1.23.2
24+
- v1.23.3
25+
- v1.23.4-rc1
26+
sector-size:
27+
- '8388608'
28+
platform:
29+
- linux/amd64,linux/arm64
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v3
33+
- name: Set up QEMU
34+
uses: docker/setup-qemu-action@v2
35+
- name: Set up Docker Buildx
36+
uses: docker/setup-buildx-action@v2
37+
with:
38+
platforms: ${{ matrix.platform }}
39+
- name: Log in to the Container registry
40+
uses: docker/login-action@v2
41+
with:
42+
registry: ghcr.io
43+
username: ${{ github.actor }}
44+
password: ${{ secrets.GITHUB_TOKEN }}
45+
- name: Extract metadata for Lotus ${{ matrix.lotus-version }} Sector Size ${{ matrix.sector-size }}
46+
id: meta
47+
uses: docker/metadata-action@v4
48+
with:
49+
images: ghcr.io/${{ github.repository }}
50+
tags: |
51+
type=raw,value=fil-proof-params-${{ matrix.lotus-version }}-${{ matrix.sector-size }}
52+
- name: Build image for Lotus ${{ matrix.lotus-version }} Sector Size ${{ matrix.sector-size }}
53+
uses: docker/build-push-action@v4
54+
with:
55+
context: proof-params-cache
56+
cache-from: type=gha
57+
cache-to: type=gha,mode=max
58+
push: ${{ github.event_name != 'pull_request' }}
59+
tags: ${{ steps.meta.outputs.tags }}
60+
labels: ${{ steps.meta.outputs.labels }}
61+
platforms: ${{ matrix.platform }}
62+
build-args: |
63+
LOTUS_VERSION=${{ matrix.lotus-version }}
64+
SECTOR_SIZE=${{ matrix.sector-size }}

proof-params-cache/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM golang:1.20-bullseye as paramfetch
2+
3+
ARG LOTUS_VERSION
4+
ARG SECTOR_SIZE
5+
6+
RUN go install github.com/filecoin-project/go-paramfetch/[email protected]
7+
8+
WORKDIR /go/src/lotus
9+
RUN git clone --depth 1 --branch ${LOTUS_VERSION} https://github.com/filecoin-project/lotus .
10+
ENV FIL_PROOFS_PARAMETER_CACHE=/filecoin-proof-parameters
11+
RUN paramfetch ${SECTOR_SIZE} build/proof-params/parameters.json build/proof-params/srs-inner-product.json
12+
13+
FROM scratch
14+
COPY --from=paramfetch /filecoin-proof-parameter /filecoin-proof-parameters

0 commit comments

Comments
 (0)