satnogs-wut/wut-worker

27 lines
612 B
Bash
Executable File

#!/bin/bash
# wut-worker
#
# Starts worker client.
#
# Usage:
# wut-worker
# Example:
# wut-worker
#
# 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'`
#let HOSTNUM=$HOSTNUM-1
export TF_CONFIG='{"cluster": {"worker": [ "10.100.100.130:2222", "ml1:2222", "ml2:2222", "ml3:2222", "ml4:2222", "ml5:2222"]}, "task": {"index": '$HOSTNUM', "type": "worker"}}'
echo $TF_CONFIG
python3 wut-worker.py