Skip to content
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

chore: UDS based multiproc #128

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/info/doc.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Package info is used for the gRPC server to provide the information such as protocol, sdk version, language, etc, to the client.
//
// The server information can be used by the client to determine:
// - what is the right protocol to use (UDS or TCP)
// - what is the server type to use (SingleProcServer or MultiProcServer)
// - what is the numaflow sdk version used by the server
// - what is language used by the server
//
Expand Down
2 changes: 1 addition & 1 deletion pkg/info/server_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func Test_Read_Write(t *testing.T) {
filepath := os.TempDir() + "/server-info"
defer os.Remove(filepath)
info := &ServerInfo{
Protocol: TCP,
MultiProcServer: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of updating the struct, can we keep the protocol, and use the metadata to populate the info? For example, in the metadata, multiProc: 4 means multProcServer with 4.

Copy link
Contributor Author

@kohlisid kohlisid Apr 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! I have updated the PRs to use the metadata to check for multiproc.
We will not need this PR change now

Language: Java,
MinimumNumaflowVersion: MinimumNumaflowVersion,
Version: "11",
Expand Down
9 changes: 1 addition & 8 deletions pkg/info/types.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
package info

type Protocol string

const (
UDS Protocol = "uds"
TCP Protocol = "tcp"
)

type Language string

const (
Expand All @@ -20,7 +13,7 @@ const MinimumNumaflowVersion = "1.2.0-rc4"

// ServerInfo is the information about the server
type ServerInfo struct {
Protocol Protocol `json:"protocol"`
MultiProcServer bool `json:"multiproc_server"`
Language Language `json:"language"`
MinimumNumaflowVersion string `json:"minimum_numaflow_version"`
Version string `json:"version"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/shared/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const (
func PrepareServer(sockAddr string, infoFilePath string) (net.Listener, error) {
// If infoFilePath is not empty, write the server info to the file.
if infoFilePath != "" {
serverInfo := &info.ServerInfo{Protocol: info.UDS, Language: info.Go, MinimumNumaflowVersion: info.MinimumNumaflowVersion, Version: info.GetSDKVersion()}
serverInfo := &info.ServerInfo{MultiProcServer: false, Language: info.Go, MinimumNumaflowVersion: info.MinimumNumaflowVersion, Version: info.GetSDKVersion()}
if err := info.Write(serverInfo, info.WithServerInfoFilePath(infoFilePath)); err != nil {
return nil, err
}
Expand Down
Loading