diff --git a/docker/nimbus/Dockerfile b/docker/Dockerfile similarity index 100% rename from docker/nimbus/Dockerfile rename to docker/Dockerfile diff --git a/docker/nimbus/Makefile b/docker/Makefile similarity index 100% rename from docker/nimbus/Makefile rename to docker/Makefile diff --git a/docker/beacon_node/Dockerfile b/docker/beacon_node/Dockerfile deleted file mode 100644 index d3b5a2ed8..000000000 --- a/docker/beacon_node/Dockerfile +++ /dev/null @@ -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 -LABEL description="Nimbus installation that can act as an ETH2 network bootstrap node." - -ENTRYPOINT ["/usr/bin/run_beacon_node.sh"] diff --git a/docker/beacon_node/Makefile b/docker/beacon_node/Makefile deleted file mode 100644 index 2b2c08203..000000000 --- a/docker/beacon_node/Makefile +++ /dev/null @@ -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) diff --git a/docker/beacon_node/README.md b/docker/beacon_node/README.md deleted file mode 100644 index 0eadb99d3..000000000 --- a/docker/beacon_node/README.md +++ /dev/null @@ -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). diff --git a/docker/beacon_node/run_in_docker.sh b/docker/beacon_node/run_in_docker.sh deleted file mode 100755 index 7011dc71a..000000000 --- a/docker/beacon_node/run_in_docker.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -killall p2pd -rm -rf /tmp/* - -beacon_node --nat:none $* - diff --git a/docker/build_beacon_node.sh b/docker/build_beacon_node.sh deleted file mode 100755 index d71dd2a65..000000000 --- a/docker/build_beacon_node.sh +++ /dev/null @@ -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 - diff --git a/docker/build_nimbus.sh b/docker/build_nimbus.sh deleted file mode 100755 index 92772ddeb..000000000 --- a/docker/build_nimbus.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -set -euv -cd $(dirname "$0") - -export GIT_REVISION=$(git rev-parse HEAD) - -(cd nimbus && make push) - diff --git a/docker/hosts.nims b/docker/hosts.nims deleted file mode 100644 index b652fd9d0..000000000 --- a/docker/hosts.nims +++ /dev/null @@ -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}" -