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

Initial go-provider integration #890

Closed
wants to merge 10 commits into from

Conversation

blampe
Copy link
Contributor

@blampe blampe commented Dec 12, 2023

NB: This the first PR on top of the buildkit feature branch, which I've just cut from master.

This extends the hybrid provider to also include a native buildx provider implemented with pulumi-go-provider.

The image resource doesn't do anything yet, but tests are included for 100% coverage. I'd like to keep that number as high as possible.

Fixes #884.

Copy link
Member

@iwahbe iwahbe left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@guineveresaenger guineveresaenger left a comment

Choose a reason for hiding this comment

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

My main concerns are around the practicality of handling Yet Another Provider here. Is there a plan for reconciliation once we deem this resource production ready?

of course it is unlikely that users will use all three providers simultaneously, except perhaps as apart of an migration/upgrade.

@@ -27,19 +27,31 @@ type dockerHybridProvider struct {
version string
bridgedProvider rpc.ResourceProviderServer
nativeProvider rpc.ResourceProviderServer
buildxProvider rpc.ResourceProviderServer
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious why we need a whole new provider here - is this specifically so we can run a client config in the provider?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's strictly for dogfooding go-pulumi-provider, which I'm using to help speed up development. Working at a higher level than resource.PropertyMap is a huge time saver, and the integration test helpers are also great.

Description: "The builder based on moby/buildkit project",
},
},
},
},
ExtraResources: map[string]schema.ResourceSpec{
dockerResource("buildx", "Image").String(): {
Copy link
Contributor

Choose a reason for hiding this comment

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

I like this name spacing but am a little concerned that putting this into a new module may make it more difficult to reconcile once the resource is no longer experimental.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we have the ability to alias things if this needs to move around? Is there an alternative name you'd suggest?

Copy link
Contributor

Choose a reason for hiding this comment

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

We do have the ability to alias via the bridge; it's what we did for Imagev3 => v4 and I do believe it supports moving resources between modules as well. I was talking more from a rollout strategy point.


func newServer() integration.Server {
provider := NewBuildxProvider()
return integration.NewServer("docker", semver.Version{Major: 4}, provider)
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 very cool!

This was referenced Dec 15, 2023
Copy link
Contributor Author

@blampe blampe left a comment

Choose a reason for hiding this comment

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

My main concerns are around the practicality of handling Yet Another Provider here. Is there a plan for reconciliation once we deem this resource production ready?

I think "provider" is a bit overloaded here. From the user's perspective, a provider is just a gRPC server.

From our perspective as maintainers, the "providers" here are effectively just gRPC handlers, and we happen to have 3 ways of handling requests. There's nothing wrong with that, and I'd want to understand the value we'd get from reconciling before considering it.

of course it is unlikely that users will use all three providers simultaneously, except perhaps as apart of an migration/upgrade.

There shouldn't be any issue mixing/matching the provider implementation, and we should expect users to at least have Image resources coexisting with buildx.Image. I'll add a test around this as part of the auth work.

@@ -27,19 +27,31 @@ type dockerHybridProvider struct {
version string
bridgedProvider rpc.ResourceProviderServer
nativeProvider rpc.ResourceProviderServer
buildxProvider rpc.ResourceProviderServer
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's strictly for dogfooding go-pulumi-provider, which I'm using to help speed up development. Working at a higher level than resource.PropertyMap is a huge time saver, and the integration test helpers are also great.

Description: "The builder based on moby/buildkit project",
},
},
},
},
ExtraResources: map[string]schema.ResourceSpec{
dockerResource("buildx", "Image").String(): {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we have the ability to alias things if this needs to move around? Is there an alternative name you'd suggest?

@blampe blampe force-pushed the 884-pulumi-go-provider branch from d3f1104 to 85d05da Compare December 21, 2023 21:54
@blampe blampe mentioned this pull request Jan 18, 2024
@blampe blampe force-pushed the 884-pulumi-go-provider branch from 85d05da to cc147c0 Compare January 18, 2024 17:25
Copy link

github-actions bot commented Jan 18, 2024

Does the PR have any schema changes?

Does the PR have any schema changes?

Looking good! No breaking changes found.

New resources:

  • buildx/image.Image

Maintainer note: consult the runbook for dealing with any breaking changes.

@blampe blampe force-pushed the 884-pulumi-go-provider branch from 7965d25 to 34a13a0 Compare January 18, 2024 20:01
blampe added a commit to pulumi/pulumi-go-provider that referenced this pull request Jan 29, 2024
This essentially exposes `newProvider` so we can attach an existing
`HostClient` to it. I only see this used in one test, so I opted for a
breaking change instead of adding another function.

Refs pulumi/pulumi-docker#890
@blampe blampe force-pushed the 884-pulumi-go-provider branch 2 times, most recently from 76ad325 to 9fb4662 Compare February 9, 2024 22:22
@blampe blampe force-pushed the 884-pulumi-go-provider branch from 9fb4662 to 64676b2 Compare February 15, 2024 19:13
@blampe blampe mentioned this pull request Feb 15, 2024
@blampe blampe force-pushed the 884-pulumi-go-provider branch from 64676b2 to ee294d5 Compare February 15, 2024 20:24
@blampe blampe force-pushed the 884-pulumi-go-provider branch from ee294d5 to d3a3b24 Compare February 27, 2024 19:14
@blampe blampe force-pushed the 884-pulumi-go-provider branch from d3a3b24 to c124573 Compare March 5, 2024 19:17
@blampe blampe closed this Apr 19, 2024
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