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

Update README with draft of spec #1

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Update README with draft of spec #1

wants to merge 8 commits into from

Conversation

marcushines
Copy link
Collaborator

No description provided.

proto/gndp.proto Show resolved Hide resolved
proto/gndp.proto Outdated
}

message TLV {
string oui = 1;
Copy link

Choose a reason for hiding this comment

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

Regarding the construction of the TLV itself, can you elaborate w/ what you have here vs. what may be needed?

The TLV breakdown here I think would be:

  • Determine which unused "type" to encode within the 7-bits we have to work with (could vary per platform if custom types are already used) so id imagine we at least need to have our smallest proto3 type uint32 here w/ comment to fall within the reserved range at a minimum
  • Length can be calculated by the system - doesn't necessarily need to be included in the API
  • Subtype and the Value: If we want to be opaque here, maybe we say the subtype is 8-bits (uint32), maybe defined out-of-band? - value can stay as is as string

Thoughts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

changed this values to be uint32

type is assumed to be 127 for all custom tlv's (i don't expect to set any reserved tlv's as part of this spec

proto/gndp.proto Outdated Show resolved Hide resolved
proto/gndp.proto Outdated Show resolved Hide resolved
proto/gndp.proto Show resolved Hide resolved
proto/gndp.proto Show resolved Hide resolved
repeated TLV tlvs = 1;
}

message SetResponse{
Copy link

Choose a reason for hiding this comment

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

Any operation that does not succeed we probably want to figure out proper error code mapping along w/ messaging

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

what does that have to do with an empty reply message
any errors are returned as a grpc error from the rpc itself

Copy link

Choose a reason for hiding this comment

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

Just the best spot to tag a comment is all...

If empty then it implies gRPC errors and will probably need to add a mini-specification or within the IDL comments a table much like what we have in the gNMI spec

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

that isn't how errors should be handled in grpc

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link

Choose a reason for hiding this comment

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

I'm referring to tightening a mapping of behaviors -> gRPC error codes like

https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-specification.md#334-getresponse-behavior-table
https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-specification.md#3524-subscriberesponse-behavior-table

At the end of the day, this is an API specification so if not defined will be left up to interpretation which may or may not be obvious and likely divergence in implementation behavior

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

grpc codes are standard on uses.

https://grpc.github.io/grpc/core/md_doc_statuscodes.html

gndp itself is not using those codes in any way that would be different from those values

i.e.
the server should return unimplemented if it isn't implemented
Internal if the server's implementation has an internal error and so on?
i am not sure what needs to be elaborated here?

srcs = ["gndp.proto"],
)

go_proto_library(
Copy link

Choose a reason for hiding this comment

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

Need to add compilers = ["@rules_go//proto:go_grpc"],. gndp.pb.go is missing GRPC services. AFAICT you only need to use the GRPC compiler (using go_proto and go_grpc generates an error).

@@ -0,0 +1,15 @@
# Copyright 2024 Google LLC
Copy link

Choose a reason for hiding this comment

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

Do we want to add a .bazelversion file to pin 7.2.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants