Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

develop ff-python based on ofn v1beta2#3

Merged
benjaminhuo merged 9 commits into
OpenFunction:masterfrom
tpiperatgod:dev
Jul 11, 2023
Merged

develop ff-python based on ofn v1beta2#3
benjaminhuo merged 9 commits into
OpenFunction:masterfrom
tpiperatgod:dev

Conversation

@tpiperatgod

Copy link
Copy Markdown
Member

No description provided.

Signed-off-by: laminar <tpiperatgod@gmail.com>
@tpiperatgod tpiperatgod changed the title develop ff-python based on ofn v1beta2 [WIP] develop ff-python based on ofn v1beta2 Jun 21, 2023
Signed-off-by: laminar <tpiperatgod@gmail.com>
Signed-off-by: laminar <tpiperatgod@gmail.com>
Signed-off-by: laminar <tpiperatgod@gmail.com>
@benjaminhuo

Copy link
Copy Markdown
Member

That's great, looking forward to this PR! @wanjunlei @wrongerror

Signed-off-by: laminar <tpiperatgod@gmail.com>
Signed-off-by: laminar <tpiperatgod@gmail.com>
Signed-off-by: laminar <tpiperatgod@gmail.com>
Signed-off-by: laminar <tpiperatgod@gmail.com>
@tpiperatgod

Copy link
Copy Markdown
Member Author

I think this PR is ready for review, as it currently supports Dapr and HTTP triggers. (can be demonstrated in the sig meeting)

The observability feature and the hooks feature can be worked on later.

What are your comments?

@tpiperatgod tpiperatgod changed the title [WIP] develop ff-python based on ofn v1beta2 develop ff-python based on ofn v1beta2 Jul 6, 2023
@benjaminhuo

Copy link
Copy Markdown
Member

@tpiperatgod That's great. @wanjunlei @wrongerror @webup @lizzzcai would you help to review?

@benjaminhuo benjaminhuo requested review from kehuili and lizzzcai and removed request for kehuili July 7, 2023 01:58
@tpiperatgod tpiperatgod linked an issue Jul 7, 2023 that may be closed by this pull request
Comment thread src/functions_framework/context/function_context.py Outdated
Comment thread src/functions_framework/context/function_context.py Outdated
return self.__http_request

@exception_handler
def send(self, output_name, data):

@benjaminhuo benjaminhuo Jul 8, 2023

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Now we do not encourage users to call send now. Instead, we suggest invoking dapr method directly using daprClient like this https://github.com/OpenFunction/java-samples/blob/main/src/main/java/dev/openfunction/samples/StateStore.java#L72

invokeBindings for the binding component

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I see. Should we remove send() or keep it for now?

@benjaminhuo benjaminhuo Jul 10, 2023

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We can keep it for now, but can user get daprClient from function's context now?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

UserContext has the self.dapr_client

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

UserContext has the self.dapr_client

Then we need samples to call dapr client directly

Comment thread src/functions_framework/triggers/dapr_trigger/dapr.py Outdated
@benjaminhuo

Copy link
Copy Markdown
Member

I'm okay with this PR, and it's great to have this significant improvement to the Python framework.
Just some minor issues remain.

@lizzzcai

lizzzcai commented Jul 9, 2023

Copy link
Copy Markdown
Member

any changes from the user side? maybe can update the docs if any.

@tpiperatgod

Copy link
Copy Markdown
Member Author

any changes from the user side? maybe can update the docs if any.

I'll update the docs and examples later

@@ -0,0 +1,217 @@
# Copyright 2020 Google LLC

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this should be updated as well?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I kept some of gcp's license header because almost all of that code comes from gcp's ff-python, what do you think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

in this case, I think can keep it. maybe @benjaminhuo can comment.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Keep it if we haven't modify it

Signed-off-by: laminar <tpiperatgod@gmail.com>
@benjaminhuo benjaminhuo merged commit 4c57790 into OpenFunction:master Jul 11, 2023
@tpiperatgod tpiperatgod deleted the dev branch July 11, 2023 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support ofn v1beta2

3 participants