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

Untangle genproto / cloud.google.com/go dependencies #113366

Open
14 of 44 tasks
liggitt opened this issue Oct 26, 2022 · 10 comments
Open
14 of 44 tasks

Untangle genproto / cloud.google.com/go dependencies #113366

liggitt opened this issue Oct 26, 2022 · 10 comments
Assignees
Labels
area/code-organization Issues or PRs related to kubernetes code organization lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture.

Comments

@liggitt
Copy link
Member

liggitt commented Oct 26, 2022

#113225 uncovered a coming snarl of dependencies between cloud.google.com/go and google.golang.org/genproto

Because several generic libraries use the cloud.google.com/go/compute/metadata package, the following chain makes it almost impossible to avoid adding all cloud.google.com/go submodules into the dependency graph for all downstream consumers:

  • {golang.org/x/oauth2, google.golang.org/api, google.golang.org/grpc} --> cloud.google.com/go/compute --> cloud.google.com/go --> google.golang.org/genproto --> cloud.google.com/go/*

It's possible we can avoid the updates that expanded these cross-references in the short-term with judicious upstream changes back to older genproto versions, but we should get ahead of this if we want to avoid being forced to pull in these dependency graph increases in the future for a critical bugfix.

Recommendations

1. Isolate cloud.google.com/go/compute/metadata

The cloud.google.com/go/compute/metadata package (https://github.com/googleapis/google-cloud-go/tree/main/compute/metadata) only uses stdlib dependencies, but lives inside cloud.google.com/go/compute, which has many other references (https://github.com/googleapis/google-cloud-go/blob/main/compute/go.mod)

  1. Isolate cloud.google.com/go/compute/metadata to its own zero-dependency module

  2. Sweep dependencies using cloud.google.com/go/compute/metadata and update them to use the zero-dependency alternative

    • golang.org/x/oauth2
      • committed
      • tagged
    • google.golang.org/api
      • committed
      • tagged
    • google.golang.org/grpc
      • committed
      • tagged
    • github.com/google/cadvisor (transitive via golang.org/x/oauth2, google.golang.org/api, google.golang.org/grpc)
      • committed
      • tagged
    • go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc (transitive via golang.org/x/oauth2, google.golang.org/grpc)
      • committed
      • tagged

2. Prune use of cloud genproto packages in non-cloud.google.com modules

  1. Update github.com/googleapis/gax-go/v2 test to not require the google.golang.org/genproto/googleapis/cloud/location package

3. Drop use of google.golang.org/genproto/protobuf/field_mask

Update to use canonical google.golang.org/protobuf/types/known/fieldmaskpb package instead

4. Isolate generic genproto packages

/priority important-longterm
/area code-organization
/sig architecture
/cc @dims
fyi @codyoss @bertinatto

@k8s-ci-robot k8s-ci-robot added priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. area/code-organization Issues or PRs related to kubernetes code organization sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 26, 2022
@liggitt liggitt self-assigned this Oct 26, 2022
@liggitt liggitt added the lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. label Oct 26, 2022
@codyoss
Copy link

codyoss commented Oct 26, 2022

I am in the process of doing item one rn: googleapis/google-cloud-go#6311

@codyoss
Copy link

codyoss commented Oct 26, 2022

For item three I might say this can be simplified to the following:

  • google.golang.org/genproto/googleapis/api/*
  • google.golang.org/genproto/googleapis/rpc/*
  • google.golang.org/genproto/googleapis/type/* (new entry)
  • google.golang.org/genproto/googleapis/bytestream

google.golang.org/genproto/protobuf/field_mask is already an alias to another project that should be used directly.
It may be easiest to create a new module somewhere to house all of these super general stubs. Then genproto just alias to that repo.

@codyoss
Copy link

codyoss commented Oct 26, 2022

cc @noahdietz @quartzmo

@liggitt liggitt added the triage/accepted Indicates an issue or PR is ready to be actively worked on. label Oct 26, 2022
@k8s-ci-robot k8s-ci-robot removed the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Oct 26, 2022
@liggitt
Copy link
Member Author

liggitt commented Oct 26, 2022

opened googleapis/gax-go#237 for item 2

@aramase
Copy link
Member

aramase commented Nov 4, 2022

opened google/cadvisor#3194 for github.com/google/cadvisor . I've marked it as WIP so we can update the transitive deps in 1 PR.

@liggitt liggitt added this to Dependencies in code-organization subproject Nov 10, 2022
skitt added a commit to skitt/go-oidc that referenced this issue Jan 3, 2023
The latest versions simplify the transitive dependency tree (see
kubernetes/kubernetes#113366 for details).

Signed-off-by: Stephen Kitt <skitt@redhat.com>
ericchiang pushed a commit to coreos/go-oidc that referenced this issue Jan 3, 2023
The latest versions simplify the transitive dependency tree (see
kubernetes/kubernetes#113366 for details).

Signed-off-by: Stephen Kitt <skitt@redhat.com>
skitt added a commit to skitt/opentelemetry-go-contrib that referenced this issue Jan 4, 2023
This drops the indirect dependency on cloud.google.com/go, which helps
reduce the dependency tree (see
kubernetes/kubernetes#113366 and
kubernetes/kubernetes#114772 for the wider
context).

Signed-off-by: Stephen Kitt <skitt@redhat.com>
@liggitt liggitt added priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. and removed priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. labels May 26, 2023
quartzmo added a commit to quartzmo/google-cloud-go that referenced this issue Jun 1, 2023
quartzmo added a commit to quartzmo/google-cloud-go that referenced this issue Jun 1, 2023
quartzmo added a commit to quartzmo/google-cloud-go that referenced this issue Jun 1, 2023
quartzmo added a commit to quartzmo/google-cloud-go that referenced this issue Jun 1, 2023
quartzmo added a commit to googleapis/google-cloud-go that referenced this issue Jun 6, 2023
gcf-merge-on-green bot pushed a commit to googleapis/google-cloud-go that referenced this issue Jun 6, 2023
quartzmo added a commit to googleapis/google-cloud-go that referenced this issue Jun 6, 2023
gcf-merge-on-green bot pushed a commit to googleapis/google-cloud-go that referenced this issue Jun 6, 2023
lukaszraczylo pushed a commit to lukaszraczylo/go-oidc that referenced this issue Apr 13, 2024
The latest versions simplify the transitive dependency tree (see
kubernetes/kubernetes#113366 for details).

Signed-off-by: Stephen Kitt <skitt@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/code-organization Issues or PRs related to kubernetes code organization lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture.
Projects
Status: Dependencies to improve
Development

No branches or pull requests

8 participants