-
Notifications
You must be signed in to change notification settings - Fork 832
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(scheduler): Report lack of dataflow engines in pipeline statuses #5080
Merged
agrski
merged 10 commits into
SeldonIO:v2
from
agrski:update-pipeline-status-to-report-lack-of-dataflow-engines
Aug 14, 2023
Merged
feat(scheduler): Report lack of dataflow engines in pipeline statuses #5080
agrski
merged 10 commits into
SeldonIO:v2
from
agrski:update-pipeline-status-to-report-lack-of-dataflow-engines
Aug 14, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jesse-c
approved these changes
Aug 11, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
We were able to reproduce the issue yesterday, apply the fix, and confirm it!
ukclivecox
approved these changes
Aug 14, 2023
agrski
deleted the
update-pipeline-status-to-report-lack-of-dataflow-engines
branch
August 14, 2023 11:31
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
Issues
N/A
Motivation
Currently, the pipeline status returned from the scheduler to the operator does not report if there are no dataflow engines available on which to schedule that pipeline. The pipeline is left in state
PipelineCreate
with no further details; users must check the scheduler's logs in order to determine that this is the cause.This PR ameliorates this situation by propagating this information back to the pipeline status in the scheduler-internal data store, which in turn is used to inform subscribers such as the Core v2 operator.
This PR may, at first glance, look like it changes more than required; there is good reason for this. The chainer server (dataflow engine server) is both a consumer of pipeline events on the internal event bus and also a publisher to this particular stream of events. The simple solution of just updating the pipeline state when no dataflow engines are registered causes a potentially infinite loop in which the server component receives an event, sees there are no engines, publishes an event, then listens to this same event it has just published. This loop can run very quickly, constantly spawning new coroutines, in fact to the point that with a single pipeline it can OOM the scheduler (running with the default 1GB memory) in ~40 seconds.
To break this cycle, we need a mechanism for de-duplicating or otherwise ignoring events. The solution provided here is to add an event source, such that the producer of a message can ignore anything produced by itself. This is relatively simple and also quite generic in its approach--there is no need to cache particular event IDs or anything like that, or to split things up into many separate topics.
What
Summary of changes
Testing
Prior to my changes, the pipeline status is:
By building a local scheduler image and pushing this into a
kind
cluster:then deleting and re-creating a dummy pipeline, the status now looks like: