27 lines
587 B
Bash
Executable File
27 lines
587 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": ["ml1:2222", "ml2:2222", "ml3:2222", "ml4:2222", "ml5:2222"]}, "task": {"index": '$HOSTNUM', "type": "worker"}}'
|
|
|
|
echo $TF_CONFIG
|
|
python3 wut-worker.py
|
|
|