Project

General

Profile

Actions

Idea #9684

closed

[Crunch2] [API] Add Workflow resource

Added by Brett Smith almost 8 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Radhika Chippada
Category:
API
Target version:
Start date:
08/02/2016
Due date:
Story points:
2.0

Description

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).

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, 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.


Subtasks 1 (0 open1 closed)

Task #9720: Review branch 9684-workflowsResolvedRadhika Chippada08/02/2016Actions

Related issues

Related to Arvados - Bug #9826: [API] crunch-dispatch crash on startResolvedTom Clegg08/22/2016Actions
Actions

Also available in: Atom PDF