From 9ffa37c686344683c3745cbadb5cab9eb4725e97 Mon Sep 17 00:00:00 2001 From: "jonathan@vulcanize.io" Date: Thu, 25 Apr 2024 20:14:26 +0000 Subject: [PATCH] refactoring lotus deploy --- .../data/compose/docker-compose-mainnet-lotus.yml | 13 +++++++------ .../Dockerfile | 4 +--- .../container-build/cerc-fixturenet-lotus/build.sh | 12 ++++++++++++ .../container-build/cerc-mainnet-lotus/build.sh | 1 - stack_orchestrator/data/container-image-list.txt | 4 ++-- stack_orchestrator/data/pod-list.txt | 1 + .../data/stacks/fixturenet-lotus/stack.yml | 2 +- .../data/stacks/mainnet-lotus/stack.yml | 2 +- 8 files changed, 25 insertions(+), 14 deletions(-) rename stack_orchestrator/data/container-build/{cerc-lotus-fixturenet => cerc-fixturenet-lotus}/Dockerfile (99%) create mode 100755 stack_orchestrator/data/container-build/cerc-fixturenet-lotus/build.sh diff --git a/stack_orchestrator/data/compose/docker-compose-mainnet-lotus.yml b/stack_orchestrator/data/compose/docker-compose-mainnet-lotus.yml index 384e38b7..a3f24374 100644 --- a/stack_orchestrator/data/compose/docker-compose-mainnet-lotus.yml +++ b/stack_orchestrator/data/compose/docker-compose-mainnet-lotus.yml @@ -1,3 +1,9 @@ +volumes: + parameters: + lotus-repo: + lotus_miner_data: + lotus_shared: + services: lotus: environment: @@ -7,6 +13,7 @@ services: - parameters:/var/tmp/filecoin-proof-parameters - lotus-repo:/var/lib/lotus - lotus_shared:/root/.lotus-shared + - lotus_miner_data:/root/data ports: - "1234" deploy: @@ -14,9 +21,3 @@ services: condition: on-failure delay: 30s command: ["lotus", "daemon"] - -volumes: - parameters: - lotus-repo: - lotus_shared: - diff --git a/stack_orchestrator/data/container-build/cerc-lotus-fixturenet/Dockerfile b/stack_orchestrator/data/container-build/cerc-fixturenet-lotus/Dockerfile similarity index 99% rename from stack_orchestrator/data/container-build/cerc-lotus-fixturenet/Dockerfile rename to stack_orchestrator/data/container-build/cerc-fixturenet-lotus/Dockerfile index d7ab1f31..abd5d2a7 100644 --- a/stack_orchestrator/data/container-build/cerc-lotus-fixturenet/Dockerfile +++ b/stack_orchestrator/data/container-build/cerc-fixturenet-lotus/Dockerfile @@ -29,7 +29,6 @@ RUN set -eux; \ rustup --version; \ cargo --version; \ rustc --version; - COPY ./ /opt/filecoin WORKDIR /opt/filecoin @@ -38,7 +37,7 @@ WORKDIR /opt/filecoin ### make configurable filecoin-ffi build ARG FFI_BUILD_FROM_SOURCE=0 ENV FFI_BUILD_FROM_SOURCE=${FFI_BUILD_FROM_SOURCE} - +RUN ls /opt/filecoin RUN make clean deps ARG RUSTFLAGS="" @@ -72,7 +71,6 @@ MAINTAINER Lotus Development Team COPY --from=lotus-builder /opt/filecoin/lotus /usr/local/bin/ COPY --from=lotus-builder /opt/filecoin/lotus-shed /usr/local/bin/ - #COPY scripts/docker-lotus-entrypoint.sh / #COPY myscripts/setup-node.sh /docker-entrypoint-scripts.d/setup-node.sh diff --git a/stack_orchestrator/data/container-build/cerc-fixturenet-lotus/build.sh b/stack_orchestrator/data/container-build/cerc-fixturenet-lotus/build.sh new file mode 100755 index 00000000..341a0d50 --- /dev/null +++ b/stack_orchestrator/data/container-build/cerc-fixturenet-lotus/build.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# Build cerc/fixturenet-lotus +source ${CERC_CONTAINER_BASE_DIR}/build-base.sh +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +# Use a release version tag to match the modified Dockerfile replaced in next step +git -C ${CERC_REPO_BASE_DIR}/lotus checkout master + +# Replace repo's Dockerfile with modified one +cp ${SCRIPT_DIR}/Dockerfile ${CERC_REPO_BASE_DIR}/lotus/Dockerfile + +docker build -t cerc/fixturenet-lotus:local ${build_command_args} ${CERC_REPO_BASE_DIR}/lotus \ No newline at end of file diff --git a/stack_orchestrator/data/container-build/cerc-mainnet-lotus/build.sh b/stack_orchestrator/data/container-build/cerc-mainnet-lotus/build.sh index 45bd8eb8..d808ceff 100755 --- a/stack_orchestrator/data/container-build/cerc-mainnet-lotus/build.sh +++ b/stack_orchestrator/data/container-build/cerc-mainnet-lotus/build.sh @@ -1,6 +1,5 @@ #!/usr/bin/env bash # Build cerc/mainnet-lotus -echo "SRC $CERC_REPO_BASE_DIR" source ${CERC_CONTAINER_BASE_DIR}/build-base.sh SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) diff --git a/stack_orchestrator/data/container-image-list.txt b/stack_orchestrator/data/container-image-list.txt index dad842f2..0ebe4da1 100644 --- a/stack_orchestrator/data/container-image-list.txt +++ b/stack_orchestrator/data/container-image-list.txt @@ -41,8 +41,8 @@ cerc/pocket cerc/watcher-azimuth cerc/ipld-eth-state-snapshot cerc/watcher-gelato -cerc/lotus -cerc/lotus-fixturenet +cerc/mainnet-lotus +cerc/fixturenet-lotus cerc/go-opera cerc/lasso cerc/reth diff --git a/stack_orchestrator/data/pod-list.txt b/stack_orchestrator/data/pod-list.txt index 9ad000c7..d952484f 100644 --- a/stack_orchestrator/data/pod-list.txt +++ b/stack_orchestrator/data/pod-list.txt @@ -27,6 +27,7 @@ fixturenet-pocket watcher-azimuth watcher-gelato fixturenet-lotus +mainnet-lotus mainnet-go-opera lasso reth diff --git a/stack_orchestrator/data/stacks/fixturenet-lotus/stack.yml b/stack_orchestrator/data/stacks/fixturenet-lotus/stack.yml index ec950dcf..6406667e 100644 --- a/stack_orchestrator/data/stacks/fixturenet-lotus/stack.yml +++ b/stack_orchestrator/data/stacks/fixturenet-lotus/stack.yml @@ -4,6 +4,6 @@ description: "A lotus fixturenet" repos: - git.vdb.to/cerc-io/lotus containers: - - cerc/lotus-fixturenet + - cerc/fixturenet-lotus pods: - fixturenet-lotus diff --git a/stack_orchestrator/data/stacks/mainnet-lotus/stack.yml b/stack_orchestrator/data/stacks/mainnet-lotus/stack.yml index 876bcec5..f68f8790 100644 --- a/stack_orchestrator/data/stacks/mainnet-lotus/stack.yml +++ b/stack_orchestrator/data/stacks/mainnet-lotus/stack.yml @@ -4,6 +4,6 @@ description: "A lotus stack" repos: - git.vdb.to/cerc-io/lotus containers: - - cerc/lotus + - cerc/mainnet-lotus pods: - mainnet-lotus