Skip to content

Downgrade otelgrpc lib to resolve dependency conflict when k8s.io/component-base is imported. #148

Closed
MartinForReal wants to merge 1 commit intokubernetes-csi:masterfrom
MartinForReal:master
Closed

Downgrade otelgrpc lib to resolve dependency conflict when k8s.io/component-base is imported. #148
MartinForReal wants to merge 1 commit intokubernetes-csi:masterfrom
MartinForReal:master

Conversation

@MartinForReal
Copy link
Contributor

@MartinForReal MartinForReal commented Sep 11, 2023

What type of PR is this?

/kind cleanup

What this PR does / why we need it:
Downgrade otelgrpc lib to resolve dependency conflict when k8s.io/component-base is imported.

go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.41.0 requires following libs

	go.opentelemetry.io/otel v1.16.0
	go.opentelemetry.io/otel/metric v1.16.0
	go.opentelemetry.io/otel/trace v1.16.0

where k8s.io/component-base requires a different version

https://github.com/kubernetes/component-base/blob/44f31b29cc46816113a74802aade8f3256483bee/go.mod#L20-L24

The developer needs to resolve dependency conflict(go.opentelemetry.io/otel,go.opentelemetry.io/otel/metric and etc) when k8s/component-base and github.com/kubernetes-csi/csi-lib-utils are imported(e.g. in csi plugin implementation).

I think it is a good idea to keep go.mod aligned with k8s.io/component-base because k8s.io/component-base is widely used.
If we import go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.36.2.
go.opentelemetry.io/otel will not be upgraded to 1.16. And dependency issue can be resolved.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc is downgrade to v0.36.2

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 11, 2023
@k8s-ci-robot
Copy link
Contributor

Welcome @MartinForReal!

It looks like this is your first PR to kubernetes-csi/csi-lib-utils 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-csi/csi-lib-utils has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 11, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @MartinForReal. Thanks for your PR.

I'm waiting for a kubernetes-csi member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Sep 11, 2023
@cvvz
Copy link
Member

cvvz commented Sep 11, 2023

/ok-to-test

@k8s-ci-robot
Copy link
Contributor

@cvvz: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/ok-to-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@MartinForReal
Copy link
Contributor Author

/assign @jsafrane

@MartinForReal
Copy link
Contributor Author

/assign @jsafrane

@MartinForReal MartinForReal reopened this Sep 11, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: MartinForReal
Once this PR has been reviewed and has the lgtm label, please ask for approval from jsafrane. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@andyzhangx
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 11, 2023
@MartinForReal
Copy link
Contributor Author

/assign @pohly

@pohly
Copy link
Contributor

pohly commented Sep 15, 2023

go.opentelemetry.io/otel v1.16.0
go.opentelemetry.io/otel/metric v1.16.0
go.opentelemetry.io/otel/trace v1.16.0

where k8s.io/component-base requires a different version

Why is that a conflict? These are v1 packages. Their API should not break between minor or patch releases. If csi-lib-utils pulls in more recent releases of these, then component-base should still work.

It feels like I am missing some piece of explanation.

@MartinForReal
Copy link
Contributor Author

I agree if these dependencies work well when it is invoked in this project( e.g. in ut/e2e)
But when csi driver imports csi-lib-utils, otel and k8s.io/component-base, the developer should choose the correct version of otel which is compatible with csi-lib-utils and k8s.io/component-base. And sometimes it is not possible if otel introduces a break change in new release. So, it is a good idea to keep aligned with config in latest component-base release. Because there will be less dependency issue in csi driver.

@pohly
Copy link
Contributor

pohly commented Sep 15, 2023

Keeping otelgrpc the same as in component-base makes sense because it it is a v0 package and thus may have breaking changes. But that's not what your PR description says - it just talks about packages that it pulls in.

@MartinForReal
Copy link
Contributor Author

What I actually mean is Keeping otelgrpc the same as in component-base.

github.com/stretchr/testify v1.8.2
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.41.0
go.opentelemetry.io/otel/trace v1.15.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.36.2
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not quite what current Kubernetes master is using:

go.mod: go.opentelemetry.io/contrib/instrumentation/github.com/emicklei/go-restful/otelrestful v0.35.0
go.mod: go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.35.0
....
go.mod: go.opentelemetry.io/otel/metric v0.31.0 // indirect

If the goal is to be aligned, why not use exactly the same versions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this library is not imported in k8s.io/component-base. but glad to know it is imported in k/k. updated the pr

@msau42
Copy link
Collaborator

msau42 commented Sep 16, 2023

/hold

We were able to find a compatible version in kubernetes-csi/external-provisioner#1025

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 16, 2023
@MartinForReal
Copy link
Contributor Author

@msau42 yes. We can find one by chance. But It is easier for all of the dependents because there is no need to resolve dependency conflict.

@jsafrane
Copy link
Contributor

jsafrane commented Oct 2, 2023

We use dependabot to update dependencies in most of kubernetes-csi repos. So otel / k8s.io/* are updated mostly randomly. Do we really lock them to their version from kubernetes/kubernetes? That would mean changing dependabot configs there + manually update our kubernetes-csi repos when Kubernetes bumps a dependency.

I am not against, but I kind of like dependabot + the latest releases (if new deps are not failing too much, which we saw with otel).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants