-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* curio docker devnet * fix UI, improve init, compose * fix TreeRC * bump FFI
- Loading branch information
Showing
25 changed files
with
481 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
##################################### | ||
FROM golang:1.21.7-bullseye AS curio-builder | ||
MAINTAINER Curio Development Team | ||
|
||
RUN apt-get update && apt-get install -y ca-certificates build-essential clang ocl-icd-opencl-dev ocl-icd-libopencl1 jq libhwloc-dev | ||
|
||
ENV XDG_CACHE_HOME="/tmp" | ||
|
||
### taken from https://github.com/rust-lang/docker-rust/blob/master/1.63.0/buster/Dockerfile | ||
ENV RUSTUP_HOME=/usr/local/rustup \ | ||
CARGO_HOME=/usr/local/cargo \ | ||
PATH=/usr/local/cargo/bin:$PATH \ | ||
RUST_VERSION=1.63.0 | ||
|
||
RUN set -eux; \ | ||
dpkgArch="$(dpkg --print-architecture)"; \ | ||
case "${dpkgArch##*-}" in \ | ||
amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='5cc9ffd1026e82e7fb2eec2121ad71f4b0f044e88bca39207b3f6b769aaa799c' ;; \ | ||
arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='e189948e396d47254103a49c987e7fb0e5dd8e34b200aa4481ecc4b8e41fb929' ;; \ | ||
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \ | ||
esac; \ | ||
url="https://static.rust-lang.org/rustup/archive/1.25.1/${rustArch}/rustup-init"; \ | ||
wget "$url"; \ | ||
echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ | ||
chmod +x rustup-init; \ | ||
./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ | ||
rm rustup-init; \ | ||
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ | ||
rustup --version; \ | ||
cargo --version; \ | ||
rustc --version; | ||
|
||
COPY ./ /opt/curio | ||
WORKDIR /opt/curio | ||
|
||
#RUN scripts/docker-git-state-check.sh | ||
|
||
### make configurable filecoin-ffi build | ||
ARG FFI_BUILD_FROM_SOURCE=0 | ||
ENV FFI_BUILD_FROM_SOURCE=${FFI_BUILD_FROM_SOURCE} | ||
|
||
RUN make clean deps | ||
|
||
ARG RUSTFLAGS="" | ||
ARG GOFLAGS="" | ||
|
||
RUN make curio-devnet | ||
|
||
##################################### | ||
FROM ubuntu:22.04 AS curio-all-in-one | ||
|
||
RUN apt-get update && apt-get install -y dnsutils vim curl | ||
|
||
# Copy libraries and binaries from curio-builder | ||
COPY --from=curio-builder /etc/ssl/certs /etc/ssl/certs | ||
COPY --from=curio-builder /lib/*/libdl.so.2 /lib/ | ||
COPY --from=curio-builder /lib/*/librt.so.1 /lib/ | ||
COPY --from=curio-builder /lib/*/libgcc_s.so.1 /lib/ | ||
COPY --from=curio-builder /lib/*/libutil.so.1 /lib/ | ||
COPY --from=curio-builder /usr/lib/*/libltdl.so.7 /lib/ | ||
COPY --from=curio-builder /usr/lib/*/libnuma.so.1 /lib/ | ||
COPY --from=curio-builder /usr/lib/*/libhwloc.so.* /lib/ | ||
COPY --from=curio-builder /usr/lib/*/libOpenCL.so.1 /lib/ | ||
|
||
# Setup user and OpenCL configuration | ||
RUN useradd -r -u 532 -U fc && \ | ||
mkdir -p /etc/OpenCL/vendors && \ | ||
echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd | ||
|
||
# Environment setup | ||
ENV FILECOIN_PARAMETER_CACHE=/var/tmp/filecoin-proof-parameters \ | ||
LOTUS_MINER_PATH=/var/lib/lotus-miner \ | ||
LOTUS_PATH=/var/lib/lotus \ | ||
CURIO_REPO_PATH=/var/lib/curio | ||
|
||
# Copy binaries and scripts | ||
COPY --from=curio-builder /opt/curio/lotus /usr/local/bin/ | ||
COPY --from=curio-builder /opt/curio/lotus-seed /usr/local/bin/ | ||
COPY --from=curio-builder /opt/curio/lotus-shed /usr/local/bin/ | ||
COPY --from=curio-builder /opt/curio/lotus-miner /usr/local/bin/ | ||
COPY --from=curio-builder /opt/curio/curio /usr/local/bin/ | ||
COPY --from=curio-builder /opt/curio/sptool /usr/local/bin/ | ||
|
||
# Set up directories and permissions | ||
RUN mkdir /var/tmp/filecoin-proof-parameters \ | ||
/var/lib/lotus \ | ||
/var/lib/lotus-miner \ | ||
/var/lib/curio && \ | ||
chown fc: /var/tmp/filecoin-proof-parameters /var/lib/lotus /var/lib/lotus-miner /var/lib/curio | ||
|
||
# Define volumes | ||
VOLUME ["/var/tmp/filecoin-proof-parameters", "/var/lib/lotus", "/var/lib/lotus-miner", "/var/lib/curio"] | ||
|
||
# Expose necessary ports | ||
EXPOSE 1234 2345 12300 4701 32100 | ||
|
||
CMD ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
DOCKER_USER=curio | ||
LOTUS_IMAGE=${DOCKER_USER}/lotus-dev:dev | ||
LOTUS_MINER_IMAGE=${DOCKER_USER}/lotus-miner-dev:dev | ||
CURIO_IMAGE=${DOCKER_USER}/curio-dev:dev | ||
FIL_PROOFS_PARAMETER_CACHE=${HOME}/.cache/filecoin-proof-parameters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
ARG CURIO_TEST_IMAGE=curio/curio-all-in-one:latest | ||
############################################################################# | ||
FROM ${CURIO_TEST_IMAGE} | ||
|
||
ARG BUILD_VERSION=0.1 | ||
|
||
LABEL org.opencontainers.image.version=$BUILD_VERSION \ | ||
org.opencontainers.image.authors="Curio Dev Team" \ | ||
name="lotus-dev" \ | ||
maintainer="Curio Dev Team" \ | ||
vendor="Curio Dev Team" \ | ||
version=$BUILD_VERSION \ | ||
release=$BUILD_VERSION \ | ||
summary="This image is used to host the curio dev service" \ | ||
description="This image is used to host the curio dev service" | ||
|
||
EXPOSE 12300 4701 32100 | ||
|
||
VOLUME /var/tmp/filecoin-proof-parameters | ||
VOLUME /var/lib/genesis | ||
VOLUME /var/lib/builtin-actors | ||
|
||
WORKDIR /app | ||
RUN mkdir -p /app | ||
|
||
COPY entrypoint.sh /app | ||
|
||
USER root | ||
|
||
ENTRYPOINT ["./entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
echo CURIO_REPO_PATH=$CURIO_REPO_PATH | ||
echo Wait for lotus is ready ... | ||
lotus wait-api | ||
echo Wait for lotus-miner is ready ... | ||
lotus-miner wait-api | ||
head=0 | ||
# Loop until the head is greater than 9 | ||
while [[ $head -le 9 ]]; do | ||
head=$(lotus chain list | awk '{print $1}' | awk -F':' '{print $1}' | tail -1) | ||
if [[ $head -le 9 ]]; then | ||
echo "Current head: $head, which is not greater than 9. Waiting..." | ||
sleep 1 # Wait for 4 seconds before checking again | ||
else | ||
echo "The head is now greater than 9: $head" | ||
fi | ||
done | ||
|
||
echo All ready. Lets go | ||
myip=`nslookup curio | grep -v "#" | grep Address | awk '{print $2}'` | ||
|
||
if [ ! -f $CURIO_REPO_PATH/.init.curio ]; then | ||
|
||
if [ ! -f $CURIO_REPO_PATH/.init.setup ]; then | ||
export DEFAULT_WALLET=`lotus wallet default` | ||
echo Create a new miner actor ... | ||
lotus-shed miner create $DEFAULT_WALLET $DEFAULT_WALLET $DEFAULT_WALLET 8MiB | ||
touch $CURIO_REPO_PATH/.init.setup | ||
fi | ||
|
||
if [ ! -f $CURIO_REPO_PATH/.init.config ]; then | ||
|
||
newminer=`lotus state list-miners | grep -v t01000` | ||
echo "New Miner is $newminer" | ||
echo Initiating a new Curio cluster ... | ||
curio config new-cluster $newminer | ||
echo Enabling market ... | ||
curio config get seal | sed -e $'$a\\\n BoostAdapters = ["'"$newminer"':'"$myip"':32100"]' | curio config set --title seal | ||
touch $CURIO_REPO_PATH/.init.config | ||
fi | ||
|
||
echo Starting Curio node to attach storage ... | ||
curio run --nosync --layers seal,post,gui & | ||
CURIO_PID=`echo $!` | ||
until curio cli --machine $myip:12300 wait-api; do | ||
echo "Waiting for the curio CLI to become ready..." | ||
sleep 5 | ||
done | ||
curio cli --machine $myip:12300 storage attach --init --seal --store $CURIO_REPO_PATH | ||
touch $CURIO_REPO_PATH/.init.curio | ||
echo Stopping Curio node ... | ||
echo Try to stop boost... | ||
kill -15 $CURIO_PID || kill -9 $CURIO_PID | ||
echo Done | ||
fi | ||
|
||
echo Starting curio node ... | ||
exec curio run --nosync --layers seal,post,gui | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
version: '3.8' | ||
name: curio-devnet | ||
|
||
x-logging: | ||
&default-logging | ||
options: | ||
max-size: '20m' | ||
max-file: '3' | ||
driver: json-file | ||
|
||
networks: | ||
curio-net: | ||
driver: bridge | ||
ipam: | ||
config: | ||
- subnet: 172.20.0.0/16 | ||
|
||
services: | ||
lotus: | ||
container_name: lotus | ||
image: ${LOTUS_IMAGE} | ||
init: true | ||
ports: | ||
- "1234:1234" | ||
- "9090:9090" | ||
environment: | ||
- LOTUS_FEVM_ENABLEETHRPC=true | ||
- LOTUS_API_LISTENADDRESS=/dns/lotus/tcp/1234/http | ||
- LOTUS_LIBP2P_LISTENADDRESSES=/ip4/0.0.0.0/tcp/9090 | ||
restart: unless-stopped | ||
logging: *default-logging | ||
volumes: | ||
- ./data/lotus:/var/lib/lotus:rw | ||
- ./data/genesis:/var/lib/genesis:rw | ||
- ${FIL_PROOFS_PARAMETER_CACHE}:/var/tmp/filecoin-proof-parameters:rw | ||
networks: | ||
curio-net: | ||
ipv4_address: 172.20.0.2 | ||
|
||
lotus-miner: | ||
container_name: lotus-miner | ||
image: ${LOTUS_MINER_IMAGE} | ||
init: true | ||
ports: | ||
- "2345:2345" | ||
environment: | ||
- LOTUS_API_LISTENADDRESS=/dns/lotus-miner/tcp/2345/http | ||
- LOTUS_API_REMOTELISTENADDRESS=lotus-miner:2345 | ||
- LOTUS_SEALING_BATCHPRECOMMITS=false | ||
- LOTUS_SEALING_AGGREGATECOMMITS=false | ||
- LOTUS_SUBSYSTEMS_ENABLEMARKETS=false | ||
- LOTUS_SEALING_WAITDEALSDELAY=20s | ||
restart: unless-stopped | ||
logging: *default-logging | ||
volumes: | ||
- ./data/lotus-miner:/var/lib/lotus-miner:rw | ||
- ./data/lotus:/var/lib/lotus:ro | ||
- ./data/genesis:/var/lib/genesis:ro | ||
- ${FIL_PROOFS_PARAMETER_CACHE}:/var/tmp/filecoin-proof-parameters:rw | ||
networks: | ||
curio-net: | ||
ipv4_address: 172.20.0.3 | ||
|
||
curio: | ||
container_name: curio | ||
image: ${CURIO_IMAGE} | ||
init: true | ||
ports: | ||
- "12300:12300" # API | ||
- "4701:4701" # UI | ||
- "32100:32100" # Market | ||
environment: | ||
- CURIO_REPO_PATH=/var/lib/curio | ||
- CURIO_HARMONYDB_HOSTS=yugabyte | ||
restart: unless-stopped | ||
logging: *default-logging | ||
volumes: | ||
- ./data/curio:/var/lib/curio:rw | ||
- ./data/lotus:/var/lib/lotus:ro | ||
- ./data/lotus-miner:/var/lib/lotus-miner:ro | ||
- ${FIL_PROOFS_PARAMETER_CACHE}:/var/tmp/filecoin-proof-parameters:rw | ||
networks: | ||
curio-net: | ||
ipv4_address: 172.20.0.4 | ||
|
||
yugabyte: | ||
container_name: yugabyte | ||
image: curio/yugabyte-dev:dev | ||
init: true | ||
ports: | ||
- "5433:5433" | ||
- "9000:9000" | ||
- "9042:9042" | ||
restart: unless-stopped | ||
logging: *default-logging | ||
volumes: | ||
- ./data/yugabyte-data:/root/var/data | ||
- ./data/yugabyte-logs:/root/var/logs | ||
networks: | ||
curio-net: | ||
ipv4_address: 172.20.0.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
ARG CURIO_TEST_IMAGE=curio/curio-all-in-one:latest | ||
############################################################################# | ||
FROM ${CURIO_TEST_IMAGE} | ||
|
||
ARG BUILD_VERSION=0.1 | ||
|
||
LABEL org.opencontainers.image.version=$BUILD_VERSION \ | ||
org.opencontainers.image.authors="Curio Dev Team" \ | ||
name="lotus-miner-dev" \ | ||
maintainer="Curio Dev Team" \ | ||
vendor="Curio Dev Team" \ | ||
version=$BUILD_VERSION \ | ||
release=$BUILD_VERSION \ | ||
summary="This image is used to host the lotus-miner dev service" \ | ||
description="This image is used to host the lotus-miner dev service" | ||
|
||
EXPOSE 2345 | ||
ENV LOTUS_SKIP_GENESIS_CHECK=_yes_ | ||
ENV GENESIS_PATH=/var/lib/genesis | ||
ENV SECTOR_SIZE=8388608 | ||
|
||
VOLUME /var/tmp/filecoin-proof-parameters | ||
VOLUME /var/lib/genesis | ||
VOLUME /var/lib/builtin-actors | ||
|
||
WORKDIR /app | ||
RUN mkdir -p /app | ||
|
||
COPY entrypoint.sh /app | ||
|
||
USER root | ||
|
||
ENTRYPOINT ["./entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
echo Wait for lotus is ready ... | ||
lotus wait-api | ||
echo Lotus ready. Lets go | ||
if [ ! -f $LOTUS_MINER_PATH/.init.miner ]; then | ||
echo Import the genesis miner key ... | ||
lotus wallet import --as-default $GENESIS_PATH/pre-seal-t01000.key | ||
echo Set up the genesis miner ... | ||
lotus-miner init --genesis-miner --actor=t01000 --sector-size=$SECTOR_SIZE --pre-sealed-sectors=$GENESIS_PATH --pre-sealed-metadata=$GENESIS_PATH/pre-seal-t01000.json --nosync | ||
touch $LOTUS_MINER_PATH/.init.miner | ||
echo Done | ||
fi | ||
|
||
echo Starting lotus miner ... | ||
exec lotus-miner run --nosync |
Oops, something went wrong.