Support ad-hoc CWL workflows #997
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #997 +/- ##
=======================================
Coverage 88.44% 88.44%
=======================================
Files 88 88
Lines 20874 20961 +87
Branches 2760 2789 +29
=======================================
+ Hits 18462 18540 +78
Misses 1726 1726
- Partials 686 695 +9 ☔ View full report in Codecov by Harness. |
fmigneault
left a comment
There was a problem hiding this comment.
Great PR! Thanks for the updates. Some semantic adjustment needed for the process description profile URI that is misused.
| .. _app_pkg_adhoc: | ||
|
|
||
| Ad-hoc Workflow Execution | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
There was a problem hiding this comment.
Can you move the section under processes.rst.
I think it would make more sense there in between "Execution KVP-encoded" and "Execution Steps".
For consistency, the title could be "Execution of Ad-hoc Workflow"
| Ad-hoc Workflow Execution | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
| `Weaver` supports *ad-hoc* workflow execution, allowing users to deploy and execute a :term:`CWL` workflow in a single |
There was a problem hiding this comment.
Please add this:
# in references.rst (near corresponding definitions)
.. |ogc-api-proc-part3-cwl-ad-hoc-exec| replace:: :term:`CWL` *ad-hoc* workflow execution
.. _ogc-api-proc-part3-cwl-ad-hoc-exec: https://docs.ogc.org/DRAFTS/21-009.html#section_cwl_workflowsThen, reword as
`Weaver` supports |ogc-api-proc-part3-cwl-ad-hoc-exec|_ from the |ogc-api-proc-part3|_ standard, which allows ...| 1. One or more :term:`CWL` parts (workflow and any dependent tools) with | ||
| ``Content-Profile: http://www.opengis.net/def/ogcapi-processes/2.0/process-description`` |
There was a problem hiding this comment.
The Content-Profile: http://www.opengis.net/def/ogcapi-processes/2.0/process-description header would apply to cases where additional process metadata is provided (i.e.: #990)
Here, the CWL parts just need to have the relevant application/cwl[+json|yaml].
Therefore, there could optionally be other "Process Description" parts using the indicated Content-Profile.
Consider adding a reference to proc_ogc_api_multi_cwl section by indicating that it follows the same concepts and procedure defined there.
|
|
||
| 1. One or more :term:`CWL` parts (workflow and any dependent tools) with | ||
| ``Content-Profile: http://www.opengis.net/def/ogcapi-processes/2.0/process-description`` | ||
| 2. One execution request part with ``Content-Profile: http://www.opengis.net/def/ogcapi-processes/2.0/execute`` |
There was a problem hiding this comment.
Make sure to update the URIs with HTTPS.
| Content-Profile: http://www.opengis.net/def/ogcapi-processes/2.0/process-description | ||
|
|
There was a problem hiding this comment.
To be removed since that is not the corresponding profile for the CWL part contents.
If the code already supports dealing with multiple application/json of different Content-Profile, you can move this under a separte section like:
--adhoc-boundary
Content-Type: application/json
Content-Profile: http://www.opengis.net/def/ogcapi-processes/2.0/process-description
{
"id": "adhoc-workflow",
"description": "Example ad-hoc workflow deployed and executed inline."
}| :param interpreted_parts: ``list`` of interpreted parts (content_type, content_id, content_location, profile, data) | ||
| :param root_workflow_cid: Content-ID of root workflow from ``start`` parameter (if any) |
There was a problem hiding this comment.
code quotes for Content-ID and the tuple
| if profile == sd.OGC_API_PROC_PROFILE_EXECUTE_URI: | ||
| if execution_request is not None: |
There was a problem hiding this comment.
Planing ahead, the profile should be a list where matching must be "any of" those URI.
| isinstance(part_data, dict) and "cwlVersion" in part_data and "$graph" in part_data | ||
| ): | ||
| deployment_parts.append((content_type_part, content_id, content_location, profile, part_data)) | ||
| # JSON/YAML parts without profile could be execution request (fallback) |
There was a problem hiding this comment.
for clairity, indicate that the YAML is expecte to have been pre-converted to JSON
| "title": "Missing CWL packages", | ||
| "description": ( | ||
| "Multipart request must contain at least one CWL package part for ad-hoc workflow execution. " | ||
| f"Use Content-Profile: {sd.OGC_API_PROC_PROFILE_PROC_DESC_URI} header " |
There was a problem hiding this comment.
to adjust as per other comments
hint toward the CWL media-types instead
| for _, content_id, _, _, part_data in deployment_parts: | ||
| if isinstance(part_data, dict): |
There was a problem hiding this comment.
Should there be an extra check of application/cwl[+json|+yaml] here?
https://crim-ca.atlassian.net/browse/NRCAN06-88
Add support for ad-hoc
CWLworkflow execution through thePOST /jobsendpoint usingmultipart/mixedor
multipart/relatedcontent types. Users can now deploy and execute aProcessin a single request bysubmitting both the
CWLworkflow definition (withContent-Profile: http://www.opengis.net/def/ogcapi-processes/2.0/process-description)and execution parameters (with
Content-Profile: http://www.opengis.net/def/ogcapi-processes/2.0/execute)in a multipart request body. The workflow is automatically deployed (with temporary
ad-hoctagging) beforeexecution, eliminating the need for separate deployment and execution steps for one-time workflow runs
resolves Support ad-hoc CWL workflows #834