-
Notifications
You must be signed in to change notification settings - Fork 13
Workflow Execution
The execution of a workflow is implemented by creating and executing a WorkflowRun
instance in order to conform to RESTful API.
The creation of a WorkflowRun
is implemented by following subroutines.
The WorkflowRun
must be created with a resource assignment dictionary, mapping an InputPort
URL to a list of Resource
URLs. Following conditions should be satisfied:
- all unsatisfied
InputPort
s must be provided withResource
s. - there must be one "multiple resource collection".
- the resource must be ready (
has compat_resource_file
) - the resource type of related
InputPort
should agree with assignedResource
s.
A "singleton" in this context is a WorkflowJob
that will have exactly one RunJob
associated with it in a WorkflowRun
. That is, it does not exist in an execution path that is involved with a resource_collection
that has multiple Resource
s. The output
of this singleton will be used as many times as required for the WorkflowRun
.
-
singleton_workflowjobs <-- all
WorkflowJob
s - if there exists a
resource_collection
inWorkflow.resource_collections[]
where the size ofresources[]
> 1 - traverse down graph (i.e. from
input_port
tooutput_port
); for each node (i.e.WorkflowJob
) visited, remove it from singleton_workflowjobs - return singleton_workflowjobs
An "end-point" is simply a stopping point in the execution path. End-points are used as the starting place for building RunJob
s.
- endpoint_workflowjobs <-- []
- for each
WorkflowJob
- if an
output_port
is not referenced inConnections
- add
WorkflowJob
to endpoint_workflowjobs
- add
- return endpoint_workflowjobs
This recursively creates RunJob
s. Assume the input WorkflowJob
is A.
- if
WorkflowJob
A has no associatedRunJob
in workflowjob_runjob_map - create
RunJob
A - create
Resource
entries (settingorigin
andresource_type
accordingly) forRunJob
A'soutputs[]
and add toRunJob.outputs[]
- for each
input_port
with associatedConnection
that points to aWorkflowJob
's (call it B)output_port
- if
WorkflowJob
B has no associatedRunJob
in workflowjob_runjob_map- run Create
RunJob
onWorkflow
B
- run Create
- get
RunJob
forWorkflowJob
B (call itRunJob
B) - add
input
for thisinput_port
, using the information from the appropriateoutput
ofRunJob
B
- if
- for each
input_port
with associatedresource_assignment
- add
input
for thisinput_port
, using the information from the appropriateresource_assignment
- add
- add
WorkflowJob
A <->RunJob
A to workflowjob_runjob_map
This goes through the end-points and builds RunJob
s upwards. Those WorkflowJob
s that are "singletons" have references kept for them so they are not recreated.
The outer loop iterates over a resource_assignment
that has multiple Resource
s.
-
endpoint_workflowjobs <-- Get "End-point"
WorkflowJob
s -
singleton_workflowjobs <-- Get "Singleton"
WorkflowJob
s - workflowjob_runjob_map <-- []
- if there exists a
resource_collection
inWorkflow.resource_collections[]
where the size ofresources[]
> 1, execute the following loop using a uniqueResource
from theresources
at each iteration; else, execute the loop as is- for each endpoint_workflowjobs
- run Create
RunJob
onWorkflowJob
- run Create
- clear workflowjob_runjob_map of those entries associated with
WorkflowJob
s that do not exist in singleton_workflowjobs
- for each endpoint_workflowjobs
- Repository Structure
- Working on Rodan
- Testing Production Locally
- Working on Interactive Classifier
- Job Queues
- Testing New Docker Images
- Set up Environment Variables
- Set up SSL with Certbot
- Set up SSH with GitHub
- Deploying on Staging
- Deploying on Production
- Import Previous Data