workflow-execution-service-schemas icon indicating copy to clipboard operation
workflow-execution-service-schemas copied to clipboard

Propose Enhancements from Sapporo WES 2.0.0

Open suecharo opened this issue 7 months ago • 2 comments

We have completely rewritten Sapporo, a WES implementation, and released it as version 2.0.0. This new Sapporo is based on WES 1.1.0 and is implemented using Python's FastAPI. We first defined types based on WES 1.1.0, as seen in sapporo/schemas.py, and built the functionalities from there. Our goal was to avoid extending the original WES whenever possible. However, there were some necessary extensions that we implemented, which are summarized in this issue. We would be delighted if these extensions could be integrated into the original WES.

1. Fix ServiceInfo - default_workflow_engine_parameters Type

  • Original WES 1.1.0: List[DefaultWorkflowEngineParameter]
  • Proposal: Dict[str, List[DefaultWorkflowEngineParameter]

Since WES 1.1.0 now supports multiple workflow engines within a single WES instance, this extension was necessary. The expected structure is as follows (example):

{
  "default_workflow_engine_parameters": {
    "cwltool": [
      { "name": "--cpu", "value": "2" },
      { "name": "--mem", "value": "4G" }
    ],
    "cromwell": [
      { "name": "--cpu", "value": "4" }
    ]
  }
}

2. Add sort_order and state Query Parameters to GET /runs

To enhance the GET /runs endpoint, we propose introducing query parameters for sorting and filtering runs:

  1. Sort Order: Add a sort_order query parameter to sort runs based on start_time in either ascending or descending order. The value should be "asc" or "desc", with the default being "desc".
  2. State Filter: Add a state query parameter to filter runs based on their state, such as "COMPLETE", "RUNNING", etc.

3. Enhancing POST /runs to Support Download Workflow Attachments

Currently, workflow_attachment only supports attaching files via form-data. To improve its flexibility and functionality, we suggest the following enhancements:

  • Introduce a workflow_attachment_obj that includes a download URL. This would allow WES to download the attachment file at runtime and stage the file. An example object structure would be:
[
  { "file_name": "path/to/file", "file_url": "https://example.com/path/to/file" }
]

4. Enable Downloading of Run Outputs

We propose adding endpoints to download run outputs in various formats:

  1. Retrieve Outputs List: GET /runs/{run_id}/outputs should return the outputs (outputs field of the response from GET /runs/{run_id}) in JSON format.
  2. Download Outputs as ZIP: GET /runs/{run_id}/outputs?download=true should return the outputs as a ZIP file.
  3. Download Each Output File: GET /runs/{run_id}/outputs/{path_to_file} should allow downloading a specific output file.

suecharo avatar Jul 09 '24 08:07 suecharo