Skip to content

Build from Lotus v1.23.3 Boost v1.7.5 #25

Build from Lotus v1.23.3 Boost v1.7.5

Build from Lotus v1.23.3 Boost v1.7.5 #25

name: Build Filecoin FVM Localnet Docker Images
run-name: Build from Lotus ${{ inputs.lotus_tag }} Boost ${{ inputs.boost_tag }}
on:
workflow_dispatch:
inputs:
lotus_tag:
description: Lotus Tag
default: v1.23.3
boost_tag:
description: Boost Tag
default: v1.7.5
env:
REGISTRY: ghcr.io
NAMESPACE: ${{ github.repository_owner }}
IMAGE_NAME: filecoin-fvm-localnet
BOOST_IMAGE_NAME: boost-localnet-multiarch
BOOST_TAG: ${{ inputs.boost_tag }}
LOTUS_IMAGE_NAME: lotus-localnet-multiarch
LOTUS_TAG: ${{ inputs.lotus_tag }}
jobs:
build-lotus-image:
name: Build Lotus ${{ inputs.lotus_tag }}
runs-on: ubuntu-latest-4-cores
permissions:
contents: write
packages: write
actions: write
outputs:
digest: ${{ steps.build.outputs.digest }}
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
repository: filecoin-project/lotus
ref: ${{ env.LOTUS_TAG }}
submodules: recursive
- name: Patch Lotus
run: curl https://raw.githubusercontent.com/filecoin-project/filecoin-fvm-localnet/main/lotus.patch | patch -p1
- name: Setup Docker Buildx
uses: docker/[email protected]
- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta_lotus_dev
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.LOTUS_IMAGE_NAME }}
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Build and push
id: build
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64, linux/arm64
file: Dockerfile
build-args: |
GOFLAGS=-tags=2k
target: lotus-all-in-one
push: true
tags: ${{ steps.meta_lotus_dev.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Summary
env:
image_name: ${{ fromJSON(steps.build.outputs.metadata)['image.name'] }}
run: |
echo "### Lotus: ${{ env.LOTUS_TAG }}" >> $GITHUB_STEP_SUMMARY
echo "Image name(s): $image_name" >> $GITHUB_STEP_SUMMARY
build-boost-image:
name: Build Boost ${{ inputs.boost_tag }}
runs-on: ubuntu-latest-4-cores
needs: [build-lotus-image]
permissions:
contents: write
packages: write
actions: write
outputs:
digest: ${{ steps.build.outputs.digest }}
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
repository: filecoin-project/boost
ref: ${{ env.BOOST_TAG }}
submodules: recursive
- name: Patch Boost
run: curl https://raw.githubusercontent.com/filecoin-project/filecoin-fvm-localnet/main/boost.patch | patch -p1
- name: Setup Docker Buildx
uses: docker/[email protected]
- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.BOOST_IMAGE_NAME }}
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Build and push image
id: build
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64, linux/arm64
file: docker/devnet/Dockerfile.source
build-args: |
BUILD_VERSION=dev
LOTUS_TEST_IMAGE=${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.LOTUS_IMAGE_NAME }}@${{ needs['build-lotus-image'].outputs.digest }}
target: builder
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Summary
env:
image_name: ${{ fromJSON(steps.build.outputs.metadata)['image.name'] }}
run: |
echo "### Boost: ${{ env.BOOST_TAG }}" >> $GITHUB_STEP_SUMMARY
echo "Image name(s): $image_name" >> $GITHUB_STEP_SUMMARY
build-base-image:
name: Build FVM Localnet image
runs-on: ubuntu-latest-4-cores
needs: [build-lotus-image, build-boost-image]
permissions:
contents: write
packages: write
actions: write
outputs:
digest: ${{ steps.build.outputs.digest }}
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
repository: ''
submodules: recursive
- name: Setup Docker Buildx
uses: docker/[email protected]
- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Build and push
id: build
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64, linux/arm64
file: Dockerfile
target: runner
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
LOTUS_LOCALNET_MULTIARCH_IMAGE=${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.LOTUS_IMAGE_NAME }}@${{ needs['build-lotus-image'].outputs.digest }}
BOOST_LOCALNET_MULTIARCH_IMAGE=${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.BOOST_IMAGE_NAME }}@${{ needs['build-boost-image'].outputs.digest }}
- name: Summary
env:
image_name: ${{ fromJSON(steps.build.outputs.metadata)['image.name'] }}
run: |
echo "### FVM Localnet: Lotus: ${{ env.LOTUS_TAG }} Boost: ${{ env.BOOST_TAG }}" >> $GITHUB_STEP_SUMMARY
echo "Image name(s): $image_name" >> $GITHUB_STEP_SUMMARY
build-2k-prepopulated-image:
name: Build 2k Pre-populated FVM Localnet image
runs-on: ubuntu-latest-4-cores
needs: [build-base-image]
permissions:
contents: write
packages: write
actions: write
outputs:
digest: ${{ steps.build2k.outputs.digest }}
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
repository: ''
submodules: recursive
- name: Setup Docker Buildx
uses: docker/[email protected]
- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta 2k
id: meta2k
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}-preproofs-2k
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Build and push 2k
id: build2k
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64, linux/arm64
file: Dockerfile
target: filecoin-fvm-localnet-preproofs-2k
push: true
tags: ${{ steps.meta2k.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
FILECOIN_FVM_LOCALNET_IMAGE=${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}@${{ needs['build-base-image'].outputs.digest }}
- name: Summary
env:
image_name: ${{ fromJSON(steps.build2k.outputs.metadata)['image.name'] }}
run: |
echo "### FVM Localnet 2k Prepopulated: Lotus: ${{ env.LOTUS_TAG }} Boost: ${{ env.BOOST_TAG }}" >> $GITHUB_STEP_SUMMARY
echo "Image name(s): $image_name" >> $GITHUB_STEP_SUMMARY
build-8m-prepopulated-image:
name: Build 8M Pre-populated FVM Localnet image
runs-on: ubuntu-latest-4-cores
needs: [build-base-image]
permissions:
contents: write
packages: write
actions: write
outputs:
digest: ${{ steps.build8m.outputs.digest }}
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
repository: ''
submodules: recursive
- name: Setup Docker Buildx
uses: docker/[email protected]
- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta 8m
id: meta8m
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}-preproofs-8m
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Build and push 8m
id: build8m
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64, linux/arm64
file: Dockerfile
target: filecoin-fvm-localnet-preproofs-8m
push: true
tags: ${{ steps.meta8m.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
FILECOIN_FVM_LOCALNET_IMAGE=${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}@${{ needs['build-base-image'].outputs.digest }}
- name: Summary
env:
image_name: ${{ fromJSON(steps.build8m.outputs.metadata)['image.name'] }}
run: |
echo "### FVM Localnet 8M Prepopulated: Lotus: ${{ env.LOTUS_TAG }} Boost: ${{ env.BOOST_TAG }}" >> $GITHUB_STEP_SUMMARY
echo "Image name(s): $image_name" >> $GITHUB_STEP_SUMMARY