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 dapr-proxy mode #65

Merged
merged 1 commit into from
Sep 22, 2022
Merged

support dapr-proxy mode #65

merged 1 commit into from
Sep 22, 2022

Conversation

wrongerror
Copy link
Member

@wrongerror wrongerror commented Sep 21, 2022

  • support dapr-proxy mode, get daprHost from env vars, init daprClient based on daprHost and daprGRPCPort.
  • Do not generate/init daprClient when the sync function uses the OpenFunction signature but does not define inputs and outputs.
  • support create dapr service with HTTP protocol.

Signed-off-by: wrongerror [email protected]

handler, err := daprd.NewService(fmt.Sprintf(":%s", port))

var newService func(address string) (s dapr.Service, err error)
protocol := daprruntime.Protocol(os.Getenv(protocolEnvVar))
Copy link
Member

Choose a reason for hiding this comment

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

why we are providing both HTTP and gRPC here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Just because developing dapr-proxy requires both grpc and http support (ff-nodejs using http).

@@ -19,6 +21,7 @@ import (

const (
defaultPattern = "/"
protocolEnvVar = "APP_PROTOCOL"
Copy link
Member

Choose a reason for hiding this comment

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

if I understand correctly, we will need to pass this environment variable via openfunction controller?

Copy link
Member Author

@wrongerror wrongerror Sep 22, 2022

Choose a reason for hiding this comment

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

Yeah, openfunction controller will set this envVar,when serving.annotations contains dapr.io/app-protocol: http. (only do so in one dapr-sidecar-per-function mode).

@benjaminhuo benjaminhuo merged commit 28cbda8 into OpenFunction:main Sep 22, 2022
@wrongerror wrongerror changed the title support one-dapr-sidecar-per-function mode support dapr-proxy mode Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants