-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge from CTuning (Conda support in CM) (#1051)
- Loading branch information
Showing
41 changed files
with
1,452 additions
and
281 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
rem native script | ||
|
||
%CM_PYTHON_BIN_WITH_PATH% %CM_TMP_CURRENT_SCRIPT_PATH%\src\main.py %CM_RUN_OPTS% %CM_ML_MODEL_FILE_WITH_PATH% | ||
IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL% |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
rem native script | ||
|
||
echo "TBD" | ||
|
||
|
||
%CM_PYTHON_BIN_WITH_PATH% %CM_TMP_CURRENT_SCRIPT_PATH%\\python\\main.py | ||
IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL% |
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,43 @@ | ||
{ | ||
"alias": "create-conda-env", | ||
"automation_alias": "script", | ||
"automation_uid": "5b4e0237da074764", | ||
"cache": true, | ||
"category": "DevOps automation", | ||
"clean_files": [], | ||
"deps": [ | ||
{ | ||
"tags": "detect,os" | ||
}, | ||
{ | ||
"names": [ | ||
"conda" | ||
], | ||
"tags": "get,conda" | ||
} | ||
], | ||
"new_env_keys": [ | ||
"+PATH", | ||
"+LD_LIBRARY_PATH", | ||
"CM_CONDA_PREFIX", | ||
"CONDA_PREFIX", | ||
"CM_CONDA_BIN_PATH", | ||
"CM_CONDA_LIB_PATH" | ||
], | ||
"tags": [ | ||
"create", | ||
"get", | ||
"env", | ||
"conda-env", | ||
"conda-environment", | ||
"create-conda-environment" | ||
], | ||
"uid": "e39e0b04c86a40f2", | ||
"variations": { | ||
"name.#": { | ||
"env": { | ||
"CM_CONDA_ENV_NAME": "#" | ||
} | ||
} | ||
} | ||
} |
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,31 @@ | ||
from cmind import utils | ||
import os | ||
|
||
def preprocess(i): | ||
|
||
os_info = i['os_info'] | ||
|
||
env = i['env'] | ||
automation = i['automation'] | ||
run_script_input = i['run_script_input'] | ||
|
||
recursion_spaces = i['recursion_spaces'] | ||
|
||
if env.get('CM_CONDA_ENV_NAME', '') == '': | ||
return {'return':1, 'error': 'Please use "_name.<conda env name>" variation'} | ||
|
||
return {'return':0} | ||
|
||
def postprocess(i): | ||
env = i['env'] | ||
|
||
conda_prefix = os.getcwd() | ||
env['CONDA_PREFIX'] = conda_prefix | ||
env['CM_CONDA_PREFIX'] = conda_prefix | ||
env['CM_CONDA_BIN_PATH'] = os.path.join(conda_prefix, "bin") | ||
env['CM_CONDA_LIB_PATH'] = os.path.join(conda_prefix, "lib") | ||
|
||
env['+PATH'] = [ env['CM_CONDA_BIN_PATH'] ] | ||
env['+LD_LIBRARY_PATH'] = [ env['CM_CONDA_LIB_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
cmd="${CM_CONDA_BIN_WITH_PATH} create -p ${PWD}" | ||
echo "$cmd" | ||
eval "$cmd" | ||
test $? -eq 0 || exit $? | ||
|
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.