Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions clients/lighthouse-bn/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ RUN chmod +x /lighthouse_bn.sh

ADD lighthouse_version.sh /lighthouse_version.sh
RUN chmod +x /lighthouse_version.sh
ADD lighthouse_shutdown.sh /hive-bin/shutdown.sh
RUN chmod +x /hive-bin/shutdown.sh

RUN /lighthouse_version.sh > /version.txt

Expand Down
22 changes: 22 additions & 0 deletions clients/lighthouse-bn/lighthouse_shutdown.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Immediately abort the script on any error encountered
set -e

# Send CTRL+C to start the shutdown process
kill -SIGINT $(pgrep lighthouse)

# Wait for graceful shutdown
TIMEOUT_SECONDS=20
while pgrep lighthouse; do
if (( TIMEOUT_SECONDS == 0 )); then
break
fi
sleep 1
(( TIMEOUT_SECONDS-- ))
done

# Forcefully kill if it did not shutdown
if pgrep lighthouse; then
kill -9 $(pgrep lighthouse)
fi
4 changes: 4 additions & 0 deletions clients/nimbus-bn/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ RUN usr/bin/nimbus_beacon_node --version > /version.txt

ADD nimbus_bn.sh /nimbus_bn.sh
RUN chmod +x /nimbus_bn.sh
ADD nimbus_shutdown.sh /hive-bin/shutdown.sh
RUN chmod +x /hive-bin/shutdown.sh

RUN apt-get update -y && apt-get install -y procps

# TODO: output accurate client version
RUN usr/bin/nimbus_beacon_node --version > /version.txt
Expand Down
22 changes: 22 additions & 0 deletions clients/nimbus-bn/nimbus_shutdown.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Immediately abort the script on any error encountered
set -e

# Send CTRL+C to start the shutdown process
kill -SIGINT $(pgrep nimbus_beacon_node)

# Wait for graceful shutdown
TIMEOUT_SECONDS=20
while pgrep nimbus_beacon_node; do
if (( TIMEOUT_SECONDS == 0 )); then
break
fi
sleep 1
(( TIMEOUT_SECONDS-- ))
done

# Forcefully kill if it did not shutdown
if pgrep nimbus_beacon_node; then
kill -9 $(pgrep nimbus_beacon_node)
fi
4 changes: 4 additions & 0 deletions clients/prysm-bn/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ COPY --from=upstream /app/cmd/beacon-chain/beacon-chain beacon-chain

ADD prysm_bn.sh /prysm_bn.sh
RUN chmod +x /prysm_bn.sh
ADD prysm_shutdown.sh /hive-bin/shutdown.sh
RUN chmod +x /hive-bin/shutdown.sh

RUN apt-get update -y && apt-get install -y procps

RUN /beacon-chain --version > /version.txt

Expand Down
2 changes: 1 addition & 1 deletion clients/prysm-bn/prysm_bn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ echo Starting Prysm Beacon Node
--p2p-udp-port="${HIVE_ETH2_P2P_UDP_PORT:-9000}" \
--p2p-host-ip="${CONTAINER_IP}" \
--p2p-local-ip="${CONTAINER_IP}" \
--http-web3provider="$HIVE_ETH2_ETH1_RPC_ADDRS" \
--execution-endpoint="$HIVE_ETH2_ETH1_RPC_ADDRS" \
--jwt-secret=/jwtsecret \
--min-sync-peers=1 \
--subscribe-all-subnets=true \
Expand Down
22 changes: 22 additions & 0 deletions clients/prysm-bn/prysm_shutdown.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Immediately abort the script on any error encountered
set -e

# Send CTRL+C to start the shutdown process
kill -SIGINT $(pgrep beacon-chain)

# Wait for graceful shutdown
TIMEOUT_SECONDS=20
while pgrep beacon-chain; do
if (( TIMEOUT_SECONDS == 0 )); then
break
fi
sleep 1
(( TIMEOUT_SECONDS-- ))
done

# Forcefully kill if it did not shutdown
if pgrep beacon-chain; then
kill -9 $(pgrep beacon-chain)
fi
4 changes: 3 additions & 1 deletion clients/teku-bn/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ FROM consensys/teku:$branch
USER root

ADD teku_bn.sh /opt/teku/bin/teku_bn.sh
RUN chmod +x /opt/teku/bin//teku_bn.sh
RUN chmod +x /opt/teku/bin/teku_bn.sh
ADD teku_shutdown.sh /hive-bin/shutdown.sh
RUN chmod +x /hive-bin/shutdown.sh

RUN ./bin/teku --version > /version.txt > /version.txt

Expand Down
22 changes: 22 additions & 0 deletions clients/teku-bn/teku_shutdown.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Immediately abort the script on any error encountered
set -e

# Send CTRL+C to start the shutdown process
kill -SIGINT $(pgrep teku)

# Wait for graceful shutdown
TIMEOUT_SECONDS=20
while pgrep teku; do
if (( TIMEOUT_SECONDS == 0 )); then
break
fi
sleep 1
(( TIMEOUT_SECONDS-- ))
done

# Forcefully kill if it did not shutdown
if pgrep teku; then
kill -9 $(pgrep teku)
fi