-
Notifications
You must be signed in to change notification settings - Fork 107
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
P4Runtime API versioning #294
Comments
I researched into how protobuf/gRPC based services are versioned. This uses a
Also, the major version number must be encoded as the last component of the proto package name. This would be With a major version, the API must be evolved in a proto backwards-compatible manner described at https://cloud.google.com/apis/design/versioning#backwards_compatibility. See design compatibility for more details. I expect MAJOR version bump to be a rare event. I propose that we adopt semantic versioning and the above guidelines for versioning P4Runtime. I believe we are currently in initial development, but getting very close to 1.0.0 public API:
Some services (e.g. gNMI) have chosen to use a custom proto option to represent a version of the service:
This is mostly for documentation/visibility. I would advise against this due to concerns noted in custom_options. Also, this has caused compatibility issues on targets that need to use custom non-x86 proto_lib. The next step is to review this in a P4-API WG meeting. |
Thanks for all the background information @wmohsin
should probably be
P4Runtime is the name of the service. |
I like this proposal. To determine the supported major versions, the controller can attempt a request using each major (semantic) version. Assuming we add a capability query request someday (https://github.com/p4lang/PI/issues/323) the controller can use this request to determine all the fine-grained capabilities, which could include major.minor.patch API version. |
Decision at the 05/16/2018 P4 API WG meeting was to move forward with this proposal. |
We follow best practices for protobuf cloud services and add the major version number to the package path. This change affects many C++ source files in this project and I didn't find a good way to make the diff smaller by using namespace "tricks". I did introduce namespace aliases (p4rt = ::p4::v1 and p4config = ::p4::config::v1) to make future potential changes easier. Fixes #294 This commit also split p4/p4types.proto into p4/v1/p4data.proto and p4/config/v1/p4types.proto, thus breaking the circular import in golang between the p4 and p4.config packages. Fixes #350
We follow best practices for protobuf cloud services and add the major version number to the package path. This change affects many C++ source files in this project and I didn't find a good way to make the diff smaller by using namespace "tricks". I did introduce namespace aliases (p4rt = ::p4::v1 and p4config = ::p4::config::v1) to make future potential changes easier. Fixes #294 This commit also split p4/p4types.proto into p4/v1/p4data.proto and p4/config/v1/p4types.proto, thus breaking the circular import in golang between the p4 and p4.config packages. Fixes #350
* Add major version number to P4Runtime protobuf packages We follow best practices for protobuf cloud services and add the major version number to the package path. This change affects many C++ source files in this project and I didn't find a good way to make the diff smaller by using namespace "tricks". I did introduce namespace aliases (p4rt = ::p4::v1 and p4config = ::p4::config::v1) to make future potential changes easier. Fixes #294 This commit also split p4/p4types.proto into p4/v1/p4data.proto and p4/config/v1/p4types.proto, thus breaking the circular import in golang between the p4 and p4.config packages. Fixes #350 * Use p4v1 and p4configv1 namespace aliases Instead of p4rt and p4config. This is based on a discussion with reviewer @wmohsin about future-proofness, best practices and name collisions. Even though the fact that we were only using namespace aliases in implementation files mean that there should be no name conflicts at link time (namespace aliases are only visible in their translation unit and do not affect the full-qualified name of linker symbols), we decided that in the end it probably was simpler to just include the major version number in the namespace alias. A change in major version number should be a rare and disruptive event, and keeping the diff small when updating the implementation may not be a valid concern. There will be many things to figure out when & if we introduce P4Runtime v2 and it is tough to predict how it will happen and which steps we will follow to roll out the new version.
@aghaffarkhah @wmohsin this is something we discussed offline but I cannot find any webpage describing this. Could you give an example of a protobuf file with version info?
The text was updated successfully, but these errors were encountered: