Task state change callback mechanism #57
Labels
priority: low
Low priority
status flag: help wanted
Extra attention is needed
status: on hold
Won't be fixed for now
type: feature
New feature or request
type flag: spec change
Proposed change requires spec changes
workload: days
Likely takes days to resolve
Is your feature request related to a problem? Please describe.
Currently, tracking of task states is (or will be) implemented by parsing
cwl-tes
logs in conjunction with polling of the relevant TES endpoint bycwl-tes
. The latter imposes a high burden on the TES instance when handling many tasks simultaneously and may further require unnecessary token refreshing.Describe the solution you'd like
Current WES/TES specs do not provide a callback solution. An outline for such a solution could be:
POST /tasks
request to TES should contain a fieldcallback_url
to let the TES instance know to which WES instance it should report back a state changePOST /task-state
(or similar) endpoint should be added to the WES specs, requiring a TEStask_id
and the new state of the task as parameterscallback_url
is non-empty); if callback remains an optional TES feature, a Boolean field such ascallback_supported
could further be added to the TESservice-info
endpoint to allow WES to verify whether a given TES instance supports callbackIn this way, WES should be able to handle incoming task state changes gracefully, without having to resort to polling. In order to prevent TES having to have access to a refresh token (in case a task lasts longer than the auth token remains to be valid), access to the new WES endpoint should be granted either by a valid token or by the token that was attached when the corresponding task was originally posted by WES.
Describe alternatives you've considered
Given that distributed task execution requires that WES and TES not be coupled, even for a given workflow run, and that, moreover, statelessness of WES and TES should be maintained, the number of possible alternatives is limited. As WES cannot know what happens inside TES, it either has to ask or rely on a signal sent by TES to WES.
Additional context
Polling can be retained as a fallback mechanism. Make sure to consider integrated WES-ELIXIR/TESK solution and other solutions without proTES and with other TES implementations, e.g., Funnel.
The text was updated successfully, but these errors were encountered: