Support hosts passed with grpc://
PiperOrigin-RevId: 235994227
This commit is contained in:
parent
9d6f413123
commit
a479cf46c3
@ -58,6 +58,11 @@ def connect_to_remote_host(remote_host=None, job_name="worker"):
|
|||||||
"""
|
"""
|
||||||
if remote_host is None:
|
if remote_host is None:
|
||||||
raise ValueError("Must provide an remote_host")
|
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()
|
cluster_def = ClusterDef()
|
||||||
job_def = cluster_def.job.add()
|
job_def = cluster_def.job.add()
|
||||||
job_def.name = job_name
|
job_def.name = job_name
|
||||||
|
Loading…
Reference in New Issue
Block a user