Fix outdated build options in the Dockerfiles

This commit is contained in:
Zahary Karadjov 2019-06-19 21:48:16 +03:00
parent 8241320171
commit 4ff8a7cdf7
3 changed files with 49 additions and 4 deletions

View File

@ -33,7 +33,7 @@ RUN cd nimbus \
-d:release \ -d:release \
--debugger:native \ --debugger:native \
--debugInfo \ --debugInfo \
-d:with${NETWORK_BACKEND} \ -d:"network_type=${NETWORK_BACKEND}" \
-d:SHARD_COUNT=${SHARD_COUNT} \ -d:SHARD_COUNT=${SHARD_COUNT} \
-d:SLOTS_PER_EPOCH=${SLOTS_PER_EPOCH} \ -d:SLOTS_PER_EPOCH=${SLOTS_PER_EPOCH} \
-d:SECONDS_PER_SLOT=${SECONDS_PER_SLOT} \ -d:SECONDS_PER_SLOT=${SECONDS_PER_SLOT} \

View File

@ -6,7 +6,7 @@ cd $(dirname "$0")
export GIT_REVISION=$(git rev-parse HEAD) export GIT_REVISION=$(git rev-parse HEAD)
NETWORK=testnet0 NETWORK=testnet1
if [[ $(git rev-parse --abbrev-ref HEAD) == "devel" ]]; then if [[ $(git rev-parse --abbrev-ref HEAD) == "devel" ]]; then
NETWORK=testnet1 NETWORK=testnet1
@ -19,5 +19,6 @@ buildAndPush() {
(cd beacon_node && make push) (cd beacon_node && make push)
} }
buildAndPush $NETWORK rlpx # buildAndPush $NETWORK rlpx
#buildAndPush testnet0 libp2p buildAndPush $NETWORK libp2p_spec

44
docker/hosts.nims Normal file
View File

@ -0,0 +1,44 @@
import strformat
var
serverCount = 10
instancesCount = 2
totalValidators = 1000
userValidators = 200
systemValidators = totalValidators - userValidators
validatorsPerServer = systemValidators div serverCount
validatorsPerNode = validatorsPerServer div instancesCount
network = "testnet1"
buildFlavour = "libp2p_spec"
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 0 ..< instancesCount:
let firstIdx = baseIdx + j * validatorsPerNode
let lastIdx = firstIdx + validatorsPerNode - 1
yield (restart, &"nimbus-node-0{i}", &"beacon-node-{buildFlavour}-{network}-{j}", firstIdx, lastIdx)
for j in instancesCount .. 2:
yield (stop, &"nimbus-node-0{i}", &"beacon-node-{buildFlavour}-{network}-{j}", -1, -1)
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-{buildFlavour}-{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}"