python-mlboardclient contains the tf_conf script which can be used to generate TensorFlow config for distributed training:
For worker:
TF_CONFIG=$(tf_conf worker) python <train-script.py>
For parameter server:
TF_CONFIG=$(tf_conf ps) python <train-script.py>