2022-12-14 19:17:27 +00:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.20.1
// source: pulumi/resource.proto
package pulumirpc
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
2024-01-24 17:15:30 +00:00
emptypb "google.golang.org/protobuf/types/known/emptypb"
2022-12-14 19:17:27 +00:00
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc . SupportPackageIsVersion7
// ResourceMonitorClient is the client API for ResourceMonitor service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type ResourceMonitorClient interface {
SupportsFeature ( ctx context . Context , in * SupportsFeatureRequest , opts ... grpc . CallOption ) ( * SupportsFeatureResponse , error )
Invoke ( ctx context . Context , in * ResourceInvokeRequest , opts ... grpc . CallOption ) ( * InvokeResponse , error )
StreamInvoke ( ctx context . Context , in * ResourceInvokeRequest , opts ... grpc . CallOption ) ( ResourceMonitor_StreamInvokeClient , error )
2024-02-08 13:16:23 +00:00
Call ( ctx context . Context , in * ResourceCallRequest , opts ... grpc . CallOption ) ( * CallResponse , error )
2022-12-14 19:17:27 +00:00
ReadResource ( ctx context . Context , in * ReadResourceRequest , opts ... grpc . CallOption ) ( * ReadResourceResponse , error )
RegisterResource ( ctx context . Context , in * RegisterResourceRequest , opts ... grpc . CallOption ) ( * RegisterResourceResponse , error )
RegisterResourceOutputs ( ctx context . Context , in * RegisterResourceOutputsRequest , opts ... grpc . CallOption ) ( * emptypb . Empty , error )
Engine support for remote transforms (#15290)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This adds support to the engine for "remote transformations".
A transform is "remote" because it is being invoked via the engine on
receiving a resource registration, rather than being ran locally in
process before sending a resource registration. These transforms can
also span multiple process boundaries, e.g. a transform function in a
user program, then a transform function in a component library, both
running for a resource registered by another component library.
The underlying new feature here is the idea of a `Callback`. The
expectation is we're going to use callbacks for multiple features so
these are _not_ defined in terms of transformations. A callback is an
untyped byte array (usually will be a protobuf message), plus an address
to define which server should be invoked to do the callback, and a token
to identify it.
A language sdk can start up and serve a `Callbacks` service, keep a
mapping of tokens to in-process functions (currently just using UUID's
for this), and then pass that service address and token to the engine to
be invoked later on.
The engine uses these callbacks to track transformations callbacks per
resource, and on a new resource registrations invokes each relevant
callback with the resource properties and options, having new properties
and options returned that are then passed to the next relevant transform
callback until all have been called and the engine has the final
resource state and options to use.
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [x] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2024-02-21 16:30:46 +00:00
RegisterStackTransform ( ctx context . Context , in * Callback , opts ... grpc . CallOption ) ( * emptypb . Empty , error )
2022-12-14 19:17:27 +00:00
}
type resourceMonitorClient struct {
cc grpc . ClientConnInterface
}
func NewResourceMonitorClient ( cc grpc . ClientConnInterface ) ResourceMonitorClient {
return & resourceMonitorClient { cc }
}
func ( c * resourceMonitorClient ) SupportsFeature ( ctx context . Context , in * SupportsFeatureRequest , opts ... grpc . CallOption ) ( * SupportsFeatureResponse , error ) {
out := new ( SupportsFeatureResponse )
err := c . cc . Invoke ( ctx , "/pulumirpc.ResourceMonitor/SupportsFeature" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
func ( c * resourceMonitorClient ) Invoke ( ctx context . Context , in * ResourceInvokeRequest , opts ... grpc . CallOption ) ( * InvokeResponse , error ) {
out := new ( InvokeResponse )
err := c . cc . Invoke ( ctx , "/pulumirpc.ResourceMonitor/Invoke" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
func ( c * resourceMonitorClient ) StreamInvoke ( ctx context . Context , in * ResourceInvokeRequest , opts ... grpc . CallOption ) ( ResourceMonitor_StreamInvokeClient , error ) {
stream , err := c . cc . NewStream ( ctx , & ResourceMonitor_ServiceDesc . Streams [ 0 ] , "/pulumirpc.ResourceMonitor/StreamInvoke" , opts ... )
if err != nil {
return nil , err
}
x := & resourceMonitorStreamInvokeClient { stream }
if err := x . ClientStream . SendMsg ( in ) ; err != nil {
return nil , err
}
if err := x . ClientStream . CloseSend ( ) ; err != nil {
return nil , err
}
return x , nil
}
type ResourceMonitor_StreamInvokeClient interface {
Recv ( ) ( * InvokeResponse , error )
grpc . ClientStream
}
type resourceMonitorStreamInvokeClient struct {
grpc . ClientStream
}
func ( x * resourceMonitorStreamInvokeClient ) Recv ( ) ( * InvokeResponse , error ) {
m := new ( InvokeResponse )
if err := x . ClientStream . RecvMsg ( m ) ; err != nil {
return nil , err
}
return m , nil
}
2024-02-08 13:16:23 +00:00
func ( c * resourceMonitorClient ) Call ( ctx context . Context , in * ResourceCallRequest , opts ... grpc . CallOption ) ( * CallResponse , error ) {
2022-12-14 19:17:27 +00:00
out := new ( CallResponse )
err := c . cc . Invoke ( ctx , "/pulumirpc.ResourceMonitor/Call" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
func ( c * resourceMonitorClient ) ReadResource ( ctx context . Context , in * ReadResourceRequest , opts ... grpc . CallOption ) ( * ReadResourceResponse , error ) {
out := new ( ReadResourceResponse )
err := c . cc . Invoke ( ctx , "/pulumirpc.ResourceMonitor/ReadResource" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
func ( c * resourceMonitorClient ) RegisterResource ( ctx context . Context , in * RegisterResourceRequest , opts ... grpc . CallOption ) ( * RegisterResourceResponse , error ) {
out := new ( RegisterResourceResponse )
err := c . cc . Invoke ( ctx , "/pulumirpc.ResourceMonitor/RegisterResource" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
func ( c * resourceMonitorClient ) RegisterResourceOutputs ( ctx context . Context , in * RegisterResourceOutputsRequest , opts ... grpc . CallOption ) ( * emptypb . Empty , error ) {
out := new ( emptypb . Empty )
err := c . cc . Invoke ( ctx , "/pulumirpc.ResourceMonitor/RegisterResourceOutputs" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
Engine support for remote transforms (#15290)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This adds support to the engine for "remote transformations".
A transform is "remote" because it is being invoked via the engine on
receiving a resource registration, rather than being ran locally in
process before sending a resource registration. These transforms can
also span multiple process boundaries, e.g. a transform function in a
user program, then a transform function in a component library, both
running for a resource registered by another component library.
The underlying new feature here is the idea of a `Callback`. The
expectation is we're going to use callbacks for multiple features so
these are _not_ defined in terms of transformations. A callback is an
untyped byte array (usually will be a protobuf message), plus an address
to define which server should be invoked to do the callback, and a token
to identify it.
A language sdk can start up and serve a `Callbacks` service, keep a
mapping of tokens to in-process functions (currently just using UUID's
for this), and then pass that service address and token to the engine to
be invoked later on.
The engine uses these callbacks to track transformations callbacks per
resource, and on a new resource registrations invokes each relevant
callback with the resource properties and options, having new properties
and options returned that are then passed to the next relevant transform
callback until all have been called and the engine has the final
resource state and options to use.
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [x] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2024-02-21 16:30:46 +00:00
func ( c * resourceMonitorClient ) RegisterStackTransform ( ctx context . Context , in * Callback , opts ... grpc . CallOption ) ( * emptypb . Empty , error ) {
out := new ( emptypb . Empty )
err := c . cc . Invoke ( ctx , "/pulumirpc.ResourceMonitor/RegisterStackTransform" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
2022-12-14 19:17:27 +00:00
// ResourceMonitorServer is the server API for ResourceMonitor service.
// All implementations must embed UnimplementedResourceMonitorServer
// for forward compatibility
type ResourceMonitorServer interface {
SupportsFeature ( context . Context , * SupportsFeatureRequest ) ( * SupportsFeatureResponse , error )
Invoke ( context . Context , * ResourceInvokeRequest ) ( * InvokeResponse , error )
StreamInvoke ( * ResourceInvokeRequest , ResourceMonitor_StreamInvokeServer ) error
2024-02-08 13:16:23 +00:00
Call ( context . Context , * ResourceCallRequest ) ( * CallResponse , error )
2022-12-14 19:17:27 +00:00
ReadResource ( context . Context , * ReadResourceRequest ) ( * ReadResourceResponse , error )
RegisterResource ( context . Context , * RegisterResourceRequest ) ( * RegisterResourceResponse , error )
RegisterResourceOutputs ( context . Context , * RegisterResourceOutputsRequest ) ( * emptypb . Empty , error )
Engine support for remote transforms (#15290)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This adds support to the engine for "remote transformations".
A transform is "remote" because it is being invoked via the engine on
receiving a resource registration, rather than being ran locally in
process before sending a resource registration. These transforms can
also span multiple process boundaries, e.g. a transform function in a
user program, then a transform function in a component library, both
running for a resource registered by another component library.
The underlying new feature here is the idea of a `Callback`. The
expectation is we're going to use callbacks for multiple features so
these are _not_ defined in terms of transformations. A callback is an
untyped byte array (usually will be a protobuf message), plus an address
to define which server should be invoked to do the callback, and a token
to identify it.
A language sdk can start up and serve a `Callbacks` service, keep a
mapping of tokens to in-process functions (currently just using UUID's
for this), and then pass that service address and token to the engine to
be invoked later on.
The engine uses these callbacks to track transformations callbacks per
resource, and on a new resource registrations invokes each relevant
callback with the resource properties and options, having new properties
and options returned that are then passed to the next relevant transform
callback until all have been called and the engine has the final
resource state and options to use.
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [x] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2024-02-21 16:30:46 +00:00
RegisterStackTransform ( context . Context , * Callback ) ( * emptypb . Empty , error )
2022-12-14 19:17:27 +00:00
mustEmbedUnimplementedResourceMonitorServer ( )
}
// UnimplementedResourceMonitorServer must be embedded to have forward compatible implementations.
2023-03-04 22:11:52 +00:00
type UnimplementedResourceMonitorServer struct {
}
2022-12-14 19:17:27 +00:00
func ( UnimplementedResourceMonitorServer ) SupportsFeature ( context . Context , * SupportsFeatureRequest ) ( * SupportsFeatureResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method SupportsFeature not implemented" )
}
func ( UnimplementedResourceMonitorServer ) Invoke ( context . Context , * ResourceInvokeRequest ) ( * InvokeResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method Invoke not implemented" )
}
func ( UnimplementedResourceMonitorServer ) StreamInvoke ( * ResourceInvokeRequest , ResourceMonitor_StreamInvokeServer ) error {
return status . Errorf ( codes . Unimplemented , "method StreamInvoke not implemented" )
}
2024-02-08 13:16:23 +00:00
func ( UnimplementedResourceMonitorServer ) Call ( context . Context , * ResourceCallRequest ) ( * CallResponse , error ) {
2022-12-14 19:17:27 +00:00
return nil , status . Errorf ( codes . Unimplemented , "method Call not implemented" )
}
func ( UnimplementedResourceMonitorServer ) ReadResource ( context . Context , * ReadResourceRequest ) ( * ReadResourceResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method ReadResource not implemented" )
}
func ( UnimplementedResourceMonitorServer ) RegisterResource ( context . Context , * RegisterResourceRequest ) ( * RegisterResourceResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method RegisterResource not implemented" )
}
func ( UnimplementedResourceMonitorServer ) RegisterResourceOutputs ( context . Context , * RegisterResourceOutputsRequest ) ( * emptypb . Empty , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method RegisterResourceOutputs not implemented" )
}
Engine support for remote transforms (#15290)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This adds support to the engine for "remote transformations".
A transform is "remote" because it is being invoked via the engine on
receiving a resource registration, rather than being ran locally in
process before sending a resource registration. These transforms can
also span multiple process boundaries, e.g. a transform function in a
user program, then a transform function in a component library, both
running for a resource registered by another component library.
The underlying new feature here is the idea of a `Callback`. The
expectation is we're going to use callbacks for multiple features so
these are _not_ defined in terms of transformations. A callback is an
untyped byte array (usually will be a protobuf message), plus an address
to define which server should be invoked to do the callback, and a token
to identify it.
A language sdk can start up and serve a `Callbacks` service, keep a
mapping of tokens to in-process functions (currently just using UUID's
for this), and then pass that service address and token to the engine to
be invoked later on.
The engine uses these callbacks to track transformations callbacks per
resource, and on a new resource registrations invokes each relevant
callback with the resource properties and options, having new properties
and options returned that are then passed to the next relevant transform
callback until all have been called and the engine has the final
resource state and options to use.
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [x] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2024-02-21 16:30:46 +00:00
func ( UnimplementedResourceMonitorServer ) RegisterStackTransform ( context . Context , * Callback ) ( * emptypb . Empty , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method RegisterStackTransform not implemented" )
}
2022-12-14 19:17:27 +00:00
func ( UnimplementedResourceMonitorServer ) mustEmbedUnimplementedResourceMonitorServer ( ) { }
// UnsafeResourceMonitorServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ResourceMonitorServer will
// result in compilation errors.
type UnsafeResourceMonitorServer interface {
mustEmbedUnimplementedResourceMonitorServer ( )
}
func RegisterResourceMonitorServer ( s grpc . ServiceRegistrar , srv ResourceMonitorServer ) {
s . RegisterService ( & ResourceMonitor_ServiceDesc , srv )
}
func _ResourceMonitor_SupportsFeature_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( SupportsFeatureRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( ResourceMonitorServer ) . SupportsFeature ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/pulumirpc.ResourceMonitor/SupportsFeature" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( ResourceMonitorServer ) . SupportsFeature ( ctx , req . ( * SupportsFeatureRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _ResourceMonitor_Invoke_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( ResourceInvokeRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( ResourceMonitorServer ) . Invoke ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/pulumirpc.ResourceMonitor/Invoke" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( ResourceMonitorServer ) . Invoke ( ctx , req . ( * ResourceInvokeRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _ResourceMonitor_StreamInvoke_Handler ( srv interface { } , stream grpc . ServerStream ) error {
m := new ( ResourceInvokeRequest )
if err := stream . RecvMsg ( m ) ; err != nil {
return err
}
return srv . ( ResourceMonitorServer ) . StreamInvoke ( m , & resourceMonitorStreamInvokeServer { stream } )
}
type ResourceMonitor_StreamInvokeServer interface {
Send ( * InvokeResponse ) error
grpc . ServerStream
}
type resourceMonitorStreamInvokeServer struct {
grpc . ServerStream
}
func ( x * resourceMonitorStreamInvokeServer ) Send ( m * InvokeResponse ) error {
return x . ServerStream . SendMsg ( m )
}
func _ResourceMonitor_Call_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
2024-02-08 13:16:23 +00:00
in := new ( ResourceCallRequest )
2022-12-14 19:17:27 +00:00
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( ResourceMonitorServer ) . Call ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/pulumirpc.ResourceMonitor/Call" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
2024-02-08 13:16:23 +00:00
return srv . ( ResourceMonitorServer ) . Call ( ctx , req . ( * ResourceCallRequest ) )
2022-12-14 19:17:27 +00:00
}
return interceptor ( ctx , in , info , handler )
}
func _ResourceMonitor_ReadResource_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( ReadResourceRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( ResourceMonitorServer ) . ReadResource ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/pulumirpc.ResourceMonitor/ReadResource" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( ResourceMonitorServer ) . ReadResource ( ctx , req . ( * ReadResourceRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _ResourceMonitor_RegisterResource_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( RegisterResourceRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( ResourceMonitorServer ) . RegisterResource ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/pulumirpc.ResourceMonitor/RegisterResource" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( ResourceMonitorServer ) . RegisterResource ( ctx , req . ( * RegisterResourceRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _ResourceMonitor_RegisterResourceOutputs_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( RegisterResourceOutputsRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( ResourceMonitorServer ) . RegisterResourceOutputs ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/pulumirpc.ResourceMonitor/RegisterResourceOutputs" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( ResourceMonitorServer ) . RegisterResourceOutputs ( ctx , req . ( * RegisterResourceOutputsRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
Engine support for remote transforms (#15290)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This adds support to the engine for "remote transformations".
A transform is "remote" because it is being invoked via the engine on
receiving a resource registration, rather than being ran locally in
process before sending a resource registration. These transforms can
also span multiple process boundaries, e.g. a transform function in a
user program, then a transform function in a component library, both
running for a resource registered by another component library.
The underlying new feature here is the idea of a `Callback`. The
expectation is we're going to use callbacks for multiple features so
these are _not_ defined in terms of transformations. A callback is an
untyped byte array (usually will be a protobuf message), plus an address
to define which server should be invoked to do the callback, and a token
to identify it.
A language sdk can start up and serve a `Callbacks` service, keep a
mapping of tokens to in-process functions (currently just using UUID's
for this), and then pass that service address and token to the engine to
be invoked later on.
The engine uses these callbacks to track transformations callbacks per
resource, and on a new resource registrations invokes each relevant
callback with the resource properties and options, having new properties
and options returned that are then passed to the next relevant transform
callback until all have been called and the engine has the final
resource state and options to use.
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [x] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2024-02-21 16:30:46 +00:00
func _ResourceMonitor_RegisterStackTransform_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( Callback )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( ResourceMonitorServer ) . RegisterStackTransform ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/pulumirpc.ResourceMonitor/RegisterStackTransform" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( ResourceMonitorServer ) . RegisterStackTransform ( ctx , req . ( * Callback ) )
}
return interceptor ( ctx , in , info , handler )
}
2022-12-14 19:17:27 +00:00
// ResourceMonitor_ServiceDesc is the grpc.ServiceDesc for ResourceMonitor service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ResourceMonitor_ServiceDesc = grpc . ServiceDesc {
ServiceName : "pulumirpc.ResourceMonitor" ,
HandlerType : ( * ResourceMonitorServer ) ( nil ) ,
Methods : [ ] grpc . MethodDesc {
{
MethodName : "SupportsFeature" ,
Handler : _ResourceMonitor_SupportsFeature_Handler ,
} ,
{
MethodName : "Invoke" ,
Handler : _ResourceMonitor_Invoke_Handler ,
} ,
{
MethodName : "Call" ,
Handler : _ResourceMonitor_Call_Handler ,
} ,
{
MethodName : "ReadResource" ,
Handler : _ResourceMonitor_ReadResource_Handler ,
} ,
{
MethodName : "RegisterResource" ,
Handler : _ResourceMonitor_RegisterResource_Handler ,
} ,
{
MethodName : "RegisterResourceOutputs" ,
Handler : _ResourceMonitor_RegisterResourceOutputs_Handler ,
} ,
Engine support for remote transforms (#15290)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This adds support to the engine for "remote transformations".
A transform is "remote" because it is being invoked via the engine on
receiving a resource registration, rather than being ran locally in
process before sending a resource registration. These transforms can
also span multiple process boundaries, e.g. a transform function in a
user program, then a transform function in a component library, both
running for a resource registered by another component library.
The underlying new feature here is the idea of a `Callback`. The
expectation is we're going to use callbacks for multiple features so
these are _not_ defined in terms of transformations. A callback is an
untyped byte array (usually will be a protobuf message), plus an address
to define which server should be invoked to do the callback, and a token
to identify it.
A language sdk can start up and serve a `Callbacks` service, keep a
mapping of tokens to in-process functions (currently just using UUID's
for this), and then pass that service address and token to the engine to
be invoked later on.
The engine uses these callbacks to track transformations callbacks per
resource, and on a new resource registrations invokes each relevant
callback with the resource properties and options, having new properties
and options returned that are then passed to the next relevant transform
callback until all have been called and the engine has the final
resource state and options to use.
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [x] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2024-02-21 16:30:46 +00:00
{
MethodName : "RegisterStackTransform" ,
Handler : _ResourceMonitor_RegisterStackTransform_Handler ,
} ,
2022-12-14 19:17:27 +00:00
} ,
Streams : [ ] grpc . StreamDesc {
{
StreamName : "StreamInvoke" ,
Handler : _ResourceMonitor_StreamInvoke_Handler ,
ServerStreams : true ,
} ,
} ,
Metadata : "pulumi/resource.proto" ,
}