Skip to content

Commit

Permalink
Lodestar fixes, new logging option
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickdowne committed Oct 11, 2021
1 parent d0b2420 commit 189d3e1
Show file tree
Hide file tree
Showing 30 changed files with 241 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ For a quick testnet start, you can install prerequisites and configure eth-docke

# Version

This is eth-docker v1.5.8
This is eth-docker v1.5.9
8 changes: 8 additions & 0 deletions besu.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
version: "3.4"
x-logging: &logging
logging:
driver: json-file
options:
max-size: 10m
max-file: "3"

services:
execution:
restart: "${RESTART}"
Expand All @@ -24,6 +31,7 @@ services:
default:
aliases:
- eth1
<<: *logging
entrypoint:
- docker-entrypoint.sh
- /opt/besu/bin/besu
Expand Down
10 changes: 10 additions & 0 deletions blank-grafana.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
version: "3.4"
x-logging: &logging
logging:
driver: json-file
options:
max-size: 10m
max-file: "3"

services:
prometheus:
restart: "${RESTART}"
Expand All @@ -14,6 +21,7 @@ services:
- CLIENT=${COMPOSE_FILE}
expose:
- 9090/tcp
<<: *logging
entrypoint: choose-config.sh
command: ["/bin/prometheus", "--storage.tsdb.path=/prometheus", "--web.console.libraries=/usr/share/prometheus/console_libraries", "--web.console.templates=/usr/share/prometheus/consoles"]
depends_on:
Expand All @@ -38,6 +46,7 @@ services:
- /etc/timezone:/etc/TZ:ro
expose:
- 9100/tcp
<<: *logging
grafana:
restart: "${RESTART}"
build:
Expand All @@ -53,6 +62,7 @@ services:
- prometheus
expose:
- ${GRAFANA_PORT}/tcp
<<: *logging
labels:
- traefik.enable=true
- traefik.http.routers.grafana.entrypoints=web,websecure
Expand Down
6 changes: 4 additions & 2 deletions default.env
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ CC_HOST=cc
DDNS_SUBDOMAIN=
DDNS_PROXY=true

# Teku/LH rapid sync via initial state/checkpoint. Please create an Infura eth2/beacon project first, then replace the {projectid} and {secret} here
# and use one of these lines instead of the empty one
# Teku/Lighthouse/Lodestar rapid sync via initial state/checkpoint. For Teku or Lighthouse, please create an Infura
# eth2/beacon project first, then replace the {projectid} and {secret} here and use one of these lines instead of the empty one
#TEKU_RAPID_SYNC=--initial-state=https://{projectid}:{secret}@eth2-beacon-${NETWORK}.infura.io/eth/v1/debug/beacon/states/finalized
#LH_RAPID_SYNC=--checkpoint-sync-url=https://{projectid}:{secret}@eth2-beacon-${NETWORK}.infura.io/
TEKU_RAPID_SYNC=
LH_RAPID_SYNC=
# Set this to true to rapid sync Lodestar
LS_RAPID_SYNC=false

# Consensus client address. This could be comma-separated for Lighthouse, with Infura as failover,
# or could just be a remote consensus client URL for Teku, Lighthouse or Prysm "validator only" setups. Not in use for Nimbus.
Expand Down
8 changes: 8 additions & 0 deletions erigon.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
version: "3.4"
x-logging: &logging
logging:
driver: json-file
options:
max-size: 10m
max-file: "3"

services:
erigon:
restart: "${RESTART}"
Expand All @@ -24,6 +31,7 @@ services:
default:
aliases:
- eth1
<<: *logging
entrypoint:
- docker-entrypoint.sh
- erigon
Expand Down
8 changes: 8 additions & 0 deletions geth.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
version: "3.4"
x-logging: &logging
logging:
driver: json-file
options:
max-size: 10m
max-file: "3"

services:
execution:
restart: "${RESTART}"
Expand All @@ -24,6 +31,7 @@ services:
default:
aliases:
- eth1
<<: *logging
entrypoint:
- docker-entrypoint.sh
- geth
Expand Down
9 changes: 9 additions & 0 deletions lh-base-notz.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Version without timezone, for use with Amazon Linux 2 and similar
version: "3.4"
x-logging: &logging
logging:
driver: json-file
options:
max-size: 10m
max-file: "3"

