Skip to content

Commit

Permalink
Added get-rclone-config script for mlc-inference #172
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsuresh committed Sep 18, 2024
1 parent 45b6981 commit 18a55b8
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 0 deletions.
13 changes: 13 additions & 0 deletions script/get-rclone-config/_cm.yaml
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'
25 changes: 25 additions & 0 deletions script/get-rclone-config/customize.py
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}
1 change: 1 addition & 0 deletions script/get-rclone-config/run.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rem native script
17 changes: 17 additions & 0 deletions script/get-rclone-config/run.sh
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

0 comments on commit 18a55b8

Please sign in to comment.