-
Notifications
You must be signed in to change notification settings - Fork 108
feat: V2 library worker #1667
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
base: dev
Are you sure you want to change the base?
feat: V2 library worker #1667
Conversation
…e/azure-functions-python-worker into hallvictoria/library-worker
|
||
|
||
async def function_load_request(request): | ||
logger.debug("V2 Library Worker: received WorkerLoadRequest") |
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.
This is a no-op for the V2 library worker, but this method still needs to be defined in order to work with the proxy worker.
function_id) | ||
assert fi is not None | ||
logger.info("Function name: %s, Function Type: %s", | ||
fi.name, |
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.
This is the third and last new log added. We log the function name and type (async vs. sync). This information was previously logged, so we log it here as well to maintain comprehensive logging.
configure_opentelemetry(fi_context) | ||
|
||
# Extensions are not supported | ||
call_result = await execute_async(fi.func, args) |
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.
Extensions are not supported in 3.13+
+ str(indexed_function_bindings_logs)) | ||
indexed_function_logs.append(function_log) | ||
|
||
log_data = { |
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.
This formats the log into a JSON that we can easily parse in Kusto. We log the app setting state here alone -- this ensures that the app settings that are logged are accurate.
import traceback | ||
|
||
# Logging Prefixes | ||
SDK_LOG_PREFIX = "azure.functions" |
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.
Todo: change log prefix?
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
import asyncio |
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.
Refactor: moved methods related to the loop & executing out from dispatcher.py
@@ -49,31 +47,7 @@ extends: | |||
- stage: Build | |||
jobs: | |||
- template: /eng/templates/official/jobs/build-artifacts.yml@self |
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.
There will be only unit tests for the library worker. E2E tests will remain in the proxy worker.
Description
The library worker holds the main logic for responding to the host, indexing function apps, and executing functions.
Fixes #
PR information
Quality of Code and Contribution Guidelines