Skip to content

Commit 6bc88b5

Browse files
committed
Use docker-run instead of docker for script action
1 parent 25e0945 commit 6bc88b5

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

mlc/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def build_parser(pre_args):
140140
p.add_argument('extra', nargs=argparse.REMAINDER)
141141

142142
# Script-only
143-
for action in ['docker', 'experiment', 'doc', 'lint']:
143+
for action in ['docker', 'docker-run', 'experiment', 'doc', 'lint']:
144144
p = subparsers.add_parser(action, add_help=False)
145145
p.add_argument('target', choices=['script', 'run'])
146146
p.add_argument('details', nargs='?', help='Details or identifier (optional)')
@@ -172,7 +172,7 @@ def build_run_args(args):
172172
if args.command in ['pull', 'rm', 'add', 'find'] and args.target == "repo":
173173
run_args['repo'] = args.details
174174

175-
if args.command in ['docker', 'experiment', 'doc', 'lint'] and args.target == "run":
175+
if args.command in ['docker', 'docker-run', 'experiment', 'doc', 'lint'] and args.target == "run":
176176
run_args['target'] = 'script'
177177
args.target = "script"
178178

@@ -208,7 +208,7 @@ def main():
208208
209209
| Target | Actions |
210210
|---------|-------------------------------------------------------|
211-
| script | run, find/search, rm, mv, cp, add, test, docker, show |
211+
| script | run, find/search, rm, mv, cp, add, test, docker-run, show |
212212
| cache | find/search, rm, show |
213213
| repo | pull, search, rm, list, find/search |
214214
@@ -242,7 +242,7 @@ def main():
242242
if pre_args.help and not "tags" in run_args:
243243
help_text = ""
244244
if pre_args.target == "run":
245-
if pre_args.action == "docker":
245+
if pre_args.action.startswith("docker"):
246246
pre_args.target = "script"
247247
else:
248248
logger.error(f"Invalid action-target {pre_args.action} - {pre_args.target} combination")

mlc/script_action.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@ def call_script_module_function(self, function_name, run_args):
253253
return {'return': 1, 'error': 'ScriptAutomation class not found in the script.'}
254254

255255
def docker(self, run_args):
256+
self.docker_run(run_args)
257+
258+
def docker_run(self, run_args):
256259
"""
257260
####################################################################################################################
258261
Target: Script

0 commit comments

Comments
 (0)