Skip to content

Commit

Permalink
Support run_deps for docker (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsuresh committed Feb 2, 2024
1 parent 05530cf commit 2ffc7d6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cm-mlops/automation/script/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -2525,7 +2525,7 @@ def _call_run_deps(script, deps, local_env_keys, local_env_keys_from_meta, env,
##############################################################################
def _run_deps(self, deps, clean_env_keys_deps, env, state, const, const_state, add_deps_recursive, recursion_spaces,
remembered_selections, variation_tags_string='', from_cache=False, debug_script_tags='',
verbose=False, show_time=False, extra_recursion_spaces=' ', run_state={'deps':[], 'fake_deps':[]}):
verbose=False, show_time=False, extra_recursion_spaces=' ', run_state={'deps':[], 'fake_deps':[], 'parent': None}):
"""
Runs all the enabled dependencies and pass them env minus local env
"""
Expand Down
15 changes: 12 additions & 3 deletions cm-mlops/automation/script/module_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1537,7 +1537,7 @@ def docker(i):
return {'return':1, 'error':'no scripts were found'}

env=i.get('env', {})
env['CM_RUN_STATE_DOCKER'] = True
env['CM_RUN_STATE_DOCKER'] = False

docker_cache = i.get('docker_cache', "yes")
if docker_cache in ["no", False, "False" ]:
Expand Down Expand Up @@ -1599,8 +1599,16 @@ def docker(i):
update_path_for_docker('.', mounts, force_path_target=current_path_target)


_os = i.get('docker_os', meta.get('docker_os', 'ubuntu'))
version = i.get('docker_os_version', meta.get('docker_os_version', '22.04'))
_os = i.get('docker_os', docker_settings.get('docker_os', 'ubuntu'))
version = i.get('docker_os_version', docker_settings.get('docker_os_version', '22.04'))

deps = docker_settings.get('deps', [])
if deps:
# Todo: Support state, const and add_deps_recursive
script_automation = i['self_module']
r = script_automation._run_deps(deps, [], env, {}, {}, {}, {}, '',{})
if r['return'] > 0:
return r

for key in docker_settings.get('mounts', []):
mounts.append(key)
Expand Down Expand Up @@ -1722,6 +1730,7 @@ def docker(i):
if r['return']>0: return r

run_cmd = r['run_cmd_string']
env['CM_RUN_STATE_DOCKER'] = True

if docker_settings.get('mount_current_dir','')=='yes':
run_cmd = 'cd '+current_path_target+' && '+run_cmd
Expand Down
2 changes: 2 additions & 0 deletions cm-mlops/script/build-mlperf-inference-server-nvidia/_cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ docker:
tensorrt_tar_file_path: CM_TENSORRT_TAR_FILE_PATH
cuda_run_file_path: CUDA_RUN_FILE_LOCAL_PATH
scratch_path: MLPERF_SCRATCH_PATH
deps:
- tags: get,mlperf,inference,nvidia,scratch,space
mounts:
- "${{ IMAGENET_PATH }}:/data/imagenet-val"
- "${{ RESULTS_DIR }}:/home/cmuser/results_dir"
Expand Down

0 comments on commit 2ffc7d6

Please sign in to comment.