Skip to content

Commit

Permalink
Use release version and add healthcheck in Lotus stack
Browse files Browse the repository at this point in the history
  • Loading branch information
nikugogoi committed Aug 10, 2023
1 parent 83afd66 commit 6149900
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
12 changes: 12 additions & 0 deletions app/data/compose/docker-compose-fixturenet-lotus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ services:
- ../config/fixturenet-lotus/setup-node.sh:/docker-entrypoint-scripts.d/setup-node.sh
- lotus_node_1_params:/var/tmp/filecoin-proof-parameters
- lotus-shared:/root/.lotus-shared
healthcheck:
test: ["CMD", "nc", "-vz", "localhost", "1234"]
interval: 30s
timeout: 10s
retries: 10
start_period: 3s
depends_on:
- lotus-miner
entrypoint: ["sh", "/docker-entrypoint-scripts.d/setup-node.sh"]
Expand All @@ -51,6 +57,12 @@ services:
- ../config/fixturenet-lotus/setup-node.sh:/docker-entrypoint-scripts.d/setup-node.sh
- lotus_node_2_params:/var/tmp/filecoin-proof-parameters
- lotus-shared:/root/.lotus-shared
healthcheck:
test: ["CMD", "nc", "-vz", "localhost", "1234"]
interval: 30s
timeout: 10s
retries: 10
start_period: 3s
depends_on:
- lotus-miner
entrypoint: ["sh", "/docker-entrypoint-scripts.d/setup-node.sh"]
Expand Down
3 changes: 2 additions & 1 deletion app/data/config/fixturenet-lotus/setup-miner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ echo "Daemon started."
cp /devgen.car /root/.lotus-shared

# publish bootnode peer info to shared volume
lotus net listen | awk 'NR==2{print}' > /root/.lotus-shared/miner.addr
# TODO: Improve exporting public address to shared volume
lotus net listen | awk 'NR==4{print}' > /root/.lotus-shared/miner.addr

# if miner not already initialized
if [ ! -d $LOTUS_MINER_PATH ]; then
Expand Down
7 changes: 5 additions & 2 deletions app/data/container-build/cerc-lotus/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#####################################
FROM golang:1.19.7-buster AS lotus-builder
FROM golang:1.19.12-bullseye AS lotus-builder
MAINTAINER Lotus 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
Expand Down Expand Up @@ -59,7 +59,7 @@ COPY --from=lotus-builder /lib/*/libgcc_s.so.1 /lib/
COPY --from=lotus-builder /lib/*/libutil.so.1 /lib/
COPY --from=lotus-builder /usr/lib/*/libltdl.so.7 /lib/
COPY --from=lotus-builder /usr/lib/*/libnuma.so.1 /lib/
COPY --from=lotus-builder /usr/lib/*/libhwloc.so.5 /lib/
COPY --from=lotus-builder /usr/lib/*/libhwloc.so.* /lib/
COPY --from=lotus-builder /usr/lib/*/libOpenCL.so.1 /lib/

RUN useradd -r -u 532 -U fc \
Expand Down Expand Up @@ -98,6 +98,9 @@ CMD ["-help"]
#####################################
FROM lotus-base AS lotus-all-in-one

# Install netcat for healthcheck
RUN apt-get update && apt-get install -y netcat

ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
ENV LOTUS_MINER_PATH /var/lib/lotus-miner
ENV LOTUS_PATH /var/lib/lotus
Expand Down
4 changes: 2 additions & 2 deletions app/data/container-build/cerc-lotus/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

# Per lotus docs, 'releases' branch always contains latest stable release
git -C ${CERC_REPO_BASE_DIR}/lotus checkout releases
# Use a release version tag to match the modified Dockerfile replaced in next step
git -C ${CERC_REPO_BASE_DIR}/lotus checkout v1.23.3

# Replace repo's Dockerfile with modified one
cp ${SCRIPT_DIR}/Dockerfile ${CERC_REPO_BASE_DIR}/lotus/Dockerfile
Expand Down

0 comments on commit 6149900

Please sign in to comment.