Project

General

Profile

Idea #9684

Updated by Brett Smith over 7 years ago

h2. Overview 

 Workflows serve the same purpose for Crunch v2 that PipelineTemplates do for Crunch v1.    They store a parameterized workflow, written in CWL.    Clients like Workbench and arvados-cwl-runner can let users browse Workflows, or run a specific Workflow with specified inputs. 

 Much like PipelineInstances include an instantiated copy of their PipelineTemplate, clients that want to run Workflows are expected to copy the entire workflow text into the right place (e.g., arvados-cwl-runner will make it a parameter of a ContainerRequest; crunch-run will mount that parameter as text inside the running Container). 

 h2. Functional Requirements 

 Add a Workflow resource to the API server.    It supports all the same fields and methods as PipelineTemplate, except that instead of a @components@ attribute, it has a @workflow@ attribute.    This is a text column, intended to store a CWL workflow in its native YAML representation. 

 The Workflow has a validation that the @workflow@ attribute is either "blank" (nil or empty) or is valid YAML.    [TODO: Is there an easy way to check that it's valid CWL?]    A Workflow with @workflow@ text that is not good YAML is invalid. 

 The @name@ and @description@ attributes are set automatically from the CWL's @label@ and @doc@ fields, respectively, CWL, unless explicitly overridden by the client. 

 * On create, if either attribute is unset, if the @workflow@ CWL includes the corresponding field, set our attribute from that value. 
 * On update, if not @attribute_changed?@, and @attribute_was@ matches the value from @workflow_was@, set our attribute from the corresponding field in the @workflow@ CWL (including setting the attribute to nil if the field is no longer set in the @workflow@ CWL). 
   Yes, this means that if a client manually sets the Workflow's @name@ to match the @label@ in the CWL, then updates the CWL, the @name@ can be updated as well.    This is a smidgen less than ideal, but we consider it worth the tradeoff for a simple implementation, and not too confusing anyway. 

 Update the API documentation to include information about the Workflow resource and methods.    It should mention that @workflow@ should be CWL YAML, and the auto-update behavior of the @name@ and @description@ attributes.

Back