services:
consensus:
restart: "${RESTART}"
Expand All @@ -22,6 +29,7 @@ services:
default:
aliases:
- eth2
<<: *logging
entrypoint:
- docker-entrypoint.sh
- lighthouse
Expand Down Expand Up @@ -49,6 +57,7 @@ services:
image: lighthouse:local
volumes:
- lhvalidator-data:/var/lib/lighthouse
<<: *logging
entrypoint:
- docker-entrypoint.sh
- lighthouse
Expand Down
9 changes: 9 additions & 0 deletions lh-base.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
version: "3.4"
x-logging: &logging
logging:
driver: json-file
options:
max-size: 10m
max-file: "3"

services:
consensus:
restart: "${RESTART}"
Expand All @@ -23,6 +30,7 @@ services:
default:
aliases:
- eth2
<<: *logging
entrypoint:
- docker-entrypoint.sh
- lighthouse
Expand Down Expand Up @@ -52,6 +60,7 @@ services:
- lhvalidator-data:/var/lib/lighthouse
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
<<: *logging
entrypoint:
- docker-entrypoint.sh
- lighthouse
Expand Down
8 changes: 8 additions & 0 deletions lh-consensus.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
version: "3.4"
x-logging: &logging
logging:
driver: json-file
options:
max-size: 10m
max-file: "3"

services:
consensus:
restart: "${RESTART}"
Expand All @@ -24,6 +31,7 @@ services:
default:
aliases:
- eth2
<<: *logging
entrypoint:
- docker-entrypoint.sh
- lighthouse
Expand Down
10 changes: 10 additions & 0 deletions lh-grafana.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
version: "3.4"
x-logging: &logging
logging:
driver: json-file
options:
max-size: 10m
max-file: "3"

services:
consensus:
expose:
Expand Down Expand Up @@ -31,6 +38,7 @@ services:
- 9090/tcp
entrypoint: choose-config.sh
command: ["/bin/prometheus", "--storage.tsdb.path=/prometheus", "--web.console.libraries=/usr/share/prometheus/console_libraries", "--web.console.templates=/usr/share/prometheus/consoles"]
<<: *logging
depends_on:
- consensus
- validator
Expand All @@ -55,6 +63,7 @@ services:
- /etc/timezone:/etc/TZ:ro
expose:
- 9100/tcp
<<: *logging
grafana:
restart: "${RESTART}"
build:
Expand All @@ -70,6 +79,7 @@ services:
- prometheus
expose:
- ${GRAFANA_PORT}/tcp
<<: *logging
labels:
- traefik.enable=true
- traefik.http.routers.grafana.entrypoints=web,websecure
Expand Down
8 changes: 8 additions & 0 deletions lh-validator-notz.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
# Version without timezone, for use with Amazon Linux 2 and similar
version: "3.4"
x-logging: &logging
logging:
driver: json-file
options:
max-size: 10m
max-file: "3"

services:
validator:
restart: "${RESTART}"
image: lighthouse:local
volumes:
- lhvalidator-data:/var/lib/lighthouse
<<: *logging
entrypoint:
- docker-entrypoint.sh
- lighthouse
Expand Down
8 changes: 8 additions & 0 deletions lh-validator.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
version: "3.4"
x-logging: &logging
logging:
driver: json-file
options:
max-size: 10m
max-file: "3"

services:
validator:
restart: "${RESTART}"
Expand All @@ -7,6 +14,7 @@ services:
- lhvalidator-data:/var/lib/lighthouse
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
<<: *logging
entrypoint:
- docker-entrypoint.sh
- lighthouse
Expand Down
15 changes: 13 additions & 2 deletions lodestar-base.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
version: "3.4"
x-logging: &logging
logging:
driver: json-file
options:
max-size: 10m
max-file: "3"

