-
Notifications
You must be signed in to change notification settings - Fork 107
Python Worker Extension Interface (worker) #815
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
Conversation
3e21058
to
52b5c7b
Compare
206ea5a
to
0386a23
Compare
7352a99
to
65f9e66
Compare
65f9e66
to
cb8624c
Compare
…-functions-python-worker into hazeng/extension-wrk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An initial set of small comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second set of comments. Still to finish the test_extension.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM;
minor comments.
Changes
Received WorkerInitRequest, python version 3.7.5 (tags/v3.7.5:5c02a39a0b, Oct 15 2019, 00:11:34) [MSC v.1916 64 bit (AMD64)], worker version 1.1.10, request ID 768c03e6-b194-49ab-9866-0f9978fcdf1d
Description
This PR is based on #757
This PR has a dependency on Azure/azure-functions-python-library#81
This extension manager is intended to be used with azure.functions SDK. There're three roles involves in this scenarios.
To enable this feature, two feature flags needs to be turned on in Python 3.6, 3.7 and 3.8.
Python 3.9 enables this feature by default.
PYTHON_ISOLATE_WORKER_DEPENDENCIES this will ensure when registering the extension, it will always direct to customer's azure-functions SDK instead of the built-in one.
PYTHON_ENABLE_WORKER_EXTENSIONS this will ensure the extension loaders are enabled. Otherwise, it will be ignored.
1. Python function worker and SDK maintainers
We decided to release a new extension module in azure.functions SDK where Extension developers can use it to register their extension. (Azure/azure-functions-python-library#81)
2. Extension developers
Here are two examples for developing Application Level Extension and Function Level Extension for Python Worker.
Function Extension: https://github.com/Hazhzeng/functions-ext-profile
Application Extension: https://github.com/Hazhzeng/application-ext-timer
3. Azure Functions Users
The need to download the extension and azure-functions in their requirements.txt
To use a function extension:
To apply an application extension into every triggers:
Fixes #642
cc: @lzchen
PR information
Quality of Code and Contribution Guidelines