Skip to content

Commit e60d96e

Browse files
committed
add execute_workflow option to DefaultExecutionManager
1 parent 71aa7fe commit e60d96e

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

jupyter_scheduler/executors.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ class ExecutionManager(ABC):
3636

3737
def __init__(
3838
self,
39-
job_id: str,
40-
workflow_id: str,
41-
root_dir: str,
4239
db_url: str,
43-
staging_paths: Dict[str, str],
40+
job_id: str = None,
41+
workflow_id: str = None,
42+
root_dir: str = None,
43+
staging_paths: Dict[str, str] = None,
4444
):
4545
self.job_id = job_id
4646
self.workflow_id = workflow_id
@@ -86,7 +86,6 @@ def process(self):
8686
self.on_complete()
8787

8888
def process_workflow(self):
89-
9089
self.before_start_workflow()
9190
try:
9291
self.execute_workflow()
@@ -205,7 +204,7 @@ def get_task_data(self, task_ids: List[str] = []):
205204

206205
return tasks_data_obj
207206

208-
@flow()
207+
@flow
209208
def execute_workflow(self):
210209

211210
tasks_info = self.get_task_data()

jupyter_scheduler/scheduler.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -541,10 +541,7 @@ def create_workflow(self, model: CreateWorkflow) -> str:
541541
session.commit()
542542

543543
execution_manager = self.execution_manager_class(
544-
job_id="123",
545-
staging_paths=dict(),
546544
workflow_id=workflow.workflow_id,
547-
root_dir=self.root_dir,
548545
db_url=self.db_url,
549546
)
550547
execution_manager.process_workflow()

jupyter_scheduler/workflows.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import json
2-
from typing import List
2+
from typing import Dict, List
33

44
from jupyter_server.utils import ensure_async
55
from tornado.web import HTTPError, authenticated
6-
76
from jupyter_scheduler.exceptions import (
87
IdempotencyTokenError,
98
InputUriError,
@@ -26,8 +25,6 @@ async def post(self):
2625
workflow_id = await ensure_async(
2726
self.scheduler.create_workflow(CreateWorkflow(**payload))
2827
)
29-
self.log.info(payload)
30-
print(payload)
3128
except ValidationError as e:
3229
self.log.exception(e)
3330
raise HTTPError(500, str(e)) from e

0 commit comments

Comments
 (0)