Skip to content

Commit 9a43315

Browse files
authored
feat: update docker devnet build (#1702)
* update makefile, remove lotus container build * multiplatform build * cleanup * fix lotus image name * update readme * pull boost images * clarify build_boost
1 parent 0278a9b commit 9a43315

File tree

3 files changed

+64
-33
lines changed

3 files changed

+64
-33
lines changed

.github/workflows/container-build.yml

+10-22
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,22 @@ jobs:
1616
contents: read
1717
packages: write
1818
env:
19-
LOTUS_TEST_IMAGE: 'filecoin/lotus-all-in-one:v1.23.2'
19+
LOTUS_VERSION: 'v1.23.3'
20+
LOTUS_SOURCE_IMAGE: 'ghcr.io/filecoin-shipyard/lotus-containers:lotus'
21+
NETWORK_NAME: 'devnet'
2022
FFI_BUILD_FROM_SOURCE: '0'
2123
DOCKER_BUILDKIT: '1'
2224
steps:
2325
- name: Checkout
2426
uses: actions/checkout@v3
2527
- name: Update Boost modules
2628
run: make build/.update-modules
29+
- name: Set up QEMU
30+
uses: docker/setup-qemu-action@v3
2731
- name: Set up Docker Buildx
2832
uses: docker/setup-buildx-action@v2
33+
with:
34+
platforms: linux/amd64,linux/arm64
2935
- name: Log in to the Container registry
3036
uses: docker/login-action@v2
3137
if: ${{ github.event_name != 'pull_request' }}
@@ -41,7 +47,7 @@ jobs:
4147
target: boost-dev
4248
push: ${{ github.event_name != 'pull_request' }}
4349
build-args: |
44-
LOTUS_TEST_IMAGE=${{ env.LOTUS_TEST_IMAGE }}
50+
LOTUS_TEST_IMAGE=${{ env.LOTUS_SOURCE_IMAGE }}-${{ env.LOTUS_VERSION }}-${{ env.NETWORK_NAME }}
4551
FFI_BUILD_FROM_SOURCE=${{ env.FFI_BUILD_FROM_SOURCE }}
4652
- name: Build booster-http-dev
4753
uses: ./.github/actions/container-builder
@@ -51,7 +57,7 @@ jobs:
5157
target: booster-http-dev
5258
push: ${{ github.event_name != 'pull_request' }}
5359
build-args: |
54-
LOTUS_TEST_IMAGE=${{ env.LOTUS_TEST_IMAGE }}
60+
LOTUS_TEST_IMAGE=${{ env.LOTUS_SOURCE_IMAGE }}-${{ env.LOTUS_VERSION }}-${{ env.NETWORK_NAME }}
5561
FFI_BUILD_FROM_SOURCE=${{ env.FFI_BUILD_FROM_SOURCE }}
5662
- name: Build booster-bitswap-dev
5763
uses: ./.github/actions/container-builder
@@ -61,23 +67,5 @@ jobs:
6167
target: booster-bitswap-dev
6268
push: ${{ github.event_name != 'pull_request' }}
6369
build-args: |
64-
LOTUS_TEST_IMAGE=${{ env.LOTUS_TEST_IMAGE }}
65-
FFI_BUILD_FROM_SOURCE=${{ env.FFI_BUILD_FROM_SOURCE }}
66-
- name: Build lotus-dev
67-
uses: ./.github/actions/container-builder
68-
with:
69-
name: lotus-dev
70-
context: ./docker/devnet/lotus
71-
push: ${{ github.event_name != 'pull_request' }}
72-
build-args: |
73-
LOTUS_TEST_IMAGE=${{ env.LOTUS_TEST_IMAGE }}
70+
LOTUS_TEST_IMAGE=${{ env.LOTUS_SOURCE_IMAGE }}-${{ env.LOTUS_VERSION }}-${{ env.NETWORK_NAME }}
7471
FFI_BUILD_FROM_SOURCE=${{ env.FFI_BUILD_FROM_SOURCE }}
75-
- name: Build lotus-miner-dev
76-
uses: ./.github/actions/container-builder
77-
with:
78-
name: lotus-miner-dev
79-
context: ./docker/devnet/lotus-miner
80-
push: ${{ github.event_name != 'pull_request' }}
81-
build-args: |
82-
LOTUS_TEST_IMAGE=${{ env.LOTUS_TEST_IMAGE }}
83-
FFI_BUILD_FROM_SOURCE=${{ env.FFI_BUILD_FROM_SOURCE }}

Makefile

+52-5
Original file line numberDiff line numberDiff line change
@@ -217,19 +217,32 @@ docsgen-openrpc-boost: docsgen-openrpc-bin
217217

218218
## DOCKER IMAGES
219219
docker_user?=filecoin
220-
lotus_version?=v1.23.2
220+
lotus_version?=v1.23.3
221221
ffi_from_source?=0
222222
build_lotus?=0
223+
build_boost?=1
224+
boost_version?=v2.1.0-rc1
225+
ifeq ($(build_boost),1)
226+
#v1: build boost images currently checked out branch
227+
boost_build_cmd=docker/boost
228+
booster_http_build_cmd=docker/booster-http
229+
booster_bitswap_build_cmd=docker/booster-bitswap
230+
else
231+
# v2: pull images from the github repo
232+
boost_build_cmd=pull/boost retag/boost
233+
booster_http_build_cmd=pull/booster-http retag/booster-http
234+
booster_bitswap_build_cmd=pull/booster-bitswap retag/booster-bitswap
235+
endif
223236
ifeq ($(build_lotus),1)
224237
# v1: building lotus image with provided lotus version
225238
lotus_info_msg=!!! building lotus base image from github: branch/tag $(lotus_version) !!!
226239
override lotus_src_dir=/tmp/lotus-$(lotus_version)
227240
lotus_build_cmd=update/lotus docker/lotus-all-in-one
228241
lotus_base_image=$(docker_user)/lotus-all-in-one:$(lotus_version)-debug
229242
else
230-
# v2 (default): using lotus image
231-
lotus_base_image?=$(docker_user)/lotus-all-in-one:$(lotus_version)-debug
232-
lotus_info_msg=using lotus image from dockerhub: $(lotus_base_image)
243+
# v2 (default): using prebuilt lotus image
244+
lotus_base_image?=ghcr.io/filecoin-shipyard/lotus-containers:lotus-$(lotus_version)-devnet
245+
lotus_info_msg=using lotus image from github: $(lotus_base_image)
233246
lotus_build_cmd=info/lotus-all-in-one
234247
endif
235248
docker_build_cmd=docker build --build-arg LOTUS_TEST_IMAGE=$(lotus_base_image) \
@@ -250,6 +263,30 @@ docker/lotus-all-in-one: info/lotus-all-in-one | $(lotus_src_dir)
250263
-t $(lotus_base_image) --build-arg GOFLAGS=-tags=debug .
251264
.PHONY: docker/lotus-all-in-one
252265

266+
pull/boost:
267+
docker pull ghcr.io/filecoin-project/boost:boost-dev-$(boost_version)
268+
.PHONY: pull/boost
269+
270+
pull/booster-http:
271+
docker pull ghcr.io/filecoin-project/boost:boost-http-dev-$(boost_version)
272+
.PHONY: pull/boost
273+
274+
pull/booster-bitswap:
275+
docker pull ghcr.io/filecoin-project/boost:boost-bitswap-dev-$(boost_version)
276+
.PHONY: pull/boost
277+
278+
retag/boost:
279+
docker tag ghcr.io/filecoin-project/boost:boost-dev-$(boost_version) $(docker_user)/boost-dev:dev
280+
.PHONY: retag/boost
281+
282+
retag/booster-http:
283+
docker tag ghcr.io/filecoin-project/boost:boost-http-dev-$(boost_version) $(docker_user)/booster-http-dev:dev
284+
.PHONY: retag/booster-http
285+
286+
retag/booster-bitswap:
287+
docker tag ghcr.io/filecoin-project/boost:boost-bitswap-dev-$(boost_version) $(docker_user)/booster-bitswap-dev:dev
288+
.PHONY: retag/booster-bitswap
289+
253290
# boost-client main
254291
docker/mainnet/boost-client: build/.update-modules
255292
DOCKER_BUILDKIT=1 $(docker_build_cmd) \
@@ -276,10 +313,20 @@ docker/booster-bitswap:
276313
-t $(docker_user)/booster-bitswap-dev:dev --build-arg BUILD_VERSION=dev \
277314
-f docker/devnet/Dockerfile.source --target booster-bitswap-dev .
278315
.PHONY: docker/booster-bitswap
279-
docker/all: $(lotus_build_cmd) docker/boost docker/booster-http docker/booster-bitswap \
316+
docker/all: $(lotus_build_cmd) $(boost_build_cmd) $(booster_http_build_cmd) $(booster_bitswap_build_cmd) \
280317
docker/lotus docker/lotus-miner
281318
.PHONY: docker/all
282319

320+
### To allow devs to pull individual images. Require build_boost=0 and boost_version to be supplied
321+
docker/get-boost: $(boost_build_cmd)
322+
.PHONY: docker/get-boost
323+
324+
docker/get-booster-http: $(booster_http_build_cmd)
325+
.PHONY: docker/get-booster-http
326+
327+
docker/get-booster-bitswap: $(booster_bitswap_build_cmd)
328+
.PHONY: docker/get-booster-http
329+
283330
test-lid:
284331
cd ./extern/boostd-data && ARCH=$(ARCH) docker-compose up --build --exit-code-from go-tests
285332

README.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,8 @@ Compile and install using the instructions at the `Building and installing` sect
2828
make clean docker/all
2929
```
3030

31-
On ARM-based systems (*Apple M1/M2*) you need to force building Filecoin's Rust libraries from the source
32-
```
33-
make clean docker/all ffi_from_source=1 build_lotus=1
34-
```
35-
36-
If you need to build containers using a specific version of lotus then provide the version as a parameter, e.g. `make clean docker/all lotus_version=v1.20.0-rc2 build_lotus=1`. The version must be a tag or a remote branch name of [Lotus git repo](https://github.com/filecoin-project/lotus).
31+
If you need to build containers using a specific version of lotus then provide the version as a parameter, e.g. `make clean docker/all lotus_version=v1.23.3`. The version must be a tag or a remote branch name of [Lotus git repo](https://github.com/filecoin-project/lotus).
32+
If the branch or tag you requested does not exist in our [Github image repository](https://github.com/filecoin-shipyard/lotus-containers/pkgs/container/lotus-containers) then you can build the lotus image manually with `make clean docker/all lotus_version=test/branch1 build_lotus=1`. We are shipping images all releases from Lotus in our [Github image repo](https://github.com/filecoin-shipyard/lotus-containers/pkgs/container/lotus-containers).
3733

3834
### Start devnet Docker stack
3935

0 commit comments

Comments
 (0)