Remove git stash from Dockerfile

This commit is contained in:
Nabarun 2024-05-28 18:36:22 +05:30
parent c90c77c83e
commit 91a4535743
4 changed files with 31 additions and 30 deletions

View File

@ -1,3 +1,6 @@
# Dockerfile is copied from https://git.vdb.to/cerc-io/lotus/src/tag/v1.27.0-rc3-interal-0.0.1/Dockerfile
# This file has changes for building Lotus binary for Calibration network and installing netcat for healthcheck
#####################################
FROM golang:1.21.7-bullseye AS lotus-builder
MAINTAINER Lotus Development Team
@ -45,10 +48,11 @@ ARG GOFLAGS=""
RUN make buildall
### build for calibnet
### Create separate directory for calibnet
COPY ./ /opt/filecoin-calibnet
WORKDIR /opt/filecoin-calibnet
### Build for calibnet
RUN make clean deps
RUN make calibnet
@ -78,6 +82,7 @@ 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 and create separate binaries for calibnet
COPY --from=lotus-builder /opt/filecoin-calibnet/lotus /usr/local/bin/lotus-calibnet
COPY --from=lotus-builder /opt/filecoin-calibnet/lotus-shed /usr/local/bin/lotus-calibnet-shed
@ -126,6 +131,7 @@ COPY --from=lotus-builder /opt/filecoin/curio /usr/local/bin/
COPY --from=lotus-builder /opt/filecoin/lotus-stats /usr/local/bin/
COPY --from=lotus-builder /opt/filecoin/lotus-fountain /usr/local/bin/
# Copy and create separate binaries for calibnet
COPY --from=lotus-builder /opt/filecoin-calibnet/lotus /usr/local/bin/lotus-calibnet
COPY --from=lotus-builder /opt/filecoin-calibnet/lotus-seed /usr/local/bin/lotus-calibnet-seed

View File

@ -3,9 +3,6 @@
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
git stash
# Replace repo's Dockerfile with modified one
cp ${SCRIPT_DIR}/Dockerfile ${CERC_REPO_BASE_DIR}/lotus/Dockerfile

View File

@ -15,7 +15,7 @@ Downloaded chain snapshot
```
- For Calibration Testnet
```
```bash
aria2c -o calibnet-snapshot.car.zst -x5 https://forest-archive.chainsafe.dev/latest/calibnet/
# or using wget
@ -31,7 +31,7 @@ $ laconic-so fetch-stack git.vdb.to/cerc-io/lotus-stack
## Clone required repositories
```bash
$ laconic-so --stack ~/cerc/lotus-stack/stack-orchestrator/stacks/lotus-node setup-repositories
$ laconic-so --stack ~/cerc/lotus-stack/stack-orchestrator/stacks/lotus-node setup-repositories --branches git.vdb.to/cerc-io/lotus@v1.27.0-rc3-interal-0.0.1
```
## Build the Lotus containers
@ -42,33 +42,31 @@ $ laconic-so --stack ~/cerc/lotus-stack/stack-orchestrator/stacks/lotus-node bui
## Create a deployment
- Create deployment spec file
- For Mainnet
```bash
$ laconic-so --stack ~/cerc/lotus-stack/stack-orchestrator/stacks/lotus-node deploy init --map-ports-to-host any-same --output lotus-node.yml --config CERC_LOTUS_NETWORK=mainnet,CERC_LOTUS_SNAPSHOT_PATH=/path-to-file/mainnet-snapshot.car.zst
```
- For Calibration
```bash
$ laconic-so --stack ~/cerc/lotus-stack/stack-orchestrator/stacks/lotus-node deploy init --map-ports-to-host any-same --output lotus-node.yml --config CERC_LOTUS_NETWORK=calibration,CERC_LOTUS_SNAPSHOT_PATH=/path-to-file/calibnet-snapshot.car.zst
```
NOTE: In commands above, set `CERC_LOTUS_SNAPSHOT_PATH` to the absolute file path of the downloaded snapshot ([Prerequisite](#prerequisite))
- Create deployment directory
```bash
$ laconic-so --stack ~/cerc/lotus-stack/stack-orchestrator/stacks/lotus-node deploy init --map-ports-to-host any-same --output lotus-node.yml
$ laconic-so --stack ~/cerc/lotus-stack/stack-orchestrator/stacks/lotus-node deploy create --spec-file lotus-node.yml --deployment-dir lotus-node-deployment
```
## Setup config
Inside deployment directory, open the `config.env` file and set following env variables:
Environment variables for Lotus node can be configured by setting them in `config.env` inside deployment directory
- For Mainnet
```bash
CERC_LOTUS_NETWORK=mainnet
# File path of downloaded snapshot
CERC_LOTUS_SNAPSHOT_PATH=/path-to-file/mainnet-snapshot.car.zst
```
- For Calibration
```bash
CERC_LOTUS_NETWORK=calibration
# File path of downloaded snapshot
CERC_LOTUS_SNAPSHOT_PATH=/path-to-file/calibnet-snapshot.car.zst
```
- Environment variables for Lotus node can be configured by setting them in `config.env` inside deployment directory
- Check [compose file](../../compose/docker-compose-lotus-node.yml) for configured environment variables
- Refer to [default Lotus config](https://git.vdb.to/cerc-io/lotus/src/tag/v1.27.0-rc3-interal-0.0.1/documentation/en/default-lotus-config.toml)
## Start the container

View File

@ -2,7 +2,7 @@ version: "1.0"
name: lotus-node
description: "Lotus node stack"
repos:
- git.vdb.to/cerc-io/lotus@v1.27.0-rc3-interal-0.0.1
- git.vdb.to/cerc-io/lotus
containers:
- cerc/lotus-node
pods: