Support hosts passed with grpc://

PiperOrigin-RevId: 235994227
This commit is contained in:
Sourabh Bajaj 2019-02-27 14:35:10 -08:00 committed by TensorFlower Gardener
parent 9d6f413123
commit a479cf46c3

View File

@ -58,6 +58,11 @@ def connect_to_remote_host(remote_host=None, job_name="worker"):
"""
if remote_host is None:
raise ValueError("Must provide an remote_host")
grpc_prefix = "grpc://"
if remote_host.startswith(grpc_prefix):
remote_host = remote_host[len(grpc_prefix):]
cluster_def = ClusterDef()
job_def = cluster_def.job.add()
job_def.name = job_name