satnogs-wut/wut-worker-train-cluster-fn

26 lines
662 B
Bash
Executable File

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