diff --git a/.gitmodules b/.gitmodules index a312dad3..e69de29b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "task-execution-schemas"] - path = task-execution-schemas - url = https://github.com/ga4gh/task-execution-schemas.git diff --git a/CWLFile b/CWLFile index 65ef51ce..e869df0d 100644 --- a/CWLFile +++ b/CWLFile @@ -2,8 +2,8 @@ includes: - class: Directory location: proto - class: Directory - location: task-execution-schemas/proto + location: proto proto: class: File - location: proto/workflow_execution.proto + location: proto/workflow_execution_service.proto cwl:tool: protoc.cwl \ No newline at end of file diff --git a/README.md b/README.md index da37c87e..b6fc9599 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,24 @@ -![ga4gh logo](http://genomicsandhealth.org/files/logo_ga.png) +GA4GH Logo Schemas for the Workflow Execution Service (WES) API ==================================================== -This is used by the Data Working Group - Containers and Workflows Task Team - -[View in Swagger](http://editor.swagger.io/#/?import=https://raw.githubusercontent.com/ga4gh/workflow-execution-schemas/0.1.0/swagger/proto/workflow_execution.swagger.json) - The [Global Alliance for Genomics and Health](http://genomicsandhealth.org/) is an international coalition, formed to enable the sharing of genomic and clinical data. -Containers and Workflows Task Team ----------------------------------- +Cloud Work Stream +----------------- -The [Data Working Group](http://ga4gh.org/#/) concentrates on data representation, storage, +The [Cloud Work Stream](https://ga4gh/cloud) concentrates on data representation, storage, and analysis, including working with platform development partners and industry leaders to develop standards that will facilitate -interoperability. The Containers & Workflows working group is an informal, multi-vendor working group focused on standards for exchanging Docker-based tools and CWL/WDL workflows, execution of Docker-based tools and workflows on clouds, and abstract access to cloud object stores. +interoperability. The Cloud Work Stream is an informal, multi-vendor working group focused on standards for exchanging Docker-based tools and CWL/WDL workflows, execution of Docker-based tools and workflows on clouds, and abstract access to cloud object stores. What is WES? ============ -This is the home of the Workflow Execution Schema proposal. The Workflow -Execution Schema is a minimal common API describing how a user can submit -workflow requests to workflow execution systems in a standardized ways. +The Workflow Execution Schema is a minimal common API describing how a user can submit +workflow requests to workflow execution systems in standardized ways. Workflow execution engines (SevenBridges, FireCloud, etc) can support this API so users can make workflow requests programmatically, adding the ability to scale up. In addition, these workflow services could have (and probably do have) UIs that would (possibly) use this API under the hood to facilitate workflow execution requests. @@ -31,19 +26,19 @@ UIs that would (possibly) use this API under the hood to facilitate workflow exe Having this standard API supported by multiple execution engines will give people options of processing the same workflow (CWL or WDL) across different workflow execution platforms running across various clouds/environments. As an example use case, one can find a workflow in CWL on [Dockstore.org](http://dockstore.org), use Dockstore to -generate a JSON parameterization file, and submit this a GA4GH-compliant +generate a JSON parameterization file, and submit this to a GA4GH-compliant workflow execution service. Key features of the current API proposal: * ability to request a workflow run using CWL or WDL (and maybe future formats) * ability to parameterize that workflow using a JSON schema (ideally a future version would be in common between CWL and WDL) -* ability to get information about running workflows, status, errors, output file locations etc +* ability to get information about running workflows, status, errors, output file locations, etc. * to search for workflows by arbitrary key/values Outstanding questions: -* a common JSON parameterization format, see work by Peter, is that checked in? +* a common JSON parameterization format * standardizing terms, job, workflow, steps, tools, etc * reference implementation at https://github.com/common-workflow-language/cwltool-service/tree/ga4gh-wes * validation service for testing WES implementations' conformance to the spec @@ -54,9 +49,9 @@ Outstanding questions: How to view ------------ -See the swagger editor to view our [schema in progress](http://editor.swagger.io/#/?import=https://raw.githubusercontent.com/ga4gh/workflow-execution-schemas/develop/src/main/resources/swagger/ga4gh-tool-discovery.yaml). +The file `swagger/workflow_execution_service.swagger.json` contains the API description. -If the current schema fails to validate, visit [debugging](http://online.swagger.io/validator/debug?url=https://raw.githubusercontent.com/ga4gh/workflow-execution-schemas/develop/src/main/resources/swagger/ga4gh-tool-discovery.yaml) +Please visit http://ga4gh.github.io/workflow-execution-schemas to view this document in Swagger UI. Building Documents ------------------ @@ -65,24 +60,14 @@ Make sure you have Docker installed for your platform and the `cwltool`. virtualenv env source env/bin/activate - pip install setuptools==28.8.0 - pip install cwl-runner cwltool==1.0.20161114152756 schema-salad==1.18.20161005190847 avro==1.8.1 - -Make sure you have the [submodule](http://stackoverflow.com/questions/3939055/submodules-files-are-not-checked-out) checked out: - - git submodule update --init --recursive + pip install -r requirements.txt -You can generate the [Swagger](http://swagger.io/) YAML from the Protocol Buffers: +You can generate the [Swagger](http://swagger.io/) from the Protocol Buffers: cwltool CWLFile + sh tools/prepare_openapi.sh -Find the output in `workflow_execution.swagger.json` and this can be loaded in the [Swagger editor](http://swagger.io/swagger-editor/). Use the GitHub raw feature to generate a URL you can load. - -When you're happy with the changes, checkin this file: - - mv workflow_execution.swagger.json swagger/proto/ - -And commit your changes. +The resulting OpenAPI description will be in the `swagger` directory. How to contribute changes ------------------------- @@ -100,4 +85,4 @@ More Information ---------------- * [Global Alliance for Genomics and Health](http://genomicsandhealth.org) -* [Google Forum](https://groups.google.com/forum/#!forum/ga4gh-dwg-containers-workflows) +* [GA4GH Cloud Work Stream)[https://ga4gh.cloud] diff --git a/proto/workflow_execution.proto b/proto/workflow_execution.proto deleted file mode 100644 index 50500b48..00000000 --- a/proto/workflow_execution.proto +++ /dev/null @@ -1,190 +0,0 @@ - -syntax = "proto3"; - -package ga4gh_wes_; - -// Import HTTP RESTful annotations -import "google/api/annotations.proto"; -import "google/protobuf/struct.proto"; -import "task_execution.proto"; - -//Enum for states -enum state { - Unknown = 0; - Queued = 1; - Running = 2; - Paused = 3; - Complete = 4; - Error = 5; - SystemError = 6; - Canceled = 7; - Initializing = 8; -} - -//Log and other info -message log { - //The task or workflow name - string name = 1; - //The command line that was run - repeated string cmd = 2; - //When the command was executed - string startTime = 3; - //When the command completed - string endTime = 4; - //Sample of stdout (not guaranteed to be entire log) - string stdout = 5; - //Sample of stderr (not guaranteed to be entire log) - string stderr = 6; - //Exit code of the program - int32 exitCode = 7; -} - -//Return envelope for workflow listing -message workflow_list_response { - repeated workflow_desc workflows = 1; - string next_page_token = 2; -} - -//Request listing of jobs tracked by server -message workflow_list_request { - //OPTIONAL - //Number of workflows to return at once. Defaults to 256, and max is 2048. - uint32 page_size = 1; - //OPTIONAL - //Token to use to indicate where to start getting results. If unspecified, returns the first page of results. - string page_token = 2; - //OPTIONAL - //For each key, if the key's value is empty string then match workflows that are tagged with this key regardless of value - string key_value_search = 3; -} - -//Small description of workflows, returned by server during listing -message workflow_desc { - //REQUIRED - string workflow_id = 1; - //REQUIRED - state state = 2; -} - -//workflow request object -message workflow_request { - //OPTIONAL - //the workflow CWL or WDL document, must provide either this or workflow_url - string workflow_descriptor = 1; - //REQUIRED - //the workflow parameterization document (typically a JSON file), includes all parameterizations for the workflow including input and output file locations - google.protobuf.Struct workflow_params = 2; - //REQUIRED - //the workflow descriptor type, must be "CWL" or "WDL" currently (or another alternative supported by this WES instance) - string workflow_type = 3; - //REQUIRED - //the workflow descriptor type version, must be one supported by this WES instance - string workflow_type_version = 4; - //OPTIONAL - //a key-value map of arbitrary metadata outside the scope of the workflow_params but useful to track with this workflow request - map key_values = 5; - //OPTIONAL - //the workflow CWL or WDL document, must provide either this or workflow_descriptor - string workflow_url = 6; -} - -//Blank request message for service request -message service_info_request {} - -//available workflow types supported by this WES -message workflow_type_version { - //an array of one or more version strings - repeated string workflow_type_version = 1; -} - - -//. -message service_info { - //A map with keys as the workflow format type name (currently only CWL and WDL are used although a service may support others) and value is a workflow_type_version object which simply contains an array of one or more version strings - map workflow_type_versions = 1; - //The version(s) of the WES schema supported by this service - repeated string supported_wes_versions = 2; - //The filesystem protocols supported by this service, currently these may include common protocols such as 'http', 'https', 'sftp', 's3', 'gs', 'file', 'synapse', or others as supported by this service. - repeated string supported_filesystem_protocols = 3; - //The engine(s) used by this WES service, key is engine name e.g. Cromwell and value is version - map engine_versions = 4; - //The system statistics, key is the statistic, value is the count of workflows in that state. See the State enum for the possible keys. - map system_state_counts = 5; - //a key-value map of arbitrary, extended metadata outside the scope of the above but useful to report back - map key_values = 6; -} - -message workflow_run_id { - //workflow ID - string workflow_id = 1; -} - -message workflow_status { - //workflow ID - string workflow_id = 1; - //state - state state = 2; -} - -message workflow_log { - //workflow ID - string workflow_id = 1; - //the original request object - workflow_request request = 2; - //state - state state = 3; - //the logs, and other key info like timing and exit code, for the overall run of this workflow - log workflow_log = 4; - //the logs, and other key info like timing and exit code, for each step in the workflow - repeated log task_logs = 5; - //the outputs - google.protobuf.Struct outputs = 6; -} - -//Web service to get, create, list and delete Workflows -service WorkflowExecutionService { - - //Get information about Workflow Execution Service. May include information related (but not limited to) the workflow descriptor formats, versions supported, the WES API versions supported, and information about general the service availability. - rpc GetServiceInfo(service_info_request) returns (service_info) { - option (google.api.http) = { - get: "/ga4gh/wes/v1/service-info" - }; - } - - //Run a workflow, this endpoint will allow you to create a new workflow request and retrieve its tracking ID to monitor its progress. An important assumption in this endpoint is that the workflow_params JSON will include parameterizations along with input and output files. The latter two may be on S3, Google object storage, local filesystems, etc. This specification makes no distinction. However, it is assumed that the submitter is using URLs that this system both understands and can access. For Amazon S3, this could be accomplished by given the credentials associated with a WES service access to a particular bucket. The details are important for a production system and user on-boarding but outside the scope of this spec. - rpc RunWorkflow(workflow_request) returns (workflow_run_id) { - option (google.api.http) = { - post: "/ga4gh/wes/v1/workflows" - body: "*" - }; - } - - //Get quick status info about a running workflow - rpc GetWorkflowStatus(workflow_run_id) returns (workflow_status) { - option (google.api.http) = { - get: "/ga4gh/wes/v1/workflows/{workflow_id}/status" - }; - } - - //Get detailed info about a running workflow - rpc GetWorkflowLog(workflow_run_id) returns (workflow_log) { - option (google.api.http) = { - get: "/ga4gh/wes/v1/workflows/{workflow_id}" - }; - } - - //Cancel a running workflow - rpc CancelJob(workflow_run_id) returns (workflow_run_id) { - option (google.api.http) = { - delete: "/ga4gh/wes/v1/workflows/{workflow_id}" - }; - } - - //List the workflows, this endpoint will list the workflows in order of oldest to newest. There is no guarantee of live updates as the user traverses the pages, the behavior should be decided (and documented) by each implementation. - rpc ListWorkflows(workflow_list_request) returns (workflow_list_response) { - option (google.api.http) = { - get: "/ga4gh/wes/v1/workflows" - }; - } - -} diff --git a/proto/workflow_execution_service.proto b/proto/workflow_execution_service.proto new file mode 100644 index 00000000..d02ff933 --- /dev/null +++ b/proto/workflow_execution_service.proto @@ -0,0 +1,307 @@ + +syntax = "proto3"; + +package ga4gh_wes_; + +// Import HTTP RESTful annotations +import "google/api/annotations.proto"; +import "google/protobuf/struct.proto"; + + +// The Workflow Execution Service presents an interoperable layer for executing workflows +// using an HTTP interface. By passing WES messages to a service connected to some execution +// engine one can carry out a computational task. +service WorkflowExecutionService { + + // Get information about Workflow Execution Service. May include information related (but + // not limited to) the workflow descriptor formats, versions supported, the WES API versions supported, and information about general the service availability. + rpc GetServiceInfo(ServiceInfoRequest) returns (ServiceInfo) { + option (google.api.http) = { + get: "/ga4gh/wes/v1/service-info" + }; + } + + // Run a workflow, this endpoint will allow you to create a new workflow request and + // retrieve its tracking ID to monitor its progress. An important assumption in this + // endpoint is that the workflow_params JSON will include parameterizations along with + // input and output files. The latter two may be on S3, Google object storage, local filesystems, + // etc. This specification makes no distinction. However, it is assumed that the submitter + // is using URLs that this system both understands and can access. For Amazon S3, this could + // be accomplished by given the credentials associated with a WES service access to a + // particular bucket. The details are important for a production system and user on-boarding + // but outside the scope of this spec. + rpc RunWorkflow(WorkflowRequest) returns (WorkflowRunId) { + option (google.api.http) = { + post: "/ga4gh/wes/v1/workflows" + body: "*" + }; + } + + // Get quick status info about a running workflow. + rpc GetWorkflowStatus(WorkflowRunId) returns (WorkflowStatus) { + option (google.api.http) = { + get: "/ga4gh/wes/v1/workflows/{workflow_id}/status" + }; + } + + // Get detailed info about a running workflow. + rpc GetWorkflowLog(WorkflowRunId) returns (WorkflowLog) { + option (google.api.http) = { + get: "/ga4gh/wes/v1/workflows/{workflow_id}" + }; + } + + // Cancel a running workflow. + rpc CancelJob(WorkflowRunId) returns (WorkflowRunId) { + option (google.api.http) = { + delete: "/ga4gh/wes/v1/workflows/{workflow_id}" + }; + } + + // List the workflows, this endpoint will list the workflows in order of oldest to newest. + // There is no guarantee of live updates as the user traverses the pages, the behavior should be + // decided (and documented) by each implementation. + // To monitor a given execution, use GetWorkflowStatus or GetWorkflowLog. + rpc ListWorkflows(WorkflowListRequest) returns (WorkflowListResponse) { + option (google.api.http) = { + get: "/ga4gh/wes/v1/workflows" + }; + } + +} + +// To execute a workflow, send a workflow request including all the details needed to begin downloading +// and executing a given workflow. +message WorkflowRequest { + // OPTIONAL + // The workflow CWL or WDL document, must provide either this or workflow_url. By combining + // this message with a workflow_type_version offered in ServiceInfo, one can initialize + // CWL, WDL, or a base64 encoded gzip of the required workflow descriptors. When files must be + // created in this way, the `workflow_url` should be set to the path of the main + // workflow descriptor. + string workflow_descriptor = 1; + + // REQUIRED + // The workflow parameterization document (typically a JSON file), includes all parameterizations for the workflow + // including input and output file locations. + google.protobuf.Struct workflow_params = 2; + + // REQUIRED + // The workflow descriptor type, must be "CWL" or "WDL" currently (or another alternative supported by this WES instance) + string workflow_type = 3; + + // REQUIRED + // The workflow descriptor type version, must be one supported by this WES instance + string workflow_type_version = 4; + + // OPTIONAL + // A key-value map of arbitrary metadata outside the scope of the workflow_params but useful to track with this workflow request + map tags = 5; + + // OPTIONAL + // Additional parameters can be sent to the workflow engine using this field. Default values + // for these parameters are provided at the ServiceInfo endpoint. + map workflow_engine_parameters = 6; + + // OPTIONAL + // The workflow CWL or WDL document, must provide either this or workflow_descriptor. When a base64 encoded gzip of + // workflow descriptor files is offered, the `workflow_url` should be set to the relative path + // of the main workflow descriptor. + string workflow_url = 7; +} + +// Request listing of jobs tracked by server +message WorkflowListRequest { + // OPTIONAL + // Number of workflows to return in a page. + uint32 page_size = 1; + + // OPTIONAL + // Token to use to indicate where to start getting results. If unspecified, returns the first + // page of results. + string page_token = 2; + + // OPTIONAL + // For each key, if the key's value is empty string then match workflows that are tagged with + // this key regardless of value + string tag_search = 3; +} + + +// The service will return a workflow_list_response when receiving a successful workflow_list_request. +message WorkflowListResponse { + // A list of workflows that the service has executed or is executing. + repeated WorkflowDesc workflows = 1; + + // A token, which when provided in a workflow_list_request, allows one to retrieve the next page + // of results. + string next_page_token = 2; +} + +// The service info request is a simple GET request and doesn't take any parameters. +message ServiceInfoRequest {} + +// A message containing useful information about the running service, including supported versions and +// default settings. +message ServiceInfo { + // A map with keys as the workflow format type name (currently only CWL and WDL are used + // although a service may support others) and value is a workflow_type_version object which + // simply contains an array of one or more version strings + map workflow_type_versions = 1; + + // The version(s) of the WES schema supported by this service + repeated string supported_wes_versions = 2; + + // The filesystem protocols supported by this service, currently these may include common + // protocols such as 'http', 'https', 'sftp', 's3', 'gs', 'file', 'synapse', or others as + // supported by this service. + repeated string supported_filesystem_protocols = 3; + + // The engine(s) used by this WES service, key is engine name e.g. Cromwell and value is version + map workflow_engine_versions = 4; + + // Each workflow engine can present additional parameters that can be sent to the + // workflow engine. This message will list the default values, and their types for each + // workflow engine. + repeated DefaultWorkflowEngineParameter default_workflow_engine_parameters = 5; + + // The system statistics, key is the statistic, value is the count of workflows in that state. + // See the State enum for the possible keys. + map system_state_counts = 6; + + // A URL that will help a in generating the tokens necessary to run a workflow using this + // service. + string auth_instructions_url = 7; + + // A key-value map of arbitrary, extended metadata outside the scope of the above but useful + // to report back + map tags = 8; +} + +// Small description of workflows, returned by server during listing +message WorkflowDesc { + // REQUIRED + string workflow_id = 1; + + // REQUIRED + State state = 2; +} + +// Available workflow types supported by a given instance of the service. +message WorkflowTypeVersion { + // an array of one or more acceptable types for the Workflow Type. For + // example, to send a base64 encoded WDL gzip, one could would offer + // "base64_wdl1.0_gzip". By setting this value, and the path of the main WDL + // to be executed in the workflow_url to "main.wdl" in the WorkflowRequest. + repeated string workflow_type_version = 1; +} + +message WorkflowRunId { + // workflow ID + string workflow_id = 1; +} + +message WorkflowStatus { + // workflow ID + string workflow_id = 1; + + // state + State state = 2; +} + +message WorkflowLog { + // workflow ID + string workflow_id = 1; + + // The original request message used to initiate this execution. + WorkflowRequest request = 2; + + // state + State state = 3; + + // the logs, and other key info like timing and exit code, for the overall run of this workflow + Log workflow_log = 4; + + // the logs, and other key info like timing and exit code, for each step in the workflow + repeated Log task_logs = 5; + + // the outputs + google.protobuf.Struct outputs = 6; +} + +// Log and other info +message Log { + // The task or workflow name + string name = 1; + + // The command line that was run + repeated string cmd = 2; + + // When the command was executed + string start_time = 3; + + // When the command completed + string end_time = 4; + + // Sample of stdout (not guaranteed to be entire log) + string stdout = 5; + + // Sample of stderr (not guaranteed to be entire log) + string stderr = 6; + + // Exit code of the program + int32 exit_code = 7; +} + +// Enumeration of states for a given workflow request +enum State { + + // The state of the task is unknown. + // + // This provides a safe default for messages where this field is missing, + // for example, so that a missing field does not accidentally imply that + // the state is QUEUED. + UNKNOWN = 0; + + // The task is queued. + QUEUED = 1; + + // The task has been assigned to a worker and is currently preparing to run. + // For example, the worker may be turning on, downloading input files, etc. + INITIALIZING = 2; + + // The task is running. Input files are downloaded and the first Executor + // has been started. + RUNNING = 3; + + // The task is paused. + // + // An implementation may have the ability to pause a task, but this is not required. + PAUSED = 4; + + // The task has completed running. Executors have exited without error + // and output files have been successfully uploaded. + COMPLETE = 5; + + // The task encountered an error in one of the Executor processes. Generally, + // this means that an Executor exited with a non-zero exit code. + EXECUTOR_ERROR = 6; + + // The task was stopped due to a system error, but not from an Executor, + // for example an upload failed due to network issues, the worker's ran out + // of disk space, etc. + SYSTEM_ERROR = 7; + + // The task was canceled by the user. + CANCELED = 8; +} + +// A message that allows one to describe default parameters for a workflow +// engine. +message DefaultWorkflowEngineParameter { + // Describes the type of the parameter, e.g. float. + string type = 1; + + // The stringified version of the default parameter. e.g. "2.45". + string default_value = 2; +} \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..6aa457a8 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +cwl-runner +cwltool==1.0.20161114152756 +schema-salad==1.18.20161005190847 +avro==1.8.1 diff --git a/src/main/resources/swagger/ga4gh-tool-discovery.yaml b/src/main/resources/swagger/ga4gh-tool-discovery.yaml deleted file mode 100644 index 75e0906f..00000000 --- a/src/main/resources/swagger/ga4gh-tool-discovery.yaml +++ /dev/null @@ -1,313 +0,0 @@ -swagger: '2.0' -info: - title: GA4GH Workflow Execution API - description: 'Proposed API for GA4GH workflow execution. A workflow is defined with a given format (currently CWL or WDL) and can encompass a single tool execution or a complex DAG of individual tool calls. The parameterization of the workflow called will follow the schema proposed in this group as a common format used for WDL and CWL execution' - version: 0.1.0 -produces: - - application/json - - text/plain -basePath: /api/v1 -tags: - - name: GA4GH - description: A set of resources proposed as a common standard for tool repositories -paths: - /tools/{registry-id}: - get: - summary: List one specific tool, acts as an anchor for self references - description: This endpoint returns one specific tool (which has ToolVersions nested inside it) - tags: - - GA4GH - parameters: - - name: registry-id - in: path - required: true - type: string - description: A unique identifier of the tool for this particular tool registry, for example `123456` - responses: - '200': - description: A tool. - schema: - $ref: '#/definitions/Tool' - - /tools/{registry-id}/version/{version-id}: - get: - summary: List one specific tool version, acts as an anchor for self references - description: This endpoint returns one specific tool version - tags: - - GA4GH - parameters: - - name: registry-id - in: path - required: true - type: string - description: A unique identifier of the tool for this particular tool registry, for example `123456` - - name: version-id - in: path - required: true - type: string - description: An identifier of the tool version for this particular tool registry, for example `v1` - responses: - '200': - description: A tool version. - schema: - $ref: '#/definitions/ToolVersion' - - /tools: - get: - summary: List all tools - description: > - This endpoint returns all tools available or a filtered subset using - metadata query parameters. - tags: - - GA4GH - parameters: - - name: registry-id - type: string - in: query - description: A unique identifier of the tool for this particular tool registry, for example `123456` - - name: registry - in: query - type: string - description: The image registry that contains the image. - - name: organization - in: query - type: string - description: The organization in the registry that published the image. - - name: name - in: query - type: string - description: The name of the image. - - name: toolname - in: query - type: string - description: The name of the tool. - - name: description - in: query - type: string - description: The description of the tool. - - name: author - in: query - type: string - description: 'The author of the tool (TODO a thought occurs, are we assuming that the author of the CWL and the image are the same?).' - responses: - '200': - description: An array of methods that match the filter. - schema: - type: array - items: - $ref: '#/definitions/Tool' - /tools/{registry-id}/version/{version-id}/descriptor: - get: - summary: Get the tool descriptor (CWL/WDL) for the specified tool. - description: Returns the CWL or WDL descriptor for the specified tool. - tags: - - GA4GH - parameters: - - name: format - in: query - description: The output type of the descriptor. If not specified it is up to the underlying implementation to determine which output format to return. - type: string - enum: - - CWL - - WDL - - name: registry-id - in: path - description: A unique identifier of the tool for this particular tool registry, for example `123456` - required: true - type: string - - name: version-id - in: path - required: true - type: string - description: An identifier of the tool version for this particular tool registry, for example `v1` - responses: - '200': - description: The tool descriptor. - schema: - $ref: '#/definitions/ToolDescriptor' - '404': - description: The tool can not be output in the specified format. - schema: - $ref: '#/definitions/Error' - /tools/{registry-id}/version/{version-id}/dockerfile: - get: - summary: Get the dockerfile for the specified image. - description: Returns the dockerfile for the specified image. - tags: - - GA4GH - parameters: - - name: registry-id - in: path - description: A unique identifier of the tool for this particular tool registry, for example `123456` - required: true - type: string - - name: version-id - in: path - required: true - type: string - description: An identifier of the tool version for this particular tool registry, for example `v1` - responses: - '200': - description: The tool payload. - schema: - $ref: '#/definitions/ToolDockerfile' - '404': - description: The tool payload is not present in the service. - schema: - $ref: '#/definitions/Error' - - /tools/metadata: - get: - summary: Return some metadata that is useful for describing this registry - description: Return some metadata that is useful for describing this registry - tags: - - GA4GH - responses: - '200': - description: A Metadata object describing this service. - schema: - $ref: '#/definitions/Metadata' - -definitions: - ToolType: - # thought. it would be nicer if ToolTypes are consistent across registries. How would we accomplish this? Operate a MIME-type like list? - description: Describes a type of tool allowing us to categorize workflows, the language of the workflow, tools, and maybe even other entities separately - properties: - id: - type: string - description: The unique identifier for the type - name: - type: string - description: A short friendly name for the type - description: - type: string - description: A longer explanation of what this type is and what it can accomplish - Tool: - description: A tool (or described tool) describes one pairing of a tool as described in a descriptor file (which potentially describes multiple tools) and a Docker image. - required: - - global-id - - registry-id - - registry - - organization - - name - - author - - meta-version - - tooltype - properties: - global-id: - type: string - description: The unique identifier for the image. (Proposed - This id should be globally unique across systems and should also identify the system that it comes from for example This id should be globally unique across systems, should also identify the system that it comes from, and be a URL that resolves for example `http://agora.broadinstitute.org/tools/123456`) - registry-id: - type: string - description: A unique identifier of the tool for this particular tool registry, for example `123456` or `123456_v1` - registry: - type: string - description: The registry that contains the image. - organization: - type: string - description: The organization that published the image. - name: - type: string - description: The name of the image. - toolname: - type: string - description: The name of the tool. - tooltype: - $ref: '#/definitions/ToolType' - description: - type: string - description: The description of the tool. - author: - type: string - description: Contact information for the author of this tool entry in the registry. (More complex authorship information is handled by the descriptor) - meta-version: - type: string - description: 'The version of this tool in the registry. Iterates when fields like the description, author, etc. are updated.' - contains: - description: An array of IDs for the applications that are stored inside this tool (for example `https://bio.tools/tool/mytum.de/SNAP2/1`) - type: array - items: - type: string - versions: - type: array - items: - $ref: '#/definitions/ToolVersion' - ToolVersion: - description: A tool version describes a particular iteration of a tool as described by a reference to a specific image and dockerfile. - required: - - global-id - - descriptor - - registry-id - - image - - meta-version - properties: - name: - type: string - description: The name of the version. - global-id: - type: string - description: The unique identifier for this version of a tool. (Proposed - This id should be globally unique across systems and should also identify the system that it comes from for example This id should be globally unique across systems, should also identify the system that it comes from, and be a URL that resolves for example `http://agora.broadinstitute.org/tools/123456/v1` This can be the same as the registry-id depending on the structure of your registry) - registry-id: - type: string - description: An identifier of the version of this tool for this particular tool registry, for example `v1` - image: - type: string - description: The docker path to the image (and version) for this tool. (e.g. quay.io/seqware/seqware_full/1.1) - descriptor: - $ref: '#/definitions/ToolDescriptor' - dockerfile: - $ref: '#/definitions/ToolDockerfile' - meta-version: - type: string - description: 'The version of this tool version in the registry. Iterates when fields like the description, author, etc. are updated.' - ToolDescriptor: - description: A tool descriptor is a metadata document that describes one or more tools. - required: - - descriptor - properties: - descriptor: - type: string - description: The descriptor that represents this version of the tool. (CWL or WDL) - url: - type: string - description: 'Optional url to the tool descriptor used to build this image, should include version information, and can include a git hash (e.g. https://raw.githubusercontent.com/ICGC-TCGA-PanCancer/pcawg_delly_workflow/ea2a5db69bd20a42976838790bc29294df3af02b/delly_docker/Delly.cwl )' - ToolDockerfile: - description: A tool dockerfile is a document that describes how to build a particular Docker image. - required: - - dockerfile - properties: - dockerfile: - type: string - description: The dockerfile content for this tool. - url: - type: string - description: 'Optional url to the dockerfile used to build this image, should include version information, and can include a git hash (e.g. https://raw.githubusercontent.com/ICGC-TCGA-PanCancer/pcawg_delly_workflow/c83478829802b4d36374870843821abe1b625a71/delly_docker/Dockerfile )' - Metadata: - description: Describes this registry to better allow for mirroring and indexing. - required: - - version - properties: - version: - type: string - description: The version of this registry - country: - type: string - description: A country code for the registry (ISO 3166-1 alpha-3) - friendly-name: - type: string - description: A friendly name that can be used in addition to the hostname to describe a registry - - Error: - required: - - code - properties: - code: - type: integer - format: int32 - default: 500 - message: - type: string - default: Internal Server Error -externalDocs: - description: Description of GA4GH Tool Registry (Exchange) Schema - url: 'https://github.com/ga4gh/tool-registry-schemas' diff --git a/swagger/proto/workflow_execution.swagger.json b/swagger/proto/workflow_execution.swagger.json deleted file mode 100644 index a2b1235b..00000000 --- a/swagger/proto/workflow_execution.swagger.json +++ /dev/null @@ -1,463 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "workflow_execution.proto", - "version": "version not set" - }, - "schemes": [ - "http", - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/ga4gh/wes/v1/service-info": { - "get": { - "summary": "Get information about Workflow Execution Service. May include information related (but not limited to) the workflow descriptor formats, versions supported, the WES API versions supported, and information about general the service availability.", - "operationId": "GetServiceInfo", - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/ga4gh_wes_service_info" - } - } - }, - "tags": [ - "WorkflowExecutionService" - ] - } - }, - "/ga4gh/wes/v1/workflows": { - "get": { - "summary": "List the workflows, this endpoint will list the workflows in order of oldest to newest. There is no guarantee of live updates as the user traverses the pages, the behavior should be decided (and documented) by each implementation.", - "operationId": "ListWorkflows", - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/ga4gh_wes_workflow_list_response" - } - } - }, - "parameters": [ - { - "name": "page_size", - "description": "OPTIONAL\nNumber of workflows to return at once. Defaults to 256, and max is 2048.", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "page_token", - "description": "OPTIONAL\nToken to use to indicate where to start getting results. If unspecified, returns the first page of results.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "key_value_search", - "description": "OPTIONAL\nFor each key, if the key's value is empty string then match workflows that are tagged with this key regardless of value.", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "WorkflowExecutionService" - ] - }, - "post": { - "summary": "Run a workflow, this endpoint will allow you to create a new workflow request and retrieve its tracking ID to monitor its progress. An important assumption in this endpoint is that the workflow_params JSON will include parameterizations along with input and output files. The latter two may be on S3, Google object storage, local filesystems, etc. This specification makes no distinction. However, it is assumed that the submitter is using URLs that this system both understands and can access. For Amazon S3, this could be accomplished by given the credentials associated with a WES service access to a particular bucket. The details are important for a production system and user on-boarding but outside the scope of this spec.", - "operationId": "RunWorkflow", - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/ga4gh_wes_workflow_run_id" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ga4gh_wes_workflow_request" - } - } - ], - "tags": [ - "WorkflowExecutionService" - ] - } - }, - "/ga4gh/wes/v1/workflows/{workflow_id}": { - "get": { - "summary": "Get detailed info about a running workflow", - "operationId": "GetWorkflowLog", - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/ga4gh_wes_workflow_log" - } - } - }, - "parameters": [ - { - "name": "workflow_id", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "WorkflowExecutionService" - ] - }, - "delete": { - "summary": "Cancel a running workflow", - "operationId": "CancelJob", - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/ga4gh_wes_workflow_run_id" - } - } - }, - "parameters": [ - { - "name": "workflow_id", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "WorkflowExecutionService" - ] - } - }, - "/ga4gh/wes/v1/workflows/{workflow_id}/status": { - "get": { - "summary": "Get quick status info about a running workflow", - "operationId": "GetWorkflowStatus", - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/ga4gh_wes_workflow_status" - } - } - }, - "parameters": [ - { - "name": "workflow_id", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "WorkflowExecutionService" - ] - } - } - }, - "definitions": { - "ga4gh_wes_log": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "The task or workflow name" - }, - "cmd": { - "type": "array", - "items": { - "type": "string" - }, - "title": "The command line that was run" - }, - "startTime": { - "type": "string", - "title": "When the command was executed" - }, - "endTime": { - "type": "string", - "title": "When the command completed" - }, - "stdout": { - "type": "string", - "title": "Sample of stdout (not guaranteed to be entire log)" - }, - "stderr": { - "type": "string", - "title": "Sample of stderr (not guaranteed to be entire log)" - }, - "exitCode": { - "type": "integer", - "format": "int32", - "title": "Exit code of the program" - } - }, - "title": "Log and other info" - }, - "ga4gh_wes_parameter": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "REQUIRED\nname of the parameter" - }, - "value": { - "type": "string", - "title": "OPTIONAL\nValue" - }, - "location": { - "type": "string", - "title": "REQUIRED\nlocation in long term storage, is a url specific to the implementing\nsystem. For example s3://my-object-store/file1 or gs://my-bucket/file2 or\nfile:///path/to/my/file" - }, - "type": { - "$ref": "#/definitions/ga4gh_wes_parameter_types", - "title": "REQUIRED\nType of data, \"Parameter\", \"File\" or \"Directory\"\nif used for an output all the files in the directory\nwill be copied to the storage location" - } - }, - "description": "Parameters for workflows or tasks, these are either output parameters, files, or directories, the latter two are stagged to an object store or something similar for hand back to the caller." - }, - "ga4gh_wes_parameter_types": { - "type": "string", - "enum": [ - "Directory", - "File", - "Parameter" - ], - "default": "Directory", - "title": "Enum for parameter types" - }, - "ga4gh_wes_service_info": { - "type": "object", - "properties": { - "workflow_type_versions": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/ga4gh_wes_workflow_type_version" - }, - "title": "A map with keys as the workflow format type name (currently only CWL and WDL are used although a service may support others) and value is a workflow_type_version object which simply contains an array of one or more version strings" - }, - "supported_wes_versions": { - "type": "array", - "items": { - "type": "string" - }, - "title": "The version(s) of the WES schema supported by this service" - }, - "supported_filesystem_protocols": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The filesystem protocols supported by this service, currently these may include common protocols such as 'http', 'https', 'sftp', 's3', 'gs', 'file', 'synapse', or others as supported by this service." - }, - "engine_versions": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "title": "The engine(s) used by this WES service, key is engine name e.g. Cromwell and value is version" - }, - "system_state_counts": { - "type": "object", - "additionalProperties": { - "type": "integer", - "format": "int64" - }, - "description": "The system statistics, key is the statistic, value is the count of workflows in that state. See the State enum for the possible keys." - }, - "key_values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "title": "a key-value map of arbitrary, extended metadata outside the scope of the above but useful to report back" - } - }, - "description": "." - }, - "ga4gh_wes_service_info_request": { - "type": "object", - "title": "Blank request message for service request" - }, - "ga4gh_wes_state": { - "type": "string", - "enum": [ - "Unknown", - "Queued", - "Running", - "Paused", - "Complete", - "Error", - "SystemError", - "Canceled", - "Initializing" - ], - "default": "Unknown", - "title": "Enum for states" - }, - "ga4gh_wes_workflow_desc": { - "type": "object", - "properties": { - "workflow_id": { - "type": "string", - "title": "REQUIRED" - }, - "state": { - "$ref": "#/definitions/ga4gh_wes_state", - "title": "REQUIRED" - } - }, - "title": "Small description of workflows, returned by server during listing" - }, - "ga4gh_wes_workflow_list_request": { - "type": "object", - "properties": { - "page_size": { - "type": "integer", - "format": "int64", - "description": "OPTIONAL\nNumber of workflows to return at once. Defaults to 256, and max is 2048." - }, - "page_token": { - "type": "string", - "description": "OPTIONAL\nToken to use to indicate where to start getting results. If unspecified, returns the first page of results." - }, - "key_value_search": { - "type": "string", - "title": "OPTIONAL\nFor each key, if the key's value is empty string then match workflows that are tagged with this key regardless of value" - } - }, - "title": "Request listing of jobs tracked by server" - }, - "ga4gh_wes_workflow_list_response": { - "type": "object", - "properties": { - "workflows": { - "type": "array", - "items": { - "$ref": "#/definitions/ga4gh_wes_workflow_desc" - } - }, - "next_page_token": { - "type": "string" - } - }, - "title": "Return envelope for workflow listing" - }, - "ga4gh_wes_workflow_log": { - "type": "object", - "properties": { - "workflow_id": { - "type": "string", - "title": "workflow ID" - }, - "request": { - "$ref": "#/definitions/ga4gh_wes_workflow_request", - "title": "the original request object" - }, - "state": { - "$ref": "#/definitions/ga4gh_wes_state", - "title": "state" - }, - "workflow_log": { - "$ref": "#/definitions/ga4gh_wes_log", - "title": "the logs, and other key info like timing and exit code, for the overall run of this workflow" - }, - "task_logs": { - "type": "array", - "items": { - "$ref": "#/definitions/ga4gh_wes_log" - }, - "title": "the logs, and other key info like timing and exit code, for each step in the workflow" - }, - "outputs": { - "type": "array", - "items": { - "$ref": "#/definitions/ga4gh_wes_parameter" - }, - "title": "the outputs" - } - } - }, - "ga4gh_wes_workflow_request": { - "type": "object", - "properties": { - "workflow_descriptor": { - "type": "string", - "title": "REQUIRED\nthe workflow CWL or WDL document" - }, - "workflow_params": { - "type": "string", - "title": "REQUIRED\nthe workflow parameterization document (typically a JSON file), includes all parameterizations for the workflow including input and output file locations" - }, - "workflow_type": { - "type": "string", - "title": "REQUIRED\nthe workflow descriptor type, must be \"CWL\" or \"WDL\" currently (or another alternative supported by this WES instance)" - }, - "workflow_type_version": { - "type": "string", - "title": "REQUIRED\nthe workflow descriptor type version, must be one supported by this WES instance" - }, - "key_values": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "title": "OPTIONAL\na key-value map of arbitrary metadata outside the scope of the workflow_params but useful to track with this workflow request" - } - }, - "title": "workflow request object" - }, - "ga4gh_wes_workflow_run_id": { - "type": "object", - "properties": { - "workflow_id": { - "type": "string", - "title": "workflow ID" - } - } - }, - "ga4gh_wes_workflow_status": { - "type": "object", - "properties": { - "workflow_id": { - "type": "string", - "title": "workflow ID" - }, - "state": { - "$ref": "#/definitions/ga4gh_wes_state", - "title": "state" - } - } - }, - "ga4gh_wes_workflow_type_version": { - "type": "object", - "properties": { - "workflow_type_version": { - "type": "array", - "items": { - "type": "string" - }, - "title": "an array of one or more version strings" - } - }, - "title": "available workflow types supported by this WES" - } - } -} diff --git a/swagger/workflow_execution_service.swagger.json b/swagger/workflow_execution_service.swagger.json new file mode 100644 index 00000000..d158ae52 --- /dev/null +++ b/swagger/workflow_execution_service.swagger.json @@ -0,0 +1,516 @@ +{ + "basePath": "/", "swagger": "2.0", + "info": { + "title": "workflow_execution_service.proto", + "version": "version not set" + }, + "schemes": [ + "http", + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/ga4gh/wes/v1/service-info": { + "get": { + "summary": "Get information about Workflow Execution Service. May include information related (but\nnot limited to) the workflow descriptor formats, versions supported, the WES API versions supported, and information about general the service availability.", + "x-swagger-router-controller": "ga4gh.wes.server", + "operationId": "GetServiceInfo", + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ga4gh_wes_ServiceInfo" + } + } + }, + "tags": [ + "WorkflowExecutionService" + ] + } + }, + "/ga4gh/wes/v1/workflows": { + "get": { + "summary": "List the workflows, this endpoint will list the workflows in order of oldest to newest.\nThere is no guarantee of live updates as the user traverses the pages, the behavior should be\ndecided (and documented) by each implementation.\nTo monitor a given execution, use GetWorkflowStatus or GetWorkflowLog.", + "x-swagger-router-controller": "ga4gh.wes.server", + "operationId": "ListWorkflows", + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ga4gh_wes_WorkflowListResponse" + } + } + }, + "parameters": [ + { + "name": "page_size", + "description": "OPTIONAL\nNumber of workflows to return in a page.", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" + }, + { + "name": "page_token", + "description": "OPTIONAL\nToken to use to indicate where to start getting results. If unspecified, returns the first\npage of results.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "tag_search", + "description": "OPTIONAL\nFor each key, if the key's value is empty string then match workflows that are tagged with\nthis key regardless of value.", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "WorkflowExecutionService" + ] + }, + "post": { + "summary": "Run a workflow, this endpoint will allow you to create a new workflow request and\nretrieve its tracking ID to monitor its progress. An important assumption in this\nendpoint is that the workflow_params JSON will include parameterizations along with\ninput and output files. The latter two may be on S3, Google object storage, local filesystems,\netc. This specification makes no distinction. However, it is assumed that the submitter\nis using URLs that this system both understands and can access. For Amazon S3, this could\nbe accomplished by given the credentials associated with a WES service access to a\nparticular bucket. The details are important for a production system and user on-boarding\nbut outside the scope of this spec.", + "x-swagger-router-controller": "ga4gh.wes.server", + "operationId": "RunWorkflow", + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ga4gh_wes_WorkflowRunId" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ga4gh_wes_WorkflowRequest" + } + } + ], + "tags": [ + "WorkflowExecutionService" + ] + } + }, + "/ga4gh/wes/v1/workflows/{workflow_id}": { + "get": { + "summary": "Get detailed info about a running workflow.", + "x-swagger-router-controller": "ga4gh.wes.server", + "operationId": "GetWorkflowLog", + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ga4gh_wes_WorkflowLog" + } + } + }, + "parameters": [ + { + "name": "workflow_id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "WorkflowExecutionService" + ] + }, + "delete": { + "summary": "Cancel a running workflow.", + "x-swagger-router-controller": "ga4gh.wes.server", + "operationId": "CancelJob", + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ga4gh_wes_WorkflowRunId" + } + } + }, + "parameters": [ + { + "name": "workflow_id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "WorkflowExecutionService" + ] + } + }, + "/ga4gh/wes/v1/workflows/{workflow_id}/status": { + "get": { + "summary": "Get quick status info about a running workflow.", + "x-swagger-router-controller": "ga4gh.wes.server", + "operationId": "GetWorkflowStatus", + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ga4gh_wes_WorkflowStatus" + } + } + }, + "parameters": [ + { + "name": "workflow_id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "WorkflowExecutionService" + ] + } + } + }, + "definitions": { + "ga4gh_wes_DefaultWorkflowEngineParameter": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Describes the type of the parameter, e.g. float." + }, + "default_value": { + "type": "string", + "description": "The stringified version of the default parameter. e.g. \"2.45\"." + } + }, + "description": "A message that allows one to describe default parameters for a workflow\nengine." + }, + "ga4gh_wes_Log": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "The task or workflow name" + }, + "cmd": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The command line that was run" + }, + "start_time": { + "type": "string", + "title": "When the command was executed" + }, + "end_time": { + "type": "string", + "title": "When the command completed" + }, + "stdout": { + "type": "string", + "title": "Sample of stdout (not guaranteed to be entire log)" + }, + "stderr": { + "type": "string", + "title": "Sample of stderr (not guaranteed to be entire log)" + }, + "exit_code": { + "type": "integer", + "format": "int32", + "title": "Exit code of the program" + } + }, + "title": "Log and other info" + }, + "ga4gh_wes_ServiceInfo": { + "type": "object", + "properties": { + "workflow_type_versions": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ga4gh_wes_WorkflowTypeVersion" + }, + "title": "A map with keys as the workflow format type name (currently only CWL and WDL are used\nalthough a service may support others) and value is a workflow_type_version object which\nsimply contains an array of one or more version strings" + }, + "supported_wes_versions": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The version(s) of the WES schema supported by this service" + }, + "supported_filesystem_protocols": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The filesystem protocols supported by this service, currently these may include common\nprotocols such as 'http', 'https', 'sftp', 's3', 'gs', 'file', 'synapse', or others as\nsupported by this service." + }, + "workflow_engine_versions": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "title": "The engine(s) used by this WES service, key is engine name e.g. Cromwell and value is version" + }, + "default_workflow_engine_parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/ga4gh_wes_DefaultWorkflowEngineParameter" + }, + "description": "Each workflow engine can present additional parameters that can be sent to the\nworkflow engine. This message will list the default values, and their types for each\nworkflow engine." + }, + "system_state_counts": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "int64" + }, + "description": "The system statistics, key is the statistic, value is the count of workflows in that state.\nSee the State enum for the possible keys." + }, + "auth_instructions_url": { + "type": "string", + "description": "A URL that will help a in generating the tokens necessary to run a workflow using this\nservice." + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "title": "A key-value map of arbitrary, extended metadata outside the scope of the above but useful\nto report back" + } + }, + "description": "A message containing useful information about the running service, including supported versions and\ndefault settings." + }, + "ga4gh_wes_State": { + "type": "string", + "enum": [ + "UNKNOWN", + "QUEUED", + "INITIALIZING", + "RUNNING", + "PAUSED", + "COMPLETE", + "EXECUTOR_ERROR", + "SYSTEM_ERROR", + "CANCELED" + ], + "default": "UNKNOWN", + "description": "- UNKNOWN: The state of the task is unknown.\n\nThis provides a safe default for messages where this field is missing,\nfor example, so that a missing field does not accidentally imply that\nthe state is QUEUED.\n - QUEUED: The task is queued.\n - INITIALIZING: The task has been assigned to a worker and is currently preparing to run.\nFor example, the worker may be turning on, downloading input files, etc.\n - RUNNING: The task is running. Input files are downloaded and the first Executor\nhas been started.\n - PAUSED: The task is paused.\n\nAn implementation may have the ability to pause a task, but this is not required.\n - COMPLETE: The task has completed running. Executors have exited without error\nand output files have been successfully uploaded.\n - EXECUTOR_ERROR: The task encountered an error in one of the Executor processes. Generally,\nthis means that an Executor exited with a non-zero exit code.\n - SYSTEM_ERROR: The task was stopped due to a system error, but not from an Executor,\nfor example an upload failed due to network issues, the worker's ran out\nof disk space, etc.\n - CANCELED: The task was canceled by the user.", + "title": "Enumeration of states for a given workflow request" + }, + "ga4gh_wes_WorkflowDesc": { + "type": "object", + "properties": { + "workflow_id": { + "type": "string", + "title": "REQUIRED" + }, + "state": { + "$ref": "#/definitions/ga4gh_wes_State", + "title": "REQUIRED" + } + }, + "title": "Small description of workflows, returned by server during listing" + }, + "ga4gh_wes_WorkflowListResponse": { + "type": "object", + "properties": { + "workflows": { + "type": "array", + "items": { + "$ref": "#/definitions/ga4gh_wes_WorkflowDesc" + }, + "description": "A list of workflows that the service has executed or is executing." + }, + "next_page_token": { + "type": "string", + "description": "A token, which when provided in a workflow_list_request, allows one to retrieve the next page\nof results." + } + }, + "description": "The service will return a workflow_list_response when receiving a successful workflow_list_request." + }, + "ga4gh_wes_WorkflowLog": { + "type": "object", + "properties": { + "workflow_id": { + "type": "string", + "title": "workflow ID" + }, + "request": { + "$ref": "#/definitions/ga4gh_wes_WorkflowRequest", + "description": "The original request message used to initiate this execution." + }, + "state": { + "$ref": "#/definitions/ga4gh_wes_State", + "title": "state" + }, + "workflow_log": { + "$ref": "#/definitions/ga4gh_wes_Log", + "title": "the logs, and other key info like timing and exit code, for the overall run of this workflow" + }, + "task_logs": { + "type": "array", + "items": { + "$ref": "#/definitions/ga4gh_wes_Log" + }, + "title": "the logs, and other key info like timing and exit code, for each step in the workflow" + }, + "outputs": { + "$ref": "#/definitions/protobufStruct", + "title": "the outputs" + } + } + }, + "ga4gh_wes_WorkflowRequest": { + "type": "object", + "properties": { + "workflow_descriptor": { + "type": "string", + "description": "OPTIONAL\nThe workflow CWL or WDL document, must provide either this or workflow_url. By combining\nthis message with a workflow_type_version offered in ServiceInfo, one can initialize\nCWL, WDL, or a base64 encoded gzip of the required workflow descriptors. When files must be\ncreated in this way, the `workflow_url` should be set to the path of the main\nworkflow descriptor." + }, + "workflow_params": { + "$ref": "#/definitions/protobufStruct", + "description": "REQUIRED\nThe workflow parameterization document (typically a JSON file), includes all parameterizations for the workflow\nincluding input and output file locations." + }, + "workflow_type": { + "type": "string", + "title": "REQUIRED\nThe workflow descriptor type, must be \"CWL\" or \"WDL\" currently (or another alternative supported by this WES instance)" + }, + "workflow_type_version": { + "type": "string", + "title": "REQUIRED\nThe workflow descriptor type version, must be one supported by this WES instance" + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "title": "OPTIONAL\nA key-value map of arbitrary metadata outside the scope of the workflow_params but useful to track with this workflow request" + }, + "workflow_engine_parameters": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "OPTIONAL\nAdditional parameters can be sent to the workflow engine using this field. Default values\nfor these parameters are provided at the ServiceInfo endpoint." + }, + "workflow_url": { + "type": "string", + "description": "OPTIONAL\nThe workflow CWL or WDL document, must provide either this or workflow_descriptor. When a base64 encoded gzip of\nworkflow descriptor files is offered, the `workflow_url` should be set to the relative path\nof the main workflow descriptor." + } + }, + "description": "To execute a workflow, send a workflow request including all the details needed to begin downloading\nand executing a given workflow." + }, + "ga4gh_wes_WorkflowRunId": { + "type": "object", + "properties": { + "workflow_id": { + "type": "string", + "title": "workflow ID" + } + } + }, + "ga4gh_wes_WorkflowStatus": { + "type": "object", + "properties": { + "workflow_id": { + "type": "string", + "title": "workflow ID" + }, + "state": { + "$ref": "#/definitions/ga4gh_wes_State", + "title": "state" + } + } + }, + "ga4gh_wes_WorkflowTypeVersion": { + "type": "object", + "properties": { + "workflow_type_version": { + "type": "array", + "items": { + "type": "string" + }, + "description": "an array of one or more acceptable types for the Workflow Type. For\nexample, to send a base64 encoded WDL gzip, one could would offer\n\"base64_wdl1.0_gzip\". By setting this value, and the path of the main WDL\nto be executed in the workflow_url to \"main.wdl\" in the WorkflowRequest." + } + }, + "description": "Available workflow types supported by a given instance of the service." + }, + "protobufListValue": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufValue" + }, + "description": "Repeated field of dynamically typed values." + } + }, + "description": "`ListValue` is a wrapper around a repeated field of values.\n\nThe JSON representation for `ListValue` is JSON array." + }, + "protobufNullValue": { + "type": "string", + "enum": [ + "NULL_VALUE" + ], + "default": "NULL_VALUE", + "description": "`NullValue` is a singleton enumeration to represent the null value for the\n`Value` type union.\n\n The JSON representation for `NullValue` is JSON `null`.\n\n - NULL_VALUE: Null value." + }, + "protobufStruct": { + "type": "object", + "properties": { + "fields": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/protobufValue" + }, + "description": "Unordered map of dynamically typed values." + } + }, + "description": "`Struct` represents a structured data value, consisting of fields\nwhich map to dynamically typed values. In some languages, `Struct`\nmight be supported by a native representation. For example, in\nscripting languages like JS a struct is represented as an\nobject. The details of that representation are described together\nwith the proto support for the language.\n\nThe JSON representation for `Struct` is JSON object." + }, + "protobufValue": { + "type": "object", + "properties": { + "null_value": { + "$ref": "#/definitions/protobufNullValue", + "description": "Represents a null value." + }, + "number_value": { + "type": "number", + "format": "double", + "description": "Represents a double value." + }, + "string_value": { + "type": "string", + "description": "Represents a string value." + }, + "bool_value": { + "type": "boolean", + "format": "boolean", + "description": "Represents a boolean value." + }, + "struct_value": { + "$ref": "#/definitions/protobufStruct", + "description": "Represents a structured value." + }, + "list_value": { + "$ref": "#/definitions/protobufListValue", + "description": "Represents a repeated `Value`." + } + }, + "description": "`Value` represents a dynamically typed value which can be either\nnull, a number, a string, a boolean, a recursive struct value, or a\nlist of values. A producer of value is expected to set one of that\nvariants, absence of any variant indicates an error.\n\nThe JSON representation for `Value` is JSON value." + } + } +} diff --git a/swagger_editor.png b/swagger_editor.png deleted file mode 100644 index e35ad5d5..00000000 Binary files a/swagger_editor.png and /dev/null differ diff --git a/task-execution-schemas b/task-execution-schemas deleted file mode 160000 index ba01c73a..00000000 --- a/task-execution-schemas +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ba01c73ab9fd54624f83a67b403f85f694f989fa diff --git a/tools/prepare_openapi.sh b/tools/prepare_openapi.sh new file mode 100644 index 00000000..a206fe19 --- /dev/null +++ b/tools/prepare_openapi.sh @@ -0,0 +1,6 @@ +# Add a line for setting the controller "app" which matches the name of the +# module that hosts the controller functions. +sed -i 's/"operation/"x-swagger-router-controller": "ga4gh.wes.server", \n "operation/g' workflow_execution_service.swagger.json +# Inject a base path +sed -i 's/"swagger"/ "basePath": "\/", "swagger"/g' workflow_execution_service.swagger.json +mv workflow_execution_service.swagger.json swagger/workflow_execution_service.swagger.json