satnogs-wut/src/wut-worker

27 lines
691 B
Plaintext
Raw Normal View History

2020-01-17 18:05:28 -07:00
#!/bin/bash
2020-01-28 17:53:15 -07:00
# wut-worker
2020-01-17 18:05:28 -07:00
#
# Starts worker client.
#
# Usage:
2020-01-28 17:53:15 -07:00
# wut-worker
2020-01-17 18:05:28 -07:00
# Example:
2020-01-28 17:53:15 -07:00
# wut-worker
2020-01-17 18:13:40 -07:00
#
# Note:
# Each node needs a unique index number.
#
# NOTE!
# This generates the node number based off the hostname.
2022-08-17 10:19:24 -06:00
# The hosts are rs-ml1 through rs-ml10. The index starts at zero,
2020-01-17 18:13:40 -07:00
# so the index is hostname minus one (without alpha).
2022-08-17 10:19:24 -06:00
HOSTNUM=`hostname | sed -e 's/rs-ml//g'`
2020-01-28 17:52:23 -07:00
let HOSTNUM=$HOSTNUM-1
2020-01-17 18:13:40 -07:00
2022-08-17 10:15:57 -06:00
export TF_CONFIG='{"cluster": {"worker": [ "rs-ml1:23009", "rs-ml2:23009", "rs-ml3:23009", "rs-ml4:23009", "rs-ml5:23009", "rs-ml6:23009", "rs-ml7:23009", "rs-ml8:23009", "rs-ml9:23009", "rs-ml10:23009"]}, "task": {"index": '$HOSTNUM', "type": "worker"}}'
2020-01-17 18:13:40 -07:00
echo $TF_CONFIG
2022-08-17 10:23:33 -06:00
wut-worker.py
2020-01-17 18:13:40 -07:00