Skip to content
Snippets Groups Projects
Commit e63ad66d authored by Charlotte Hausman's avatar Charlotte Hausman
Browse files

misc. clean up

parent e32d7145
No related branches found
No related tags found
No related merge requests found
......@@ -337,15 +337,10 @@ class CapabilityEngine(CapabilityEngineIF):
cur_step = step_sequence[int(self.execution.current_step)]
workflow_name = cur_step.step_value
workflow_args = cur_step.step_args
workflow_request = WorkflowRequest(
workflow_name=workflow_name,
argument=workflow_args,
state=WorkflowRequestState.Created,
execution_id=self.execution_id,
)
# FIXME: Add support for files
files = []
workflow_request = self.workflow_service.info.create_workflow_request(workflow_name, workflow_args)
self.workflow_service.execute(workflow_request, files)
def is_complete(self):
......@@ -481,7 +476,7 @@ class WorkflowService(WorkflowServiceIF):
# Start listening for events from the wf_monitor stream
self.listener = threading.Thread(
target=lambda: workflow_events.listen(self.on_workflow_event)
target=lambda: workflow_events.listen(self.on_workflow_event, threaded=True)
)
self.listener.start()
......@@ -521,7 +516,7 @@ class WorkflowService(WorkflowServiceIF):
"""
# 1. create a temporary directory
# TODO: decide where to put temp directory and make capo property
temp_folder = Path(mkdtemp(dir=str(Path.home())))
temp_folder = Path(mkdtemp(dir=str(Path.home())+"/workspaces_tmp"))
# 2. spool each of the temp files to it
for file in files:
......@@ -623,7 +618,6 @@ class WorkflowInfo(WorkflowInfoIF):
Create new workflow request and save to database
:param workflow: workflow to run
:param argument: workflow arguments
:param execution_id: execution id of parent capability execution (optional for now)
:return: new WorkflowRequest
"""
request = WorkflowRequest(
......@@ -632,6 +626,7 @@ class WorkflowInfo(WorkflowInfoIF):
state=WorkflowRequestState.Created.name,
)
self.save_request(request)
print(f"Created Workflow Request {request}")
return request
def save_request(self, request: WorkflowRequest):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment