Feat: Experimental workaround for dockerized rpcdaemon in Local-Mode. Fix some permissions issues in docker containers. (#2392)

This commit is contained in:
Marius 2021-07-18 09:42:23 +02:00 committed by GitHub
parent 58e22c5bc3
commit b69638b58e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 5 deletions

View File

@ -22,7 +22,7 @@ docker:
docker build -t turbo-geth:latest --build-arg git_commit='${GIT_COMMIT}' --build-arg git_branch='${GIT_BRANCH}' --build-arg git_tag='${GIT_TAG}' . docker build -t turbo-geth:latest --build-arg git_commit='${GIT_COMMIT}' --build-arg git_branch='${GIT_BRANCH}' --build-arg git_tag='${GIT_TAG}' .
docker-compose: docker-compose:
docker-compose up UID_GID=$(shell id -u):$(shell id -g) docker-compose up
# debug build allows see C stack traces, run it with GOTRACEBACK=crash. You don't need debug build for C pit for profiling. To profile C code use SETCGOTRCKEBACK=1 # debug build allows see C stack traces, run it with GOTRACEBACK=crash. You don't need debug build for C pit for profiling. To profile C code use SETCGOTRCKEBACK=1
dbg: dbg:

View File

@ -306,10 +306,10 @@ If genesis sync passed, then it's fine to run multiple Erigon on same Disk.
Please read https://github.com/ledgerwatch/erigon/issues/1516#issuecomment-811958891 Please read https://github.com/ledgerwatch/erigon/issues/1516#issuecomment-811958891
In short: network-disks are bad for blocks execution - because blocks execution reading data from db non-parallel non-batched way. In short: network-disks are bad for blocks execution - because blocks execution reading data from db non-parallel non-batched way.
### rpcdaemon "Local-Mode" does not work with Docker Container ### rpcdaemon "Local-Mode" experimentally working with docker-compose
Running rpcdaemon in "Local-Mode" (including the `--datadir` flag) generally results in better performance for Running rpcdaemon in "Local-Mode" (including the `--datadir` flag) generally results in better performance for
RPC calls, however, this does not work when running erigon and rpcdaemon in separate containers and datadir as volume. RPC calls. By sharing the PID namespace for both containers, it's possible now to run erigon and rpcdaemon in separate containers and datadir as volume.
But it works fine if run erigon and rpcdaemon in same container. You can start up the whole stack with the following command: `make docker-compose`
For the absolute best performance bare metal is recommended at this time. For the absolute best performance bare metal is recommended at this time.
Please, help us configure Docker volume driver to support MMAP files with POSIX file-locks (MDBX). Please, help us configure Docker volume driver to support MMAP files with POSIX file-locks (MDBX).

View File

@ -4,8 +4,10 @@ services:
erigon: erigon:
image: thorax/erigon:latest image: thorax/erigon:latest
user: ${UID_GID:-1000:1000}
build: . build: .
command: erigon --datadir=/var/lib/erigon --metrics --metrics.addr=0.0.0.0 --metrics.port=6060 --private.api.addr=0.0.0.0:9090 --pprof --pprof.addr=0.0.0.0 --pprof.port=6061 command: erigon --datadir=/var/lib/erigon --metrics --metrics.addr=0.0.0.0 --metrics.port=6060 --private.api.addr=0.0.0.0:9090 --pprof --pprof.addr=0.0.0.0 --pprof.port=6061
pid: host
volumes: volumes:
- ${XDG_DATA_HOME:-~/.local/share}/erigon:/var/lib/erigon - ${XDG_DATA_HOME:-~/.local/share}/erigon:/var/lib/erigon
ports: ports:
@ -17,6 +19,7 @@ services:
prometheus: prometheus:
image: prom/prometheus:v2.28.1 image: prom/prometheus:v2.28.1
user: ${UID_GID:-1000:1000}
command: --log.level=warn --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/prometheus --web.console.libraries=/usr/share/prometheus/console_libraries --web.console.templates=/usr/share/prometheus/consoles command: --log.level=warn --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/prometheus --web.console.libraries=/usr/share/prometheus/console_libraries --web.console.templates=/usr/share/prometheus/consoles
ports: ports:
- "9090:9090" - "9090:9090"
@ -27,6 +30,7 @@ services:
grafana: grafana:
image: grafana/grafana:8.0.6 image: grafana/grafana:8.0.6
user: ${UID_GID:-1000:1000}
ports: ports:
- "3000:3000" - "3000:3000"
volumes: volumes:
@ -38,7 +42,11 @@ services:
rpcdaemon: rpcdaemon:
image: thorax/erigon:latest image: thorax/erigon:latest
command: rpcdaemon --private.api.addr=erigon:9090 --http.addr=0.0.0.0 --http.vhosts=* --http.corsdomain=* --http.api=eth,debug,net user: ${UID_GID:-1000:1000}
command: rpcdaemon --datadir /var/lib/erigon --private.api.addr=erigon:9090 --http.addr=0.0.0.0 --http.vhosts=* --http.corsdomain=* --http.api=eth,debug,net
pid: host
volumes:
- ${XDG_DATA_HOME:-~/.local/share}/erigon:/var/lib/erigon
ports: ports:
- "8545:8545" - "8545:8545"
restart: unless-stopped restart: unless-stopped