satnogs-wut/wut-worker

27 lines
608 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.
# The hosts are ml1 through ml5. The index starts at zero,
# so the index is hostname minus one (without alpha).
HOSTNUM=`hostname | sed -e 's/ml//g'`
2020-01-28 17:52:23 -07:00
let HOSTNUM=$HOSTNUM-1
2020-01-17 18:13:40 -07:00
2020-01-28 17:52:23 -07:00
export TF_CONFIG='{"cluster": {"worker": [ "ml1-int:2222", "ml2-int:2222", "ml3-int:2222", "ml4-int:2222", "ml5-int:2222"]}, "task": {"index": '$HOSTNUM', "type": "worker"}}'
2020-01-17 18:13:40 -07:00
echo $TF_CONFIG
2020-01-28 17:53:15 -07:00
python3 wut-worker.py
2020-01-17 18:13:40 -07:00