Skip to content

Commit 84b2638

Browse files
Use the original argument name image_name instead of image for train | predict | evaluate. (#2092)
* Add the version for the docker python package. * Add the method declaration for the argument parser. * Add the arguments for train|predict|evaluate * Copy common modules from elasticdl main package to elasticdl_client package. * Call _submit_job in train api * Add k8s_resource module. * Set default value for extra_pypi_index arguments. * Update the default base image value to be python:3.7 * Update the argument description. * Make --image arguments to be required * Add the implementation of evaluate and predict * Update the default base image to be python:3.6 * Remove clean command. * Add comments. * Rename model_utils to module_utils * Simplify the function in k8s_client in elasticdl_client package. * Remove unnecessary event_cb in k8s_client in elasticdl_client package. * Use argument name image_name instead of image for train|predict|evaluate.
1 parent deee146 commit 84b2638

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

elasticdl_client/api.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def push_zoo(args):
106106
def train(args):
107107
container_args = [
108108
"--worker_image",
109-
args.image,
109+
args.image_name,
110110
"--model_zoo",
111111
args.model_zoo,
112112
"--cluster_spec",
@@ -126,13 +126,13 @@ def train(args):
126126
)
127127
)
128128

129-
_submit_job(args.image, args, container_args)
129+
_submit_job(args.image_name, args, container_args)
130130

131131

132132
def evaluate(args):
133133
container_args = [
134134
"--worker_image",
135-
args.image,
135+
args.image_name,
136136
"--model_zoo",
137137
args.model_zoo,
138138
"--cluster_spec",
@@ -151,13 +151,13 @@ def evaluate(args):
151151
)
152152
)
153153

154-
_submit_job(args.image, args, container_args)
154+
_submit_job(args.image_name, args, container_args)
155155

156156

157157
def predict(args):
158158
container_args = [
159159
"--worker_image",
160-
args.image,
160+
args.image_name,
161161
"--model_zoo",
162162
args.model_zoo,
163163
"--cluster_spec",
@@ -176,7 +176,7 @@ def predict(args):
176176
)
177177
)
178178

179-
_submit_job(args.image, args, container_args)
179+
_submit_job(args.image_name, args, container_args)
180180

181181

182182
def _submit_job(image_name, client_args, container_args):

elasticdl_client/common/args.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def add_common_params(parser):
208208
"""Common arguments for training/prediction/evaluation"""
209209
add_common_args_between_master_and_worker(parser)
210210
parser.add_argument(
211-
"--image",
211+
"--image_name",
212212
type=str,
213213
required=True,
214214
help="The docker image for this job.",

elasticdl_client/common/k8s_client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ def __init__(
9999
cluster_spec_module = load_module(cluster_spec)
100100
self.cluster = cluster_spec_module.cluster
101101

102+
def get_master_pod_name(self):
103+
return get_master_pod_name(self.job_name)
104+
102105
def patch_labels_to_pod(self, pod_name, labels_dict):
103106
body = {"metadata": {"labels": labels_dict}}
104107
try:

0 commit comments

Comments
 (0)