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

Support transition from a hand-written native provider to a framework based provider #216

Closed
iwahbe opened this issue Apr 8, 2024 · 0 comments · Fixed by #220
Closed
Assignees
Labels
kind/enhancement Improvements or new features resolution/fixed This issue was fixed

Comments

@iwahbe
Copy link
Member

iwahbe commented Apr 8, 2024

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

Existing providers should be able to migrate (totally or in part) to a pulumi-go-provider backed provider. Existing "github.com/pulumi/pulumi-go-provider".Providers are designed to compose well, but only with other "github.com/pulumi/pulumi-go-provider".Providers.

We should support a side-by-side (not wrapping) function that combines a provider at the "github.com/pulumi/pulumi-go-provider".Provider level and the "github.com/pulumi/pulumi/sdk/v3/proto/go".ResourceProviderServer level:

func MuxWith(
    name, version string,
    p1 "github.com/pulumi/pulumi-go-provider".Provider,
    p2 "github.com/pulumi/pulumi/sdk/v3/proto/go".ResourceProviderServer,
) ("github.com/pulumi/pulumi/sdk/v3/proto/go".ResourceProviderServer, error)

Provider authors who want to bring an existing native provider to pulumi-go-provider should use MuxWith to get started without a stop-the-world rewrite. New providers should prefer to use "github.com/pulumi/pulumi-go-provider".RunProvider

Affected area/feature

This would be a good opportunity to move the muxer code from the bridge to pulumi-go-provider.

@iwahbe iwahbe added the kind/enhancement Improvements or new features label Apr 8, 2024
@iwahbe iwahbe self-assigned this Apr 13, 2024
iwahbe added a commit that referenced this issue Apr 13, 2024
`raw.Provider` provides a thunking layer to allow a pulumi-go-provider based provider to
wrap a `rpc.ResourceProviderServer`. This will allow piece-wise transfer of native
providers to the pulumi-go-provider framework.

Fixes #216
iwahbe added a commit that referenced this issue Apr 14, 2024
`raw.Provider` provides a thunking layer to allow a pulumi-go-provider based provider to
wrap a `rpc.ResourceProviderServer`. This will allow piece-wise transfer of native
providers to the pulumi-go-provider framework.

Fixes #216
iwahbe added a commit that referenced this issue Apr 14, 2024
`raw.Provider` provides a thunking layer to allow a pulumi-go-provider based provider to
wrap a `rpc.ResourceProviderServer`. This will allow piece-wise transfer of native
providers to the pulumi-go-provider framework.

Fixes #216
iwahbe added a commit that referenced this issue Apr 15, 2024
`raw.Provider` provides a thunking layer to allow a pulumi-go-provider based provider to
wrap a `rpc.ResourceProviderServer`. This will allow piece-wise transfer of native
providers to the pulumi-go-provider framework.

Fixes #216
iwahbe added a commit that referenced this issue Apr 15, 2024
`raw.Provider` provides a thunking layer to allow a pulumi-go-provider based provider to
wrap a `rpc.ResourceProviderServer`. This will allow piece-wise transfer of native
providers to the pulumi-go-provider framework.

Fixes #216
iwahbe added a commit that referenced this issue Apr 16, 2024
`rpc.Provider` provides a thunking layer to allow a pulumi-go-provider based provider to
wrap a `rpc.ResourceProviderServer`. This will allow piece-wise transfer of native
providers to the pulumi-go-provider framework.

Unlike the pulumi-terraform-bridge's
[muxer](https://github.com/pulumi/pulumi-terraform-bridge/tree/master/x/muxer),
`rpc.Provider` does not split at the RPC level directly. Instead it converts the shim
layer provided by https://github.com/pulumi/pulumi-go-provider back into
"github.com/pulumi/pulumi/sdk/v3/proto/go". This makes wrapped rpc providers able to
interact with `integration` based tests and to benefit from intercepting middleware (like
`cancel` and `schema`).

Fixes #216
iwahbe added a commit that referenced this issue Apr 16, 2024
`rpc.Provider` provides a thunking layer to allow a pulumi-go-provider based provider to
wrap a `rpc.ResourceProviderServer`. This will allow piece-wise transfer of native
providers to the pulumi-go-provider framework.

Unlike the pulumi-terraform-bridge's
[muxer](https://github.com/pulumi/pulumi-terraform-bridge/tree/master/x/muxer),
`rpc.Provider` does not split at the RPC level directly. Instead it converts the shim
layer provided by https://github.com/pulumi/pulumi-go-provider back into
"github.com/pulumi/pulumi/sdk/v3/proto/go". This makes wrapped rpc providers able to
interact with `integration` based tests and to benefit from intercepting middleware (like
`cancel` and `schema`).

Fixes #216
iwahbe added a commit that referenced this issue Apr 17, 2024
…220)

`rpc.Provider` provides a thunking layer to allow a pulumi-go-provider
based provider to wrap a `pulumirpc.ResourceProviderServer`. This will
allow piece-wise transfer of native providers to the pulumi-go-provider
framework.

Unlike the pulumi-terraform-bridge's

[muxer](https://github.com/pulumi/pulumi-terraform-bridge/tree/master/x/muxer),
`rpc.Provider` does not split at the RPC level directly. Instead it
converts the shim layer provided by
https://github.com/pulumi/pulumi-go-provider back into
"github.com/pulumi/pulumi/sdk/v3/proto/go". This makes wrapped rpc
providers able to interact with `integration` based tests and to benefit
from intercepting middleware (like `cancel` and `schema`).

Fixes #216
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements or new features resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants