flytepropeller
flytepropeller copied to clipboard
real time deck support
TL;DR
This PR adds real-time deck support.
Previously:
- Propeller would only send a node event to the admin when there was a change in the node state (e.g., from 'Queued' to 'Running', or from 'Running' to 'Succeeding').
- The deck URI was only added to the node event if the URI existed in remote storage(S3) and the task had succeeded.
- If deck URI is in node event, the deck URI would be stored in the admin and later fetched by the console.
With this PR:
- Propeller will continue to send node events to the admin upon any changes in node state.
- Propeller will now always add the deck URI to the event at non-final state(like at running time, so it is possible deck uri actually does not exist).
- Once the task is in final state(succeeded or failed), deck URI will be removed in node event if not exists.
- the deck URI will be stored in the admin and fetched by the console, even while the task is running. During running time, it is possible the deck URI is stored though actually not exists. But once the task is finished, deck URI will be removed if not exists.
Why not only add deck URI to event when the URI exists?
Due to constraints within Propeller, we cannot determine if a user has enabled deck or when they will upload the deck.html to remote storage. Therefore, without constantly checking the existence of the URI at every reconciliation (which would be too costly), it's impossible to know when the URI becomes available.
More details
As node events are only sent when the node state changes, the only chance we have to send the deck URI with the event is when the state changes from 'Queued' to 'Running'. As explained above, it is not feasible to send additional events once the deck URI exists, as we cannot accurately determine when the URI will become available.
Checks and behaviors
- Running a task with deck disabled. Deck URI should appears during the task running time but will not shown when task succeeded or failed.
- running:
- succeeded:
- failed:
- Running a task with deck enabled. Deck URI should appears during the task running time as well as when task succeed or failed.
- running:
- succeeded:
- failed:
real time deck support includes:
- flytekit: https://github.com/flyteorg/flytekit/pull/1704
- flyteadmin: https://github.com/flyteorg/flyteadmin/pull/579
- flytepropeller: https://github.com/flyteorg/flytepropeller/pull/579
- flyteconsole: https://github.com/flyteorg/flyteconsole/pull/781
Type
- [ ] Bug Fix
- [x] Feature
- [ ] Plugin
Are all requirements met?
- [ ] Code completed
- [ ] Smoke tested
- [ ] Unit tests added
- [ ] Code documentation added
- [ ] Any pending items have an associated Issue