services:
consensus:
restart: "${RESTART}"
Expand All @@ -20,10 +27,11 @@ services:
- ${LS_PORT}:${LS_PORT}/udp
expose:
- 9596/tcp
<<: *logging
entrypoint:
- node
- --max-old-space-size=8192
- /usr/app/packages/cli/bin/lodestar
- --max-old-space-size=6144
- /usr/app/node_modules/.bin/lodestar
- beacon
- --rootDir
- /var/lib/lodestar/consensus
Expand All @@ -37,6 +45,8 @@ services:
- "/ip4/0.0.0.0/tcp/${LS_PORT}"
- --eth1.providerUrl
- ${EC_NODE}
- --weakSubjectivitySyncLatest
- ${LS_RAPID_SYNC}
- --logLevel
- ${LOG_LEVEL}
- --network
Expand All @@ -55,6 +65,7 @@ services:
- lsvalidator-data:/var/lib/lodestar/validators
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
<<: *logging
entrypoint:
- node
- --max-old-space-size=8192
Expand Down
2 changes: 1 addition & 1 deletion lodestar/Dockerfile.binary
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ RUN adduser \
# Create data mount point with permissions
RUN mkdir -p /var/lib/lodestar/validators && chown ${USER}:${USER} /var/lib/lodestar/validators && chmod 700 /var/lib/lodestar/validators

ENTRYPOINT ["node", "--max-old-space-size=8192", "/usr/app/packages/cli/bin/lodestar"]
ENTRYPOINT ["node", "--max-old-space-size=6144", "/usr/app/node_modules/.bin/lodestar"]
11 changes: 5 additions & 6 deletions lodestar/Dockerfile.source
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16-alpine as build
FROM node:14-alpine as build

# Here only to avoid build-time errors
ARG DOCKER_TAG
Expand All @@ -10,15 +10,14 @@ RUN ln -s /usr/bin/python3 /usr/bin/python

WORKDIR /usr/app

RUN bash -c "git clone https://github.com/ChainSafe/lodestar.git && cd lodestar && git config advice.detachedHead false && git fetch --all --tags && git checkout ${BUILD_TARGET} && yarn install --non-interactive --frozen-lockfile && node ./scripts/getGitData /usr/app/lodestar/.git-data.json && rm -r .git"
RUN bash -c "git clone https://github.com/ChainSafe/lodestar.git && cd lodestar && git config advice.detachedHead false && git fetch --all --tags && git checkout ${BUILD_TARGET} && yarn install --non-interactive --frozen-lockfile && yarn build && cd packages && npm install && npm install ./cli"

FROM node:16-alpine
FROM node:14-alpine

RUN apk update && apk add --no-cache ca-certificates tzdata bash su-exec && rm -rf /var/cache/apk/*

WORKDIR /usr/app
COPY --from=build /usr/app/lodestar .
ENV DOCKER_LODESTAR_GIT_DATA_FILEPATH /usr/app/.git-data.json
COPY --from=build /usr/app/lodestar/ .

# Scripts that handle permissions
COPY ./validator-import.sh /usr/local/bin/
Expand Down Expand Up @@ -54,4 +53,4 @@ RUN adduser \
# Create data mount point with permissions
RUN mkdir -p /var/lib/lodestar/validators && chown ${USER}:${USER} /var/lib/lodestar/validators && chmod 700 /var/lib/lodestar/validators

ENTRYPOINT ["node", "--max-old-space-size=8192", "/usr/app/packages/cli/bin/lodestar"]
ENTRYPOINT ["node", "--max-old-space-size=6144", "/usr/app/node_modules/.bin/lodestar"]
8 changes: 8 additions & 0 deletions nimbus-base.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
version: "3.4"
x-logging: &logging
logging:
driver: json-file
options:
max-size: 10m
max-file: "3"

services:
consensus:
restart: "${RESTART}"
Expand All @@ -21,6 +28,7 @@ services:
default:
aliases:
- eth2
<<: *logging
entrypoint:
- docker-entrypoint.sh
- /usr/local/bin/nimbus_beacon_node
Expand Down
Loading

0 comments on commit 189d3e1

Please sign in to comment.