-
Notifications
You must be signed in to change notification settings - Fork 107
chore: Updating lc image to flex #1795
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
Open
gavin-aguiar
wants to merge
6
commits into
dev
Choose a base branch
from
gaaguiar/flex_tests
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0a1ade4
Updating lc image to flex
gavin-aguiar b8dfeee
Fixing test
gavin-aguiar 6f777d1
Mounting proxy worker for 3.13 tests
gavin-aguiar 8449783
Debug logging fix
gavin-aguiar 5fb3177
Adding py314
gavin-aguiar bfd59ee
Updated image repo for flexconsumption
gavin-aguiar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,8 +26,12 @@ | |
| # Linux Consumption Testing Constants | ||
| _DOCKER_PATH = "DOCKER_PATH" | ||
| _DOCKER_DEFAULT_PATH = "docker" | ||
| _MESH_IMAGE_URL = "https://mcr.microsoft.com/v2/azure-functions/mesh/tags/list" | ||
| _MESH_IMAGE_REPO = "mcr.microsoft.com/azure-functions/mesh" | ||
| _OS_TYPE = "bookworm" if sys.version_info.minor < 14 else "noble" | ||
| _MESH_IMAGE_URL = ( | ||
| f"https://mcr.microsoft.com/v2/azure-functions/{_OS_TYPE}/" | ||
| "flexconsumption/tags/list" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this also work for 3.14 in the future? |
||
| ) | ||
| _MESH_IMAGE_REPO = f"mcr.microsoft.com/azure-functions/{_OS_TYPE}/flexconsumption" | ||
| _FUNC_GITHUB_ZIP = "https://github.com/Azure/azure-functions-python-library" \ | ||
| "/archive/refs/heads/dev.zip" | ||
| _FUNC_FILE_NAME = "azure-functions-python-library-dev" | ||
|
|
@@ -219,19 +223,44 @@ def spawn_container(self, | |
| container according to the image name. Return the port of container. | ||
| """ | ||
| # Construct environment variables and start the docker container | ||
| worker_path = os.path.join(PROJECT_ROOT, 'azure_functions_worker') | ||
| worker_name = 'azure_functions_worker' \ | ||
| if sys.version_info.minor < 13 else 'proxy_worker' | ||
|
|
||
| worker_path = os.path.join(PROJECT_ROOT, worker_name) | ||
| container_worker_path = ( | ||
| f"/azure-functions-host/workers/python/{self._py_version}/" | ||
| f"LINUX/X64/{worker_name}" | ||
| ) | ||
|
|
||
| # For Python 3.13+, also mount the runtime libraries | ||
| runtime_v2_path = None | ||
| runtime_v1_path = None | ||
| container_runtime_v2_path = None | ||
| container_runtime_v1_path = None | ||
|
|
||
| if sys.version_info.minor >= 13: | ||
| repo_root = os.path.dirname(PROJECT_ROOT) | ||
| runtime_v2_path = os.path.join( | ||
| repo_root, 'runtimes', 'v2', 'azure_functions_runtime' | ||
| ) | ||
| runtime_v1_path = os.path.join( | ||
| repo_root, 'runtimes', 'v1', 'azure_functions_runtime_v1' | ||
| ) | ||
| container_runtime_v2_path = ( | ||
| f"/azure-functions-host/workers/python/{self._py_version}/" | ||
| "LINUX/X64/azure_functions_runtime" | ||
| ) | ||
| container_runtime_v1_path = ( | ||
| f"/azure-functions-host/workers/python/{self._py_version}/" | ||
| "LINUX/X64/azure_functions_runtime_v1" | ||
| ) | ||
|
|
||
| # TODO: Mount library in docker container | ||
| # self._download_azure_functions() | ||
|
|
||
| # Download python extension base package | ||
| ext_folder = self._download_extensions() | ||
|
|
||
| container_worker_path = ( | ||
| f"/azure-functions-host/workers/python/{self._py_version}/" | ||
| "LINUX/X64/azure_functions_worker" | ||
| ) | ||
|
|
||
| base_ext_container_path = ( | ||
| f"/azure-functions-host/workers/python/{self._py_version}/" | ||
| "LINUX/X64/azurefunctions/extensions/base" | ||
|
|
@@ -255,6 +284,16 @@ def spawn_container(self, | |
| run_cmd.extend(["-e", f"WEBSITE_SITE_NAME={self._uuid}"]) | ||
| run_cmd.extend(["-e", "WEBSITE_SKU=Dynamic"]) | ||
| run_cmd.extend(["-v", f'{worker_path}:{container_worker_path}']) | ||
|
|
||
| # Mount runtime libraries for Python 3.13+ | ||
| if runtime_v2_path and runtime_v1_path: | ||
| run_cmd.extend([ | ||
| "-v", f'{runtime_v2_path}:{container_runtime_v2_path}' | ||
| ]) | ||
| run_cmd.extend([ | ||
| "-v", f'{runtime_v1_path}:{container_runtime_v1_path}' | ||
| ]) | ||
|
|
||
| run_cmd.extend(["-v", | ||
| f'{base_ext_local_path}:{base_ext_container_path}']) | ||
|
|
||
|
|
||
Oops, something went wrong.
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.
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.
Could we keep this assert but change the regex so it works for all python versions? For example, both proxy and afw log "Finished prioritize_customer_dependencies" - we could check for this log instead