-
Notifications
You must be signed in to change notification settings - Fork 433
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 model-type bindings for out-of-proc workers #8815
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fabiocav
reviewed
Oct 6, 2022
src/WebJobs.Script.Abstractions/Description/Binding/DataType.cs
Outdated
Show resolved
Hide resolved
src/WebJobs.Script.Grpc/MessageExtensions/GrpcMessageConversionExtensions.cs
Outdated
Show resolved
Hide resolved
This was referenced Oct 12, 2022
liliankasem
commented
Oct 21, 2022
liliankasem
commented
Oct 21, 2022
liliankasem
commented
Oct 21, 2022
src/WebJobs.Script.Abstractions/Description/Binding/DataType.cs
Outdated
Show resolved
Hide resolved
src/WebJobs.Script.Grpc/MessageExtensions/GrpcMessageConversionExtensions.cs
Outdated
Show resolved
Hide resolved
src/WebJobs.Script.Grpc/MessageExtensions/GrpcMessageConversionExtensions.cs
Outdated
Show resolved
Hide resolved
liliankasem
commented
Oct 24, 2022
liliankasem
commented
Oct 24, 2022
src/WebJobs.Script.Grpc/azure-functions-language-worker-protobuf/src/proto/FunctionRpc.proto
Outdated
Show resolved
Hide resolved
liliankasem
changed the title
Support new ParameterBindingData reference type for SDK-type bindings
Support model-type bindings for out-of-proc workers
Oct 26, 2022
liliankasem
commented
Oct 27, 2022
liliankasem
force-pushed
the
sdk-bindings/support-reference-type
branch
from
October 28, 2022 00:40
e895b70
to
d41f91f
Compare
liliankasem
commented
Oct 28, 2022
liliankasem
commented
Oct 28, 2022
liliankasem
force-pushed
the
sdk-bindings/support-reference-type
branch
2 times, most recently
from
October 28, 2022 01:24
be3c9a7
to
0c8ae90
Compare
liliankasem
commented
Oct 28, 2022
liliankasem
commented
Oct 28, 2022
src/WebJobs.Script.Abstractions/Description/Binding/BindingMetadata.cs
Outdated
Show resolved
Hide resolved
mathewc
reviewed
Oct 28, 2022
src/WebJobs.Script/Description/Workers/WorkerFunctionDescriptorProvider.cs
Outdated
Show resolved
Hide resolved
mathewc
reviewed
Oct 28, 2022
src/WebJobs.Script/Description/Workers/WorkerFunctionDescriptorProvider.cs
Outdated
Show resolved
Hide resolved
mathewc
reviewed
Oct 28, 2022
src/WebJobs.Script/Description/Workers/WorkerFunctionDescriptorProvider.cs
Outdated
Show resolved
Hide resolved
mathewc
reviewed
Oct 28, 2022
src/WebJobs.Script/Description/Workers/WorkerFunctionDescriptorProvider.cs
Outdated
Show resolved
Hide resolved
mathewc
reviewed
Oct 28, 2022
src/WebJobs.Script/Description/Workers/WorkerFunctionDescriptorProvider.cs
Outdated
Show resolved
Hide resolved
mathewc
reviewed
Oct 28, 2022
src/WebJobs.Script.Abstractions/Description/Binding/BindingMetadata.cs
Outdated
Show resolved
Hide resolved
mathewc
reviewed
Oct 28, 2022
src/WebJobs.Script/Description/Workers/WorkerFunctionDescriptorProvider.cs
Outdated
Show resolved
Hide resolved
fabiocav
reviewed
Oct 31, 2022
src/WebJobs.Script.Abstractions/Description/Binding/BindingMetadata.cs
Outdated
Show resolved
Hide resolved
src/WebJobs.Script.Grpc/azure-functions-language-worker-protobuf/src/proto/FunctionRpc.proto
Outdated
Show resolved
Hide resolved
src/WebJobs.Script/Binding/Extensibility/ScriptBindingContext.cs
Outdated
Show resolved
Hide resolved
fabiocav
reviewed
Oct 31, 2022
src/WebJobs.Script/Description/Workers/WorkerFunctionDescriptorProvider.cs
Show resolved
Hide resolved
liliankasem
force-pushed
the
sdk-bindings/support-reference-type
branch
2 times, most recently
from
November 1, 2022 22:04
5770e16
to
84e56c7
Compare
mathewc
reviewed
Nov 1, 2022
src/WebJobs.Script/Description/Workers/WorkerFunctionDescriptorProvider.cs
Outdated
Show resolved
Hide resolved
mathewc
reviewed
Nov 1, 2022
liliankasem
force-pushed
the
sdk-bindings/support-reference-type
branch
from
November 2, 2022 18:57
893b125
to
79c9baa
Compare
liliankasem
force-pushed
the
sdk-bindings/support-reference-type
branch
from
November 2, 2022 19:03
a9a940b
to
73be007
Compare
mathewc
reviewed
Nov 2, 2022
src/WebJobs.Script/Description/Workers/WorkerFunctionDescriptorProvider.cs
Show resolved
Hide resolved
liliankasem
force-pushed
the
sdk-bindings/support-reference-type
branch
from
November 2, 2022 22:37
f299e76
to
95988ca
Compare
mathewc
approved these changes
Nov 2, 2022
surgupta-msft
approved these changes
Nov 3, 2022
This was referenced Nov 3, 2022
8 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add support for model-type bindings for out-of-proc workers
Part of the work to support SDK-type bindings for out-of-proc workers is for the host to bind to
ParameterBindingData
if a function supports deferred binding. Deferred binding means that instead of resolving binding payloads host-side, it will be deferred so that the worker resolves binding when it gets the invocation request. For example, if a function binds to a BlobClient, instead of creating and passing around a BlobClient, we will useParameterBindingData
to gather all the relevant information the worker would need to create the BlobClient itself (worker-side).Things happening in this PR:
Support binding to ParameterBindingData. If a function indicates that it supports deferred binding, we can use
ParameterBindingData
to get the relevant information from the extension. By setting this as a functions defaultType, we can check extension converters to see if they can provideParameterBindingData
which enables us to bind functions to SDK-types on the worker side.A limitation here is that we only support
ParameterBindingData
and deferred binding for trigger bindings if none of the function's input or output bindings contain an expression (you can read more about why this limitation exists in this issue). Because of this, we first check if the trigger binding "SupportsDeferredBinding". If it does, we check all the attributes for the input and output bindings to see if there are any expressions being used. If an expressions is being used, we set the "SkipDeferredBinding" flag in the function's metadataProperties
. We useSkipDeferredBinding
later down the line to skip deferred binding for the trigger, meaning we setSupportsDeferredBinding
to false. So instead of using ParameterBindingData, we use the defaultType that is evaluated by the WebJobs sdk.Update ScriptBindingContext to include
Properties
prop and aSupportsDeferredBinding
prop. In the protobuf, the Binding info was updated to include aProperties
map. This map is used by workers to add additional information about a function binding. For this specific feature, the worker will add aSupportsDeferredBinding
prop to theProperties
map to indicate to the host that a given function supports deferred binding.Convert ParameterBindingData to ModelBindingData so that we can send this information of gRPC to workers.
ModelBindingData
is the gRPC message representation of the WebJobsParameterBindingData
; you can find the protobuf definition for this hereThe Azure/azure-functions-dotnet-worker#1081 (comment) has a list of all the PRs related to this feature