Skip to content

Commit

Permalink
added docs automation
Browse files Browse the repository at this point in the history
  • Loading branch information
gfursin committed Apr 13, 2024
1 parent e5ab18d commit 9cb76a2
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cm-mlops/automation/docs/_cm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"alias": "docs",
"automation_alias": "automation",
"automation_uid": "bbeb15d8f0a944a4",
"tags": [
"automation"
],
"uid": "9558c9e6ca124065"
}
52 changes: 52 additions & 0 deletions cm-mlops/automation/docs/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):
"""
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}

0 comments on commit 9cb76a2

Please sign in to comment.