status-im / infra-role-beacon-node-linux

Ansible role for Nimbus Eth2 beacon node on Linux
https://github.com/status-im/nimbus-eth2
1 stars 4 forks source link

Develop deployment of binary using GitHub releaes #16

Open jakubgs opened 4 months ago

jakubgs commented 4 months ago

Currently some of our hosts like stable-small-01.aws-eu-central-1a.nimbus.mainnet are too low on memory to build the beacon node binary without hitting OOM killer or even becoming unresponsive to SSH connections. For that reason we need an alternative way to update the node binary by using GitHub releases as source of the binary.

Latest release can be accessed using: https://api.github.com/repos/status-im/nimbus-eth2/releases/latest

 > c https://api.github.com/repos/status-im/nimbus-eth2/releases/latest | jq -r '.assets[].name' | grep tar.gz
nimbus-eth2_Linux_amd64_24.2.1_7fe43fc2.tar.gz
nimbus-eth2_Linux_arm32v7_24.2.1_7fe43fc2.tar.gz
nimbus-eth2_Linux_arm64v8_24.2.1_7fe43fc2.tar.gz
nimbus-eth2_macOS_amd64_24.2.1_7fe43fc2.tar.gz
nimbus-eth2_macOS_arm64_24.2.1_7fe43fc2.tar.gz
nimbus-eth2_Windows_amd64_24.2.1_7fe43fc2.tar.gz

The only annoying thing is that the current update timer name starts with build-. I'd prefer if the name was the same for the timer regardless of whether it builds or downloads. Some options are:

apentori commented 3 months ago

Before running the new version of the role, the following procedure must be done to stop the renamed service and timer and drop the associated consul service:

The variables NETWORK and NODE must be set, ex export NETWORK=prater and export NODE=stable

echo "Network is ${NETWORK}"
echo "Node is ${NODE}"

sudo systemctl  disable build-beacon-node-${NETWORK}-${NODE}.timer
sudo systemctl  stop build-beacon-node-${NETWORK}-${NODE}.timer
sudo rm /etc/systemd/system/build-beacon-node-${NETWORK}-${NODE}.timer
sudo rm /etc/systemd/system/build-beacon-node-${NETWORK}-${NODE}.service

sudo rm /etc/consul/service_build_beacon_node_${NETWORK}_${NODE}_timer.json
consul services deregister -id=build-beacon-node-${NETWORK}-${NODE}-timer
jakubgs commented 3 months ago

I would implement this temporarily as part of the Ansible role to avoid confusion, and remove it later once we are sure all have been updated to the new setup.