Move the beacon_node docker files to their own repo

This commit is contained in:
Zahary Karadjov 2019-09-10 12:42:21 -04:00
parent 35bdfbc159
commit 74c67a4730
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
9 changed files with 0 additions and 168 deletions

View File

@ -1,62 +0,0 @@
FROM statusteam/nim-base AS build
RUN apt update \
&& apt install -y build-essential make wget \
&& apt clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN export GO_TAR_GZ=go1.12.6.linux-amd64.tar.gz \
&& cd /tmp/ \
&& wget https://dl.google.com/go/$GO_TAR_GZ \
&& tar -xvf $GO_TAR_GZ \
&& mv go /usr/local \
&& rm $GO_TAR_GZ
ARG GIT_REVISION
RUN export GOROOT=/usr/local/go \
&& export PATH=$GOROOT/bin:$PATH \
&& git clone https://github.com/status-im/nimbus.git \
&& cd nimbus \
&& git reset --hard ${GIT_REVISION} \
&& make update deps vendor/go/bin/p2pd nat-libs \
&& cp vendor/go/bin/p2pd /usr/bin/p2pd \
&& cp docker/beacon_node/run_in_docker.sh /usr/bin/run_beacon_node.sh
ARG NETWORK
ARG NETWORK_TYPE
RUN cd nimbus \
&& set -a \
&& . vendor/nim-beacon-chain/scripts/${NETWORK}.env \
&& ./env.sh nim \
-o:/usr/bin/beacon_node \
-d:release \
--debugger:native \
--debugInfo \
-d:"network_type=${NETWORK_TYPE}" \
-d:SHARD_COUNT=${SHARD_COUNT} \
-d:SLOTS_PER_EPOCH=${SLOTS_PER_EPOCH} \
-d:SECONDS_PER_SLOT=${SECONDS_PER_SLOT} \
-d:chronicles_log_level=DEBUG \
-d:chronicles_sinks=json \
c vendor/nim-beacon-chain/beacon_chain/beacon_node.nim
# --------------------------------- #
# Starting new image to reduce size #
# --------------------------------- #
FROM debian:9-slim
RUN apt update \
&& apt install -y librocksdb-dev curl \
&& apt clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY --from=build /usr/bin/beacon_node /usr/bin/beacon_node
COPY --from=build /usr/bin/run_beacon_node.sh /usr/bin/run_beacon_node.sh
COPY --from=build /usr/bin/p2pd /usr/bin/p2pd
MAINTAINER Zahary Karadjov <zahary@status.im>
LABEL description="Nimbus installation that can act as an ETH2 network bootstrap node."
ENTRYPOINT ["/usr/bin/run_beacon_node.sh"]

View File

@ -1,19 +0,0 @@
# These default settings can be overriden by exporting env variables
GIT_REVISION ?= $(git rev-parse HEAD)
NETWORK ?= testnet1
NETWORK_TYPE ?= libp2p
IMAGE_TAG ?= $(NETWORK)
IMAGE_NAME ?= statusteam/nimbus_beacon_node:$(IMAGE_TAG)
build: $(NIX_INSTALL)
docker build \
--build-arg="GIT_REVISION=$(GIT_REVISION)" \
--build-arg="NETWORK=$(NETWORK)" \
--build-arg="NETWORK_TYPE=$(NETWORK_TYPE)" \
-t $(IMAGE_NAME) .
push: build
docker push $(IMAGE_NAME)

View File

@ -1,3 +0,0 @@
# Description
This `Dockerfile` defines the image used in the [`infra-nimbus`](https://github.com/status-im/infra-nimbus) fleet of hosts via the [`infra-role-beacon-node`](https://github.com/status-im/infra-role-beacon-node).

View File

@ -1,7 +0,0 @@
#!/bin/bash
killall p2pd
rm -rf /tmp/*
beacon_node --nat:none $*

View File

@ -1,24 +0,0 @@
#!/bin/bash
set -euv
cd $(dirname "$0")
export GIT_REVISION=$(git rev-parse HEAD)
NETWORK=testnet1
if [[ $(git rev-parse --abbrev-ref HEAD) == "master" ]]; then
NETWORK=testnet0
fi
buildAndPush() {
export NETWORK=$1
export NETWORK_TYPE=$2
(cd beacon_node && make push)
}
# buildAndPush $NETWORK rlpx
buildAndPush $NETWORK libp2p

View File

@ -1,9 +0,0 @@
#!/bin/bash
set -euv
cd $(dirname "$0")
export GIT_REVISION=$(git rev-parse HEAD)
(cd nimbus && make push)

View File

@ -1,44 +0,0 @@
import
strformat
var
serverCount = 10
instancesCount = 2
totalValidators = 1000
userValidators = 200
systemValidators = totalValidators - userValidators
validatorsPerServer = systemValidators div serverCount
validatorsPerNode = validatorsPerServer div instancesCount
network = "testnet0"
type
ContainerCmd = enum
restart
stop
iterator containers: tuple[cmd: ContainerCmd, node, container: string, firstValidator, lastValidator: int] =
for i in 0 ..< serverCount:
let baseIdx = userValidators + i * validatorsPerServer
for j in 1 .. instancesCount:
let firstIdx = baseIdx + j * validatorsPerNode
let lastIdx = firstIdx + validatorsPerNode - 1
yield (restart, &"nimbus-node-0{i}", &"beacon-node-{network}-{j}", firstIdx, lastIdx)
when false:
for i in 0 ..< serverCount:
let baseIdx = userValidators + i * validatorsPerServer
for j in 1 .. instancesCount:
let firstIdx = baseIdx + (j - 1) * validatorsPerNode
let lastIdx = firstIdx + validatorsPerNode - 1
let dockerPath = &"/docker/beacon-node-{network}-{j}/data/BeaconNode/{network}"
echo &"ssh nimbus-node-0{i} 'sudo mkdir -p {dockerPath}/validators && sudo rm -f {dockerPath}/validators/* && " &
&"sudo ~/nimbus/vendor/nim-beacon-chain/scripts/download_validator_keys.sh {network} {firstIdx} {lastIdx} {dockerPath} && " &
&"sudo chown dockremap:docker -R {dockerPath}'"
for c in containers():
echo &"ssh {c.node} docker {c.cmd} {c.container}"