Skip to content

add autoUpgrade script

Luke Champine requested to merge upgrade into master

This script takes a subnet (e.g. 192.168.10) as an argument and spawns a process for every IP in the subnet (192.168.10.0 through 192.168.10.255) that repeatedly attempts to upgrade the miner at that IP address every 10 seconds. The process runs in a loop forever, with the expectation that miners may be connected and disconnected while it runs (in other words, an upgraded miner at 192.168.10.12 could be disconnected and replaced with an un-upgraded miner at the same IP, so the script cannot assume that each IP corresponds to a single machine).

The upgrade process works like so:

  1. Attempt to ssh into the machine using obelisk credentials, giving up after 5 seconds
  2. If successful, check for the existence of the /root/.upgrade_complete file
  3. If the file exists, the machine has already been upgraded; exit
  4. Otherwise, prepare the machine by creating a folder in /tmp to hold the upgrades, and begin alternating the LEDs
  5. quit the ssh session and scp the upgrades into the machine's /tmp/upgrades directory
  6. ssh back into the machine and move the upgrade files to their respective destinations
  7. start the burn-in test in the background (NOT IMPLEMENTED)
  8. create the /root/.upgrade_complete file, marking the machine as updated

The burn-in test binary should also handle switching the LEDs from alternative red/green to flashing green (or flashing red if an error was encountered). The current script simulates this by starting the led_flash_green binary manually.

The script is somewhat brittle currently, specifically in that it must be run from the src directory as the paths it uses are all relative to that directory. We may also want to tweak the 10 second/5 second timeouts.

Edited by Luke Champine

Merge request reports