forked from mlcommons/cm4mlops
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added get-rclone-config script for mlc-inference mlcommons#172
- Loading branch information
1 parent
45b6981
commit 18a55b8
Showing
4 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
alias: get-rclone-config | ||
automation_alias: script | ||
automation_uid: 5b4e0237da074764 | ||
cache: false #keeping cache off as rerunning the command is safe | ||
can_force_cache: true | ||
tags: | ||
- get | ||
- rclone-config | ||
uid: 6c59ddbc6cd046e3 | ||
variations: | ||
mlc-inference: | ||
env: | ||
CM_RCLONE_CONFIG_CMD: 'rclone config create mlc-inference s3 provider=Cloudflare access_key_id=f65ba5eef400db161ea49967de89f47b secret_access_key=fbea333914c292b854f14d3fe232bad6c5407bf0ab1bebf78833c2b359bdfd2b endpoint=https://c2686074cb2caf5cbaf6d134bdba8b47.r2.cloudflarestorage.com' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from cmind import utils | ||
import os | ||
|
||
def preprocess(i): | ||
|
||
os_info = i['os_info'] | ||
|
||
env = i['env'] | ||
|
||
meta = i['meta'] | ||
|
||
automation = i['automation'] | ||
|
||
quiet = (env.get('CM_QUIET', False) == 'yes') | ||
|
||
if env.get('CM_RCLONE_CONFIG_CMD', '') != '': | ||
env['CM_RUN_CMD'] = env['CM_RCLONE_CONFIG_CMD'] | ||
|
||
return {'return':0} | ||
|
||
def postprocess(i): | ||
|
||
env = i['env'] | ||
|
||
return {'return':0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rem native script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
#CM Script location: ${CM_TMP_CURRENT_SCRIPT_PATH} | ||
|
||
#To export any variable | ||
#echo "VARIABLE_NAME=VARIABLE_VALUE" >>tmp-run-env.out | ||
|
||
#${CM_PYTHON_BIN_WITH_PATH} contains the path to python binary if "get,python" is added as a dependency | ||
|
||
echo "Running: " | ||
echo "${CM_RUN_CMD}" | ||
echo "" | ||
|
||
if [[ ${CM_FAKE_RUN} != "yes" ]]; then | ||
eval "${CM_RUN_CMD}" | ||
test $? -eq 0 || exit 1 | ||
fi |