-
Notifications
You must be signed in to change notification settings - Fork 14
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
provider/resources.go
Outdated
Description: "The builder based on moby/buildkit project", | ||
}, | ||
}, | ||
}, | ||
}, | ||
ExtraResources: map[string]schema.ResourceSpec{ | ||
dockerResource("buildx", "Image").String(): { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is very cool!
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
provider/resources.go
Outdated
Description: "The builder based on moby/buildkit project", | ||
}, | ||
}, | ||
}, | ||
}, | ||
ExtraResources: map[string]schema.ResourceSpec{ | ||
dockerResource("buildx", "Image").String(): { |
There was a problem hiding this comment.
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?
d3f1104
to
85d05da
Compare
85d05da
to
cc147c0
Compare
Does the PR have any schema changes?Does the PR have any schema changes?Looking good! No breaking changes found. New resources:
Maintainer note: consult the runbook for dealing with any breaking changes. |
7965d25
to
34a13a0
Compare
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
76ad325
to
9fb4662
Compare
9fb4662
to
64676b2
Compare
64676b2
to
ee294d5
Compare
ee294d5
to
d3a3b24
Compare
d3a3b24
to
c124573
Compare
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.