-
Notifications
You must be signed in to change notification settings - Fork 124
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: Controller changes to support Serving as a builtin source #2357
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Sreekanth <[email protected]>
Signed-off-by: Sreekanth <[email protected]>
Add validation checks to not support reduce when serving source is configured? Also enable callback when serving source is configured so that the users can avoid setting the callback annotation? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2357 +/- ##
==========================================
- Coverage 69.70% 69.68% -0.02%
==========================================
Files 361 361
Lines 49934 49984 +50
==========================================
+ Hits 34805 34830 +25
- Misses 14053 14084 +31
+ Partials 1076 1070 -6 ☔ View full report in Codecov by Sentry. |
…ecified Signed-off-by: Sreekanth <[email protected]>
Signed-off-by: Sreekanth <[email protected]>
Signed-off-by: Sreekanth <[email protected]>
Signed-off-by: Sreekanth <[email protected]>
for _, vtx := range req.PipelineSpec.Vertices { | ||
if vtx.IsASource() && vtx.Source.Serving != nil { | ||
commonEnvVars = append(commonEnvVars, | ||
corev1.EnvVar{Name: EnvCallbackEnabled, Value: "true"}, |
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.
It seems like we changed the logic from getting the information from annotations.
Are we expecting it's always true
?
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.
This PR removes the need for having an annotation to enable callbacks. Instead, if a serving source is used, the environment variable to enable callbacks will be set automatically. The EnvCallbackEnabled
is checked to construct the callback http client, the callback only happens if the message contains the X-Numaflow-Callback-Url
header.
Signed-off-by: Sreekanth <[email protected]>
) | ||
|
||
// if auth is configured, set the auth token in the environment | ||
if servingSource.Auth != nil && servingSource.Auth.Token != nil { |
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.
This should have been mounted as a volume to the container, there's no need to add env vars to it.
@@ -343,13 +349,61 @@ func (v Vertex) GetPodSpec(req GetVertexPodSpecReq) (*corev1.PodSpec, error) { | |||
} | |||
|
|||
if v.IsASource() && v.Spec.Source.Serving != nil { | |||
servingContainer, err := v.getServingContainer(req) | |||
servingSource := v.Spec.Source.Serving | |||
servingSourceBytes, err := json.Marshal(servingSource) |
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.
There's already an env var EnvVertexObject
, no need to do this.
… source spec as env variable Signed-off-by: Sreekanth <[email protected]>
} | ||
if servingSource != nil { | ||
for _, v := range pl.Spec.Vertices { | ||
if v.UDF != nil && v.UDF.GroupBy != nil { |
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.
We have a utility function IsReduceUDF()
Signed-off-by: Sreekanth <[email protected]>
Signed-off-by: Sreekanth <[email protected]>
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.
@kohlisid - please review.
// set the serving source stream name in the environment because the numa container will be reading from it | ||
corev1.EnvVar{Name: EnvServingJetstreamStream, Value: req.ServingSourceStreamName}, |
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.
we don't need js stream anymore right?
rust/serving/src/config.rs
Outdated
#[derive(Deserialize)] | ||
struct Source { | ||
serving: Serving, | ||
} | ||
#[derive(Deserialize)] | ||
struct Spec { | ||
source: Source, | ||
} | ||
|
||
#[derive(Deserialize)] | ||
struct VertexObject { | ||
spec: Spec, | ||
} |
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.
Is it possible to use the generated models?
Signed-off-by: Sreekanth <[email protected]>
Signed-off-by: Sreekanth <[email protected]>
fixes #2319
Tested the validation with below pipeline: