-
Notifications
You must be signed in to change notification settings - Fork 631
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
Add support for Protobuf 5 #3958
Comments
The simplest solution is to only support a single protobuf major version. Once the ecosystem has majority moved over to Protobuf 5, we can switch over to just supporting it. I don't have a good signal on when that is. It would helpful if people can share what version of Protobuf you are using and if this is a critical blocker for other version upgrades. |
The new version of the authzed library already uses protobuf 5. And we are planning an update, but a dependency conflict is preventing us. Hope for a speedy resolution |
This may be interesting: |
Right, but can't the runtime be updated even if the generated files are old? e.g. the google cloud tools like pubsub allow anything from https://github.com/googleapis/python-pubsub/blob/main/setup.py#L45 Upon investigation, it turns out that they are using |
My understanding is that, until Q1 2025 when they launch rolling compatibility, it is not guaranteed to work:
It is only guaranteed to work across the same minor version:
|
We are using protobuf 5, and just started using OpenTelemetry. Our current workaround is to have our own version of opentelemetry-python that contains protobuf 5 generated files. Not ideal, but without that OpenTelemetry would be a non-starter for us for the time being. Yesterday though I encountered an interesting approach to this problem that might be a good solution for OpenTelemetry too. wandb generates pb2 files for all protobuf versions, then dynamically imports the appropriate one based on the protobuf runtime version, as shown in the link below: |
Thanks for the data point. It's been a few months now, I think we should just upgrade to protobuf 5. Let's try to get it in for the next release.
We have considered that as well, but since protobuf says they'll have rolling support in the next 6 months, I think we could just wait. Hopefully the next major version will be covered. |
Does this mean that otel would only upgrade when the next major version of the protobuf runtime is released? Wouldn't this mean anyone using opentelemetry would not be able to upgrade their appilcations who are using protobuf for other purposes until that time? Seems not great to limit application upgrades because of telemetry. I dug more into how GCP client libraries work and they use proto-plus to generate the protobuf. BUT they recently added opentelemetry as an optional dependency so now googles' own client libraries would now depend on opentelemetry's reliance on an old version of protobuf. 😵 If wandb is not an option, maybe proto-plus would be useful to side step the versioning issue. |
We had been sitting on this for quite a while hoping it would resolve itself, but we have some partners that have to move forward. 6 months out, is a very long time to wait, we will for sure be forced to drop our telemetry. |
Apologies, I was off a bit my re-collection was off a version and it was the 4.x issue...so indeed its just a yearly issue I guess we will have here until protobuf supports. We just may lose this round and have to back out telemetry until it resolved. |
No, I'm trying to say let's fix this specific issue for the next release, by upgrading to protobuf 5 and dropping support for protobuf 4. This should be the last time that a new protobuf major version causes any compatibility issue. We don't need a bespoke fix as they are working on rolling support for generated code across major versions. Does that sound good to you? |
I was able to make the breakdown of PyPI downloads of protobuf per major version with the PyPI BigQuery dataset. It looks like protobuf v5 has just surpassed v4 in downloads in this past couple of weeks. SQL
#standardSQL
SELECT
COUNT(*) AS num_downloads,
REGEXP_EXTRACT(file.version, r'(\d+)\.\d+\.\d+') AS major_version,
DATE(timestamp) AS timestamp_day
FROM
`bigquery-public-data.pypi.file_downloads`
WHERE
file.project = 'protobuf'
-- Only query the last 60 days of history
AND DATE(timestamp) BETWEEN DATE_SUB(CURRENT_DATE(), INTERVAL 60 DAY)
AND CURRENT_DATE()
GROUP BY
major_version,
timestamp_day |
Closing as support for protobuf5 was merged 🚀 #4206 |
Thanks for merging support! Is there an issue I can follow to find out when this would be released? |
@hauntsaninja @mortenmj We don't have a fixed release date, but we do our best to have a monthly cadence. We discussed it's time to 1.28.0 at today's SIG, so the next version will probably be released soon |
protobuf 5 support is a critical blocker for us; hope the new release can come out soon. Thanks @emdneto! |
Same as our project |
Same for ours |
Are there any updates on a release date? |
Protobuf 5 was released but it currently conflicts with
opentelemetry-proto
packageopentelemetry-python/opentelemetry-proto/pyproject.toml
Lines 27 to 29 in 762bd8f
This is by design since protobuf generated code is supposed to match the runtime protobuf library version. When 4.x was released we had a lot of issues and I opened protocolbuffers/protobuf#11123 to get some clarification. We know have some docs https://protobuf.dev/support/cross-version-runtime-guarantee/ which make it clear New Gencode + Old Runtime = Never Allowed. I.e. regenerating code with grpcio-tools 5 will break compatibility with protobuf 4.
This puts us in a tricky spot of choosing which major version to support. The good news is
That doesn't help right now, but hopefully will for the next major version. Because they are planning to fix things, I'm hesitant on making our own solution like keeping two copies of generated code and dynamically choosing between them at import time.
Related
The text was updated successfully, but these errors were encountered: