Skip to content

Commit 944d8cd

Browse files
authored
Merge branch 'dev' into hallvictoria/sdk-bindings
2 parents 0669c44 + 0f8c67d commit 944d8cd

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585

8686
EXTRA_REQUIRES = {
8787
"dev": [
88-
"azure-eventhub~=5.7.0", # Used for EventHub E2E tests
88+
"azure-eventhub", # Used for EventHub E2E tests
8989
"azure-functions-durable", # Used for Durable E2E tests
9090
"flask",
9191
"fastapi~=0.85.0", # Used for ASGIMiddleware test

tests/utils/testutils_lc.py

+26
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
"/archive/refs/heads/dev.zip"
3333
_FUNC_FILE_NAME = "azure-functions-python-library-dev"
3434
_CUSTOM_IMAGE = "CUSTOM_IMAGE"
35+
_EXTENSION_BASE_ZIP = 'https://github.com/Azure/azure-functions-python-' \
36+
'extensions/archive/refs/heads/dev.zip'
3537

3638

3739
class LinuxConsumptionWebHostController:
@@ -151,6 +153,15 @@ def _download_azure_functions() -> str:
151153
with ZipFile(BytesIO(zipresp.read())) as zfile:
152154
zfile.extractall(tempfile.gettempdir())
153155

156+
@staticmethod
157+
def _download_extensions() -> str:
158+
folder = tempfile.gettempdir()
159+
with urlopen(_EXTENSION_BASE_ZIP) as zipresp:
160+
with ZipFile(BytesIO(zipresp.read())) as zfile:
161+
zfile.extractall(tempfile.gettempdir())
162+
163+
return folder
164+
154165
def spawn_container(self,
155166
image: str,
156167
env: Dict[str, str] = {}) -> int:
@@ -163,11 +174,24 @@ def spawn_container(self,
163174
# TODO: Mount library in docker container
164175
# self._download_azure_functions()
165176

177+
# Download python extension base package
178+
ext_folder = self._download_extensions()
179+
166180
container_worker_path = (
167181
f"/azure-functions-host/workers/python/{self._py_version}/"
168182
"LINUX/X64/azure_functions_worker"
169183
)
170184

185+
base_ext_container_path = (
186+
f"/azure-functions-host/workers/python/{self._py_version}/"
187+
"LINUX/X64/azurefunctions/extensions/base"
188+
)
189+
190+
base_ext_local_path = (
191+
f'{ext_folder}/azure-functions-python'
192+
'-extensions-dev/azurefunctions-extensions-base'
193+
'/azurefunctions/extensions/base'
194+
)
171195
run_cmd = []
172196
run_cmd.extend([self._docker_cmd, "run", "-p", "0:80", "-d"])
173197
run_cmd.extend(["--name", self._uuid, "--privileged"])
@@ -177,6 +201,8 @@ def spawn_container(self,
177201
run_cmd.extend(["-e", f"CONTAINER_ENCRYPTION_KEY={_DUMMY_CONT_KEY}"])
178202
run_cmd.extend(["-e", "WEBSITE_PLACEHOLDER_MODE=1"])
179203
run_cmd.extend(["-v", f'{worker_path}:{container_worker_path}'])
204+
run_cmd.extend(["-v",
205+
f'{base_ext_local_path}:{base_ext_container_path}'])
180206

181207
for key, value in env.items():
182208
run_cmd.extend(["-e", f"{key}={value}"])

0 commit comments

Comments
 (0)