-
Notifications
You must be signed in to change notification settings - Fork 12
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: introduce handshake to client and gRPC server #42
Conversation
Signed-off-by: Derek Wang <[email protected]>
do we have explicit ordering for udf and numa containers today? |
Go Language = "go" | ||
Python Language = "python" | ||
Java Language = "java" |
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.
why do we need to track each language on numaflow-go?
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.
Our sdk versions are not consistent. We should have a mapping in numaflow code to track all the versions for compatibility check.
The info-server is used only in the bootup; will it have any purpose after that? If this is only for a one-time information exchange, should we just pass it over a file or something as an initial handshake mechanism? |
There's no starting order for normal containers, so our numa container does a waituntilready during startup. |
It works with file. Thinking shall we get it integrated with the prometheus support together numaproj/numaflow#324. |
I do not think it is wise to integrate numaproj/numaflow#324 since it is very opinionated. Let's keep this as lightweight as possible so that the resource usage will be minimal and only on the bootup. |
Signed-off-by: Derek Wang <[email protected]>
Signed-off-by: Derek Wang <[email protected]>
pkg/info/server_info.go
Outdated
) | ||
|
||
func GetSDKVersion() string { | ||
version := "unknown" |
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 an empty string a better value than "unknown"?
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.
updated.
pkg/info/server_info.go
Outdated
// Also check if the file is ready to read | ||
// It takes some time for the server to write the server info file | ||
// TODO: use a better way to wait for the file to be ready | ||
b, err := os.ReadFile(options.svrInfoFilePath) |
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.
will a file.stat > 0 length be a good check?
pkg/info/server_info.go
Outdated
return ctx.Err() | ||
default: | ||
time.Sleep(100 * time.Millisecond) | ||
b, err = os.ReadFile(options.svrInfoFilePath) |
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.
how do we handle partial/in-progress writes, eg. numaflow starting reading early before the entire file has been flushed?
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.
Changed to write an END mark.
pkg/info/server_info.go
Outdated
// TODO: use a better way to wait for the file to be ready | ||
retry := 0 | ||
b, err := os.ReadFile(options.svrInfoFilePath) | ||
for len(b) == 0 && err == nil && retry < 10 { |
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.
will we break the loop too early because we read partial data?
Signed-off-by: Derek Wang <[email protected]>
Java implementation of numaproj/numaflow-go#42 Signed-off-by: Keran Yang <[email protected]>
Java implementation of numaproj/numaflow-go#42 Signed-off-by: Keran Yang <[email protected]>
Description
This PR introduces a handshake to the client (numa container) and the gRPC server (UDF/UDSink), it is used to provide the server information such as
protocol (UDS, TCP)
,language
,version (SDK)
, etc. The client (Numaflow) is supposed toget the information before starting gRPC connections. These information can be used to:
File-based information exchange is done before starting the gRPC server.
Similarly in Python and Java SDKs, we need to implement same mechanism, and populate the right information.
In terms of checking lib version at runtime:
Python
Java
NodeJS is supposed to have a way to get the version info.
https://stackoverflow.com/questions/29741373/check-package-version-at-runtime-in-nodejs