1
1
from abc import ABC , abstractmethod
2
- from typing import Dict , List
2
+ from typing import Dict , List , Optional
3
3
4
+ from ai .chronon .cli .plan .physical_graph import PhysicalGraph
4
5
from ai .chronon .cli .plan .physical_index import PhysicalNode
5
6
6
7
7
- class OrchestratorIface (ABC ):
8
- def __init__ (self ):
9
- pass
8
+ class ControllerIface (ABC ):
9
+ """
10
+ Class used to make the rest of the planner code agnostic to the underlying orchestrator.
11
+ Mainly used to mock out the orchestrator for testing.
12
+ """
10
13
11
14
@abstractmethod
12
15
def fetch_missing_confs (self , node_to_hash : Dict [str , str ]) -> List [str ]:
@@ -15,3 +18,28 @@ def fetch_missing_confs(self, node_to_hash: Dict[str, str]) -> List[str]:
15
18
@abstractmethod
16
19
def upload_conf (self , name : str , hash : str , content : str ) -> None :
17
20
pass
21
+
22
+ @abstractmethod
23
+ def create_workflow (
24
+ self , physical_graph : PhysicalGraph , start_date : str , end_date : str
25
+ ) -> str :
26
+ """
27
+ Submit a physical graph to the orchestrator and return workflow id
28
+ """
29
+ pass
30
+
31
+ @abstractmethod
32
+ def get_workflow_status (self , workflow_id : str ) -> str :
33
+ """
34
+ Get the status of a workflow
35
+ """
36
+ pass
37
+
38
+ @abstractmethod
39
+ def get_active_workflows (
40
+ self , branch : Optional [str ] = None , user : Optional [str ] = None
41
+ ) -> List [str ]:
42
+ """
43
+ List all active workflows
44
+ """
45
+ pass
0 commit comments