-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from mlcommons/dev
Major update to support CM v2.2.0
- Loading branch information
Showing
42 changed files
with
626 additions
and
71 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
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
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
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
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 |
---|---|---|
|
@@ -3,6 +3,8 @@ uid: 9e97bb72b0474657 | |
|
||
git: true | ||
|
||
version: 2.2.0 | ||
|
||
deps: | ||
- alias: mlcommons@ck | ||
uid: a4705959af8e447a | ||
|
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
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,27 @@ | ||
alias: create-custom-cache-entry | ||
uid: 485741440fbe4236 | ||
|
||
automation_alias: script | ||
automation_uid: 5b4e0237da074764 | ||
|
||
tags: | ||
- create | ||
- custom | ||
- cache | ||
- entry | ||
|
||
category: CM automation | ||
|
||
cache: true | ||
|
||
input_mapping: | ||
env_key: CM_CUSTOM_CACHE_ENTRY_ENV_KEY | ||
env_key2: CM_CUSTOM_CACHE_ENTRY_ENV_KEY2 | ||
path: CM_CUSTOM_CACHE_ENTRY_PATH | ||
to: CM_CUSTOM_CACHE_ENTRY_PATH | ||
|
||
new_env_keys: | ||
- CM_CUSTOM_CACHE_ENTRY* | ||
|
||
print_env_at_the_end: | ||
CM_CUSTOM_CACHE_ENTRY_PATH: "Path to custom cache entry" |
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,44 @@ | ||
from cmind import utils | ||
import os | ||
import shutil | ||
|
||
def preprocess(i): | ||
|
||
# CM script internal variables | ||
env = i['env'] | ||
|
||
extra_cache_tags = [] | ||
if env.get('CM_EXTRA_CACHE_TAGS','').strip() == '': | ||
print ('') | ||
extra_cache_tags_str = input('Enter extra tags for the custom CACHE entry separated by comma: ') | ||
|
||
extra_cache_tags = extra_cache_tags_str.strip().split(',') | ||
|
||
return {'return':0, 'add_extra_cache_tags':extra_cache_tags} | ||
|
||
def postprocess(i): | ||
|
||
env = i['env'] | ||
|
||
path = env.get('CM_CUSTOM_CACHE_ENTRY_PATH','').strip() | ||
|
||
if path!='': | ||
if not os.path.isdir(path): | ||
os.makedirs(path) | ||
else: | ||
path = os.getcwd() | ||
|
||
x = '' | ||
env_key = env.get('CM_CUSTOM_CACHE_ENTRY_ENV_KEY', '') | ||
if env_key != '': x = env_key+'_' | ||
|
||
env['CM_CUSTOM_CACHE_ENTRY_{}PATH'.format(x)] = path | ||
env['CM_CUSTOM_CACHE_ENTRY_PATH'] = path | ||
|
||
env_key2 = env.get('CM_CUSTOM_CACHE_ENTRY_ENV_KEY2', '') | ||
v = env.get(env_key2, '') | ||
real_path = v if v != '' else path | ||
|
||
env['CM_CUSTOM_CACHE_ENTRY_{}REAL_PATH'.format(x)] = real_path | ||
|
||
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
Oops, something went wrong.