add python worker script, jupyter export

master
ml server 2020-01-17 18:17:09 -07:00
parent 06a05f26c8
commit 18b4b76466
1 changed files with 84 additions and 0 deletions

84
wut-worker.py 100644
View File

@ -0,0 +1,84 @@
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
# wut-worker --- Runs on worker nodes
#
#
# In[ ]:
import os
# In[ ]:
# Cluster
from __future__ import absolute_import, division, print_function, unicode_literals
import tensorflow as tf
import simplejson as json
# In[ ]:
# The script wut-worker launches this python script.
# It is better to do in the shell script, because the index has to be
# unique for each hostname.
#
# It has a line like:
# TF_CONFIG='{"cluster": {"worker": ["ml1:2222", "ml2:2222", "ml3:2222", "ml4:2222", "ml5:2222"]}, "task": {"index": 0, "type": "worker"}}' python3 wut-worker.py
# In[ ]:
#os.environ["TF_CONFIG"] = json.dumps({
# "cluster": {
# "worker": [ "ml1:2222", "ml2:2222", "ml3:2222", "ml4:2222", "ml5:2222" ]
# },
# "task": {"type": "worker", "index": 1},
# "num_workers": 5
#})
# In[ ]:
# In[ ]:
# In[ ]:
# In[ ]:
# In[ ]:
# In[ ]: