Skip to content

Commit 37c8c8f

Browse files
authored
Remove "elasticdl-" prefix to ps/worker pod name (#2489)
* remove prefix to ps/worker pod name * fix tests * fix black
1 parent 299ef38 commit 37c8c8f

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

elasticdl/python/common/k8s_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131

3232

3333
def get_worker_pod_name(job_name, worker_id):
34-
return "elasticdl-%s-worker-%s" % (job_name, str(worker_id))
34+
return "%s-worker-%s" % (job_name, str(worker_id))
3535

3636

3737
def get_ps_pod_name(job_name, ps_id):
38-
return "elasticdl-%s-ps-%s" % (job_name, str(ps_id))
38+
return "%s-ps-%s" % (job_name, str(ps_id))
3939

4040

4141
class Client(BaseClient):

elasticdl/python/tests/pod_manager_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,11 @@ def test_get_tf_config_data(self):
316316

317317
tf_config_cluster = '{"cluster": \
318318
{"ps": \
319-
["elasticdl-JOBNAME-ps-0.NAMESPACE.svc:PSPORT", \
320-
"elasticdl-JOBNAME-ps-1.NAMESPACE.svc:PSPORT"], \
319+
["JOBNAME-ps-0.NAMESPACE.svc:PSPORT", \
320+
"JOBNAME-ps-1.NAMESPACE.svc:PSPORT"], \
321321
"worker": \
322-
["elasticdl-JOBNAME-worker-0.NAMESPACE.svc:WORKERPORT", \
323-
"elasticdl-JOBNAME-worker-1.NAMESPACE.svc:WORKERPORT"] \
322+
["JOBNAME-worker-0.NAMESPACE.svc:WORKERPORT", \
323+
"JOBNAME-worker-1.NAMESPACE.svc:WORKERPORT"] \
324324
}}'
325325
tf_config_cluster = tf_config_cluster.replace("JOBNAME", job_name)
326326
tf_config_cluster = tf_config_cluster.replace("NAMESPACE", namespace)

scripts/validate_job_status.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,10 @@ def check_failed(statuses):
8989

9090
def validate_job_status(client, job_type, ps_num, worker_num):
9191
ps_pod_names = [
92-
"elasticdl-test-" + job_type + "-ps-" + str(i) for i in range(ps_num)
92+
"test-" + job_type + "-ps-" + str(i) for i in range(ps_num)
9393
]
9494
worker_pod_names = [
95-
"elasticdl-test-" + job_type + "-worker-" + str(i)
96-
for i in range(worker_num)
95+
"test-" + job_type + "-worker-" + str(i) for i in range(worker_num)
9796
]
9897
master_pod_name = "elasticdl-test-" + job_type + "-master"
9998

0 commit comments

Comments
 (0)