Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rclone config #1093

Merged
merged 17 commits into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
2 changes: 1 addition & 1 deletion cm-mlops/script/download-file/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def preprocess(i):
elif tool == "rclone":
if env.get('CM_RCLONE_CONFIG_CMD', '') != '':
env['CM_DOWNLOAD_CONFIG_CMD'] = env['CM_RCLONE_CONFIG_CMD']
env['CM_DOWNLOAD_CMD'] = f"rclone copy {url} ./{env['CM_DOWNLOAD_FILENAME']} -P"
env['CM_DOWNLOAD_CMD'] = f"rclone copy {url} {os.path.join(os.getcwd(), env['CM_DOWNLOAD_FILENAME'])} -P"

filename = env['CM_DOWNLOAD_FILENAME']
env['CM_DOWNLOAD_DOWNLOADED_FILENAME'] = filename
Expand Down
12 changes: 8 additions & 4 deletions cm-mlops/script/get-ml-model-gptj/_cm.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"prehook_deps": [
{
"env": {
"CM_DOWNLOAD_FINAL_ENV_NAME": "GPTJ_CHECKPOINT_PATH",
"CM_EXTRACT_FINAL_ENV_NAME": "GPTJ_CHECKPOINT_PATH",
"CM_EXTRACT_TO_FOLDER": "gpt-j"
},
Expand Down Expand Up @@ -81,13 +82,14 @@
"pytorch,fp32": {
"env": {
"CM_DOWNLOAD_EXTRA_OPTIONS": " --output-document checkpoint.zip",
"CM_DOWNLOAD_FILENAME": "checkpoint.zip",
"CM_UNZIP": "yes",
"CM_DOWNLOAD_CHECKSUM_NOT_USED": "e677e28aaf03da84584bb3073b7ee315",
"CM_PACKAGE_URL": "https://cloud.mlcommons.org/index.php/s/QAZ2oM94MkFtbQx/download",
"CM_RCLONE_CONFIG": "rclone config create mlc-inference s3 provider=LyveCloud access_key_id=0LITLNQMHZALM5AK secret_access_key=YQKYTMBY23TMZHLOYFJKL5CHHS0CWYUC endpoint=s3.us-east-1.lyvecloud.seagate.com",
"CM_RCLONE_CONFIG_CMD": "rclone config create mlc-inference s3 provider=LyveCloud access_key_id=0LITLNQMHZALM5AK secret_access_key=YQKYTMBY23TMZHLOYFJKL5CHHS0CWYUC endpoint=s3.us-east-1.lyvecloud.seagate.com",
"CM_RCLONE_URL": "mlc-inference:mlcommons-inference-wg-s3/gpt-j"
},
}
},
"pytorch,fp32,wget": {
"add_deps_recursive": {
"dae": {
"tags": "_extract"
Expand Down Expand Up @@ -186,7 +188,8 @@
}
},
"env": {
"CM_DOWNLOAD_URL": "<<<CM_PACKAGE_URL>>>"
"CM_DOWNLOAD_URL": "<<<CM_PACKAGE_URL>>>",
"CM_DOWNLOAD_FILENAME": "checkpoint.zip"
}
},
"rclone": {
Expand All @@ -197,6 +200,7 @@
}
},
"env": {
"CM_DOWNLOAD_FILENAME": "checkpoint",
"CM_DOWNLOAD_URL": "<<<CM_RCLONE_URL>>>"
}
},
Expand Down
2 changes: 1 addition & 1 deletion cm-mlops/script/get-ml-model-stable-diffusion/_cm.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
"rclone": {
"group": "download-tool",
"env": {
"CM_RCLONE_CONFIG": "rclone config create mlc-inference s3 provider=LyveCloud access_key_id=0LITLNQMHZALM5AK secret_access_key=YQKYTMBY23TMZHLOYFJKL5CHHS0CWYUC endpoint=s3.us-east-1.lyvecloud.seagate.com",
"CM_RCLONE_CONFIG_CMD": "rclone config create mlc-inference s3 provider=LyveCloud access_key_id=0LITLNQMHZALM5AK secret_access_key=YQKYTMBY23TMZHLOYFJKL5CHHS0CWYUC endpoint=s3.us-east-1.lyvecloud.seagate.com",
"CM_DOWNLOAD_TOOL": "rclone"
},
"adr": {
Expand Down
4 changes: 4 additions & 0 deletions cm-mlops/script/get-rclone/run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/bin/bash
if ! command -v rclone &> /dev/null
then
exit 1
fi
rclone --version > tmp-ver.out
test $? -eq 0 || exit 1
Loading