Skip to content

Commit

Permalink
added prototyped components
Browse files Browse the repository at this point in the history
  • Loading branch information
gfursin committed Apr 28, 2022
1 parent da6dcff commit 456e486
Show file tree
Hide file tree
Showing 9 changed files with 408 additions and 4 deletions.
9 changes: 9 additions & 0 deletions ck2-repo-mlops/automation/docker/_cm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"alias": "docker",
"automation_alias": "automation",
"automation_uid": "bbeb15d8f0a944a4",
"tags": [
"automation"
],
"uid": "2d90be7cab6e4d9f"
}
52 changes: 52 additions & 0 deletions ck2-repo-mlops/automation/docker/module.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import os

from cmind.automation import Automation
from cmind import utils

class CAutomation(Automation):
"""
CM "docker" automation actions
"""

############################################################
def __init__(self, cmind, automation_file):
super().__init__(cmind, __file__)

############################################################
def test(self, i):
"""
Test automation
Args:
(CM input dict):
(out) (str): if 'con', output to console
automation (str): automation as CM string object
parsed_automation (list): prepared in CM CLI or CM access function
[ (automation alias, automation UID) ] or
[ (automation alias, automation UID), (automation repo alias, automation repo UID) ]
(artifact) (str): artifact as CM string object
(parsed_artifact) (list): prepared in CM CLI or CM access function
[ (artifact alias, artifact UID) ] or
[ (artifact alias, artifact UID), (artifact repo alias, artifact repo UID) ]
...
Returns:
(CM return dict):
* return (int): return code == 0 if no error and >0 if error
* (error) (str): error string if return>0
* Output from this automation action
"""

import json
print (json.dumps(i, indent=2))

return {'return':0}
9 changes: 9 additions & 0 deletions ck2-repo-mlops/automation/env/_cm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"alias": "env",
"automation_alias": "automation",
"automation_uid": "bbeb15d8f0a944a4",
"tags": [
"automation"
],
"uid": "17595df0911447dc"
}
52 changes: 52 additions & 0 deletions ck2-repo-mlops/automation/env/module.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import os

from cmind.automation import Automation
from cmind import utils

class CAutomation(Automation):
"""
CM "env" automation actions
"""

############################################################
def __init__(self, cmind, automation_file):
super().__init__(cmind, __file__)

############################################################
def test(self, i):
"""
Test automation
Args:
(CM input dict):
(out) (str): if 'con', output to console
automation (str): automation as CM string object
parsed_automation (list): prepared in CM CLI or CM access function
[ (automation alias, automation UID) ] or
[ (automation alias, automation UID), (automation repo alias, automation repo UID) ]
(artifact) (str): artifact as CM string object
(parsed_artifact) (list): prepared in CM CLI or CM access function
[ (artifact alias, artifact UID) ] or
[ (artifact alias, artifact UID), (artifact repo alias, artifact repo UID) ]
...
Returns:
(CM return dict):
* return (int): return code == 0 if no error and >0 if error
* (error) (str): error string if return>0
* Output from this automation action
"""

import json
print (json.dumps(i, indent=2))

return {'return':0}
9 changes: 9 additions & 0 deletions ck2-repo-mlops/automation/experiment/_cm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"alias": "experiment",
"automation_alias": "automation",
"automation_uid": "bbeb15d8f0a944a4",
"tags": [
"automation"
],
"uid": "a0a2d123ef064bcb"
}
52 changes: 52 additions & 0 deletions ck2-repo-mlops/automation/experiment/module.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import os

from cmind.automation import Automation
from cmind import utils

class CAutomation(Automation):
"""
CM "experiment" automation actions
"""

############################################################
def __init__(self, cmind, automation_file):
super().__init__(cmind, __file__)

############################################################
def test(self, i):
"""
Test automation
Args:
(CM input dict):
(out) (str): if 'con', output to console
automation (str): automation as CM string object
parsed_automation (list): prepared in CM CLI or CM access function
[ (automation alias, automation UID) ] or
[ (automation alias, automation UID), (automation repo alias, automation repo UID) ]
(artifact) (str): artifact as CM string object
(parsed_artifact) (list): prepared in CM CLI or CM access function
[ (artifact alias, artifact UID) ] or
[ (artifact alias, artifact UID), (artifact repo alias, artifact repo UID) ]
...
Returns:
(CM return dict):
* return (int): return code == 0 if no error and >0 if error
* (error) (str): error string if return>0
* Output from this automation action
"""

import json
print (json.dumps(i, indent=2))

return {'return':0}
9 changes: 9 additions & 0 deletions ck2-repo-mlops/automation/ic/_cm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"alias": "ic",
"automation_alias": "automation",
"automation_uid": "bbeb15d8f0a944a4",
"tags": [
"automation"
],
"uid": "972c28dafb2543fa"
}
Loading

0 comments on commit 456e486

Please sign in to comment.