Skip to content

Commit 214226e

Browse files
authored
feat: devnet with market and deal client (#379)
* devnet with market * update circleci check * please the linter gods * add ipni node * fix PieceLocator url
1 parent 9ec0a6f commit 214226e

File tree

32 files changed

+2626
-63
lines changed

32 files changed

+2626
-63
lines changed

.circleci/config.yml

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ executors:
77
golang:
88
docker:
99
# Must match GO_VERSION_MIN in project root
10-
- image: cimg/go:1.22.8
10+
- image: cimg/go:1.23
1111
resource_class: medium+
1212
golang-2xl:
1313
docker:
1414
# Must match GO_VERSION_MIN in project root
15-
- image: cimg/go:1.22.8
15+
- image: cimg/go:1.23
1616
resource_class: 2xlarge
1717
ubuntu:
1818
docker:
@@ -90,12 +90,39 @@ commands:
9090
check-go-version:
9191
steps:
9292
- run: |
93-
v=`go version | { read _ _ v _; echo ${v#go}; }`
94-
if [[ $v != `cat GO_VERSION_MIN` ]]; then
95-
echo "GO_VERSION_MIN file does not match the go version being used."
96-
echo "Please update image to cimg/go:`cat GO_VERSION_MIN` or update GO_VERSION_MIN to $v."
97-
exit 1
93+
v=$(go version | { read _ _ v _; echo ${v#go}; })
94+
go_min=$(cat GO_VERSION_MIN | tr -d ' \n') # Remove spaces/newlines
95+
96+
# Extract major, minor, and full versions
97+
v_major=$(echo "$v" | cut -d. -f1)
98+
v_major_minor=$(echo "$v" | cut -d. -f1,2)
99+
v_full=$(echo "$v" | cut -d. -f1,2,3)
100+
101+
go_min_major=$(echo "$go_min" | cut -d. -f1)
102+
go_min_major_minor=$(echo "$go_min" | cut -d. -f1,2)
103+
go_min_full=$(echo "$go_min" | cut -d. -f1,2,3)
104+
105+
# Ensure major version is allowed
106+
if [[ "$v_major" != "1" && "$v_major" != "23" && "$v_major" != "6" ]]; then
107+
echo "Go version mismatch! Allowed major versions: 1, 23, 6, but found Go $v."
108+
exit 1
109+
fi
110+
111+
# If GO_VERSION_MIN specifies a patch version, check full match
112+
if [[ "$go_min" == *.*.* ]]; then
113+
if [[ "$v_full" != "$go_min_full" ]]; then
114+
echo "Go version mismatch! Expected Go $go_min but found $v."
115+
exit 1
98116
fi
117+
# If GO_VERSION_MIN specifies only major.minor, check that exactly
118+
elif [[ "$go_min" == *.* ]]; then
119+
if [[ "$v_major_minor" != "$go_min_major_minor" ]]; then
120+
echo "Go version mismatch! Expected Go $go_min but found $v."
121+
exit 1
122+
fi
123+
fi
124+
125+
echo "Go version matches: $v"
99126
100127
jobs:
101128
build-debug:
@@ -189,7 +216,7 @@ jobs:
189216
default: unit
190217
description: Test suite name to report to CircleCI.
191218
docker:
192-
- image: cimg/go:1.22
219+
- image: cimg/go:1.23
193220
environment:
194221
CURIO_HARMONYDB_HOSTS: yugabyte
195222
LOTUS_HARMONYDB_HOSTS: yugabyte
@@ -244,7 +271,7 @@ jobs:
244271
description: |
245272
Arguments to pass to golangci-lint
246273
docker:
247-
- image: cimg/go:1.21
274+
- image: cimg/go:1.23
248275
resource_class: medium+
249276
steps:
250277
- checkout

.github/image/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## This image is used to github action runner for this repo
22
# Use the official Golang image as the base image
3-
FROM golang:1.22-bullseye AS builder
3+
FROM golang:1.23-bullseye AS builder
44

55
# Set the working directory inside the container
66
WORKDIR /app
@@ -23,7 +23,7 @@ RUN git submodule update --init
2323
RUN go mod download
2424

2525
# Stage 2: Install Lotus binary
26-
FROM ghcr.io/filecoin-shipyard/lotus-containers:lotus-v1.28.1-devnet AS lotus-test
26+
FROM ghcr.io/filecoin-shipyard/lotus-containers:lotus-v1.32.0-rc1-devnet AS lotus-test
2727

2828
# Stage 3: Build the final image
2929
FROM myoung34/github-runner AS curio-github-runner

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- main
1010

1111
env:
12-
GO_VERSION: 1.22.8
12+
GO_VERSION: 1.23
1313

1414
jobs:
1515
ci-lint:
@@ -257,7 +257,7 @@ jobs:
257257

258258
- name: Install golangci-lint
259259
run: |
260-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.58.1
260+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.60.1
261261
shell: bash
262262

263263
- name: Lint

Dockerfile

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#####################################
22
ARG LOTUS_TEST_IMAGE=curio/lotus-all-in-one:latest
33
FROM ${LOTUS_TEST_IMAGE} AS lotus-test
4-
FROM golang:1.22.8-bullseye AS curio-builder
5-
LABEL Maintainer = "Curio Development Team"
4+
FROM golang:1.23-bullseye AS curio-builder
5+
LABEL Maintainer="Curio Development Team"
66

77
RUN apt-get update && apt-get install -y ca-certificates build-essential clang ocl-icd-opencl-dev ocl-icd-libopencl1 jq libhwloc-dev
88

@@ -47,6 +47,18 @@ ARG CURIO_TAGS=""
4747

4848
RUN make build
4949

50+
####################################
51+
FROM golang:1.23-bullseye AS piece-server-builder
52+
53+
RUN go install github.com/ipld/go-car/cmd/car@latest \
54+
&& cp $GOPATH/bin/car /usr/local/bin/
55+
56+
RUN go install github.com/LexLuthr/piece-server@latest \
57+
&& cp $GOPATH/bin/piece-server /usr/local/bin/
58+
59+
RUN go install github.com/ipni/storetheindex@latest \
60+
&& cp $GOPATH/bin/storetheindex /usr/local/bin/
61+
5062
#####################################
5163
FROM ubuntu:22.04 AS curio-all-in-one
5264

@@ -69,10 +81,12 @@ RUN useradd -r -u 532 -U fc && \
6981
echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
7082

7183
# Environment setup
72-
ENV FILECOIN_PARAMETER_CACHE=/var/tmp/filecoin-proof-parameters \
84+
ENV FIL_PROOFS_PARAMETER_CACHE=/var/tmp/filecoin-proof-parameters \
7385
LOTUS_MINER_PATH=/var/lib/lotus-miner \
7486
LOTUS_PATH=/var/lib/lotus \
75-
CURIO_REPO_PATH=/var/lib/curio
87+
CURIO_REPO_PATH=/var/lib/curio \
88+
CURIO_MK12_CLIENT_REPO=/var/lib/curio-client \
89+
STORETHEINDEX_PATH=/var/lib/indexer
7690

7791
# Copy binaries and scripts
7892
COPY --from=lotus-test /usr/local/bin/lotus /usr/local/bin/
@@ -81,18 +95,23 @@ COPY --from=lotus-test /usr/local/bin/lotus-shed /usr/local/bin/
8195
COPY --from=lotus-test /usr/local/bin/lotus-miner /usr/local/bin/
8296
COPY --from=curio-builder /opt/curio/curio /usr/local/bin/
8397
COPY --from=curio-builder /opt/curio/sptool /usr/local/bin/
98+
COPY --from=piece-server-builder /usr/local/bin/piece-server /usr/local/bin/
99+
COPY --from=piece-server-builder /usr/local/bin/car /usr/local/bin/
100+
COPY --from=piece-server-builder /usr/local/bin/storetheindex /usr/local/bin/
84101

85102
# Set up directories and permissions
86103
RUN mkdir /var/tmp/filecoin-proof-parameters \
87104
/var/lib/lotus \
88105
/var/lib/lotus-miner \
89-
/var/lib/curio && \
90-
chown fc: /var/tmp/filecoin-proof-parameters /var/lib/lotus /var/lib/lotus-miner /var/lib/curio
106+
/var/lib/curio \
107+
/var/lib/curio-client \
108+
/var/lib/indexer && \
109+
chown fc: /var/tmp/filecoin-proof-parameters /var/lib/lotus /var/lib/lotus-miner /var/lib/curio /var/lib/curio-client /var/lib/indexer
91110

92111
# Define volumes
93-
VOLUME ["/var/tmp/filecoin-proof-parameters", "/var/lib/lotus", "/var/lib/lotus-miner", "/var/lib/curio"]
112+
VOLUME ["/var/tmp/filecoin-proof-parameters", "/var/lib/lotus", "/var/lib/lotus-miner", "/var/lib/curio", "/var/lib/curio-client", "/var/lib/indexer"]
94113

95114
# Expose necessary ports
96-
EXPOSE 1234 2345 12300 4701 32100
115+
EXPOSE 1234 2345 12300 4701 32100 12310 12320 3000 3001 3002 3003
97116

98117
CMD ["/bin/bash"]

GO_VERSION_MIN

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.22.8
1+
1.23

Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,17 @@ docker/curio:
319319
--build-arg BUILD_VERSION=dev .
320320
.PHONY: docker/curio
321321

322-
docker/devnet: $(lotus_build_cmd) docker/curio-all-in-one docker/lotus docker/lotus-miner docker/curio docker/yugabyte
322+
docker/piece-server:
323+
cd docker/piece-server && DOCKER_BUILDKIT=1 $(curio_docker_build_cmd) -t $(curio_docker_user)/piece-server-dev:dev \
324+
--build-arg BUILD_VERSION=dev .
325+
.PHONY: docker/piece-server
326+
327+
docker/indexer:
328+
cd docker/indexer && DOCKER_BUILDKIT=1 $(curio_docker_build_cmd) -t $(curio_docker_user)/indexer-dev:dev \
329+
--build-arg BUILD_VERSION=dev .
330+
.PHONY: docker/indexer
331+
332+
docker/devnet: $(lotus_build_cmd) docker/curio-all-in-one docker/lotus docker/lotus-miner docker/curio docker/piece-server docker/indexer
323333
.PHONY: docker/devnet
324334

325335
devnet/up:

cmd/sptool/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,6 @@ var toolboxCmd = &cli.Command{
9090
Usage: "some tools to fix some problems",
9191
Subcommands: []*cli.Command{
9292
sparkCmd,
93+
mk12Clientcmd,
9394
},
9495
}

0 commit comments

Comments
 (0)