From 514d19ca3d57224c0206a2017dee50860b7a1ca5 Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Thu, 25 May 2023 20:49:54 -0500 Subject: [PATCH] Make a separate lighthouse container for the plugeth fixturenet. --- .../docker-compose-fixturenet-plugeth.yml | 12 +++---- .../Dockerfile | 34 +++++++++++++++++++ .../build.sh | 20 +++++++++++ .../Dockerfile | 0 .../build.sh | 6 ++-- .../stacks/fixturenet-plugeth-tx/stack.yml | 4 +-- 6 files changed, 65 insertions(+), 11 deletions(-) create mode 100644 app/data/container-build/cerc-fixturenet-plugeth-lighthouse/Dockerfile create mode 100755 app/data/container-build/cerc-fixturenet-plugeth-lighthouse/build.sh rename app/data/container-build/{cerc-fixturenet-eth-plugeth => cerc-fixturenet-plugeth-plugeth}/Dockerfile (100%) rename app/data/container-build/{cerc-fixturenet-eth-plugeth => cerc-fixturenet-plugeth-plugeth}/build.sh (64%) diff --git a/app/data/compose/docker-compose-fixturenet-plugeth.yml b/app/data/compose/docker-compose-fixturenet-plugeth.yml index 9011c8ed..58b00dc6 100644 --- a/app/data/compose/docker-compose-fixturenet-plugeth.yml +++ b/app/data/compose/docker-compose-fixturenet-plugeth.yml @@ -6,7 +6,7 @@ services: - ../config/fixturenet-eth/fixturenet-eth.env environment: RUN_BOOTNODE: "true" - image: cerc/fixturenet-eth-plugeth:local + image: cerc/fixturenet-plugeth-plugeth:local volumes: - fixturenet_plugeth_bootnode_geth_data:/root/ethdata - ../config/fixturenet-plugeth/plugins:/root/ethdata/plugins @@ -26,7 +26,7 @@ services: CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG} env_file: - ../config/fixturenet-eth/fixturenet-eth.env - image: cerc/fixturenet-eth-plugeth:local + image: cerc/fixturenet-plugeth-plugeth:local volumes: - fixturenet_plugeth_geth_1_data:/root/ethdata - ../config/fixturenet-plugeth/plugins:/root/ethdata/plugins @@ -56,7 +56,7 @@ services: CERC_KEEP_RUNNING_AFTER_GETH_EXIT: "true" env_file: - ../config/fixturenet-eth/fixturenet-eth.env - image: cerc/fixturenet-eth-plugeth:local + image: cerc/fixturenet-plugeth-plugeth:local depends_on: - fixturenet-eth-bootnode-geth volumes: @@ -68,7 +68,7 @@ services: hostname: fixturenet-eth-bootnode-lighthouse environment: RUN_BOOTNODE: "true" - image: cerc/fixturenet-eth-lighthouse:local + image: cerc/fixturenet-plugeth-lighthouse:local fixturenet-eth-lighthouse-1: restart: always @@ -85,7 +85,7 @@ services: NODE_NUMBER: "1" ETH1_ENDPOINT: "http://fixturenet-eth-geth-1:8545" EXECUTION_ENDPOINT: "http://fixturenet-eth-geth-1:8551" - image: cerc/fixturenet-eth-lighthouse:local + image: cerc/fixturenet-plugeth-lighthouse:local volumes: - fixturenet_plugeth_lighthouse_1_data:/opt/testnet/build/cl depends_on: @@ -112,7 +112,7 @@ services: ETH1_ENDPOINT: "http://fixturenet-eth-geth-2:8545" EXECUTION_ENDPOINT: "http://fixturenet-eth-geth-2:8551" LIGHTHOUSE_GENESIS_STATE_URL: "http://fixturenet-eth-lighthouse-1:8001/eth/v2/debug/beacon/states/0" - image: cerc/fixturenet-eth-lighthouse:local + image: cerc/fixturenet-plugeth-lighthouse:local volumes: - fixturenet_plugeth_lighthouse_2_data:/opt/testnet/build/cl depends_on: diff --git a/app/data/container-build/cerc-fixturenet-plugeth-lighthouse/Dockerfile b/app/data/container-build/cerc-fixturenet-plugeth-lighthouse/Dockerfile new file mode 100644 index 00000000..8701fe2d --- /dev/null +++ b/app/data/container-build/cerc-fixturenet-plugeth-lighthouse/Dockerfile @@ -0,0 +1,34 @@ +FROM sigp/lcli:v4.1.0 AS lcli +FROM skylenet/ethereum-genesis-generator@sha256:210353ce7c898686bc5092f16c61220a76d357f51eff9c451e9ad1b9ad03d4d3 AS ethgen +FROM cerc/fixturenet-plugeth-plugeth:local AS fnetgeth + +FROM cerc/lighthouse:local + +# cerc/lighthouse is based on Ubuntu +RUN apt-get update && apt-get -y upgrade && apt-get install -y --no-install-recommends \ + libssl-dev ca-certificates \ + curl socat iproute2 telnet wget jq \ + build-essential python3 python3-dev python3-pip gettext-base \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +COPY genesis /opt/testnet +COPY run-cl.sh /opt/testnet/run.sh + +COPY --from=lcli /usr/local/bin/lcli /usr/local/bin/lcli +COPY --from=ethgen /usr/local/bin/eth2-testnet-genesis /usr/local/bin/eth2-testnet-genesis +COPY --from=ethgen /usr/local/bin/eth2-val-tools /usr/local/bin/eth2-val-tools +COPY --from=ethgen /apps /apps +COPY --from=fnetgeth /opt/testnet/el /opt/testnet/el +COPY --from=fnetgeth /opt/testnet/build/el /opt/testnet/build/el + +RUN cd /opt/testnet && make genesis-cl + +# Work around some bugs in lcli where the default path is always used. +RUN mkdir -p /root/.lighthouse && cd /root/.lighthouse && ln -s /opt/testnet/build/cl/testnet + +RUN mkdir -p /scripts +COPY scripts/status-internal.sh /scripts +COPY scripts/status.sh /scripts + +ENTRYPOINT ["/opt/testnet/run.sh"] diff --git a/app/data/container-build/cerc-fixturenet-plugeth-lighthouse/build.sh b/app/data/container-build/cerc-fixturenet-plugeth-lighthouse/build.sh new file mode 100755 index 00000000..dd823cd0 --- /dev/null +++ b/app/data/container-build/cerc-fixturenet-plugeth-lighthouse/build.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# Build cerc/fixturenet-plugeth-lighthouse + +source ${CERC_CONTAINER_BASE_DIR}/build-base.sh + +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +if [ ! -d "${SCRIPT_DIR}/genesis" ]; then + cp -frp ${SCRIPT_DIR}/../cerc-fixturenet-eth-lighthouse/genesis ${SCRIPT_DIR}/genesis +fi + +if [ ! -e "${SCRIPT_DIR}/run-cl.sh" ]; then + cp -fp ${SCRIPT_DIR}/../cerc-fixturenet-eth-lighthouse/run-cl.sh ${SCRIPT_DIR}/ +fi + +if [ ! -d "${SCRIPT_DIR}/scripts" ]; then + cp -frp ${SCRIPT_DIR}/../cerc-fixturenet-eth-lighthouse/scripts ${SCRIPT_DIR}/ +fi + +docker build -t cerc/fixturenet-plugeth-lighthouse:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} $SCRIPT_DIR diff --git a/app/data/container-build/cerc-fixturenet-eth-plugeth/Dockerfile b/app/data/container-build/cerc-fixturenet-plugeth-plugeth/Dockerfile similarity index 100% rename from app/data/container-build/cerc-fixturenet-eth-plugeth/Dockerfile rename to app/data/container-build/cerc-fixturenet-plugeth-plugeth/Dockerfile diff --git a/app/data/container-build/cerc-fixturenet-eth-plugeth/build.sh b/app/data/container-build/cerc-fixturenet-plugeth-plugeth/build.sh similarity index 64% rename from app/data/container-build/cerc-fixturenet-eth-plugeth/build.sh rename to app/data/container-build/cerc-fixturenet-plugeth-plugeth/build.sh index e81bc932..d1641bc6 100755 --- a/app/data/container-build/cerc-fixturenet-eth-plugeth/build.sh +++ b/app/data/container-build/cerc-fixturenet-plugeth-plugeth/build.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Build cerc/fixturenet-eth-plugeth +# Build cerc/fixturenet-plugeth-plugeth set -x source ${CERC_CONTAINER_BASE_DIR}/build-base.sh @@ -10,8 +10,8 @@ if [ ! -d "${SCRIPT_DIR}/genesis" ]; then cp -frp ${SCRIPT_DIR}/../cerc-fixturenet-eth-geth/genesis ${SCRIPT_DIR}/genesis fi -if [ ! -d "${SCRIPT_DIR}/run-el.sh" ]; then +if [ ! -e "${SCRIPT_DIR}/run-el.sh" ]; then cp -fp ${SCRIPT_DIR}/../cerc-fixturenet-eth-geth/run-el.sh ${SCRIPT_DIR}/ fi -docker build -t cerc/fixturenet-eth-plugeth:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} $SCRIPT_DIR +docker build -t cerc/fixturenet-plugeth-plugeth:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} $SCRIPT_DIR diff --git a/app/data/stacks/fixturenet-plugeth-tx/stack.yml b/app/data/stacks/fixturenet-plugeth-tx/stack.yml index 14637da3..c076d852 100644 --- a/app/data/stacks/fixturenet-plugeth-tx/stack.yml +++ b/app/data/stacks/fixturenet-plugeth-tx/stack.yml @@ -5,8 +5,8 @@ repos: - github.com/cerc-io/tx-spammer containers: - cerc/lighthouse - - cerc/fixturenet-eth-plugeth - - cerc/fixturenet-eth-lighthouse + - cerc/fixturenet-plugeth-plugeth + - cerc/fixturenet-plugeth-lighthouse - cerc/tx-spammer pods: - fixturenet-plugeth