Reputation: 11
I get the following traces when I publish my Python 3.8 app to an Azure function on a Linux consumption plan:
No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
This appears to only happen when I import certain packages; if I use a fresh project with the default HttpTrigger function, it works fine. If I comment out most of my code and imports, it's able to detect the functions.
When I run it locally, or when I publish to a function app on an non-consumption App Service Plan, it works fine with all of the code/imports.
I've adding/removing comments to try and narrow down the imports causing the issue and it appears to be librosa
, torchaudio
, torch_audiomentations
. The only change I'm making is imports in code; these dependencies being in requirements.txt does not prevent the runtime from seeing the functions as long as I have the code/imports commented out.
I'm using the V2 programming model. I'm running my project through VSCode pointed to a WSL Ubuntu distro. I have Function core tools 4. I'm publishing using the VSCode functions extensions.
I have had to add +cpu
to the end of a few packages to get the project to build at all using remote build (torch and torchvision, specifically).
I've tried publishing directly through Function core tools, I've tried building locally, I've tried installing packages manually and publishing with --no-build, nothing has worked.
Installing the packages locally did reveal some dependency incompatibilities that I didn't see elsewhere, but publishing after resolving them didn't fix the issue.
I think the primary issue here is just a lack of feedback from the tools about what is wrong. The only indication that something is wrong is that the runtime isn't loading any functions. I'm not seeing anything about:
My requirements.txt:
# DO NOT include azure-functions-worker in this file
# The Python Worker is managed by Azure Functions platform
# Manually managing azure-functions-worker may cause unexpected issues
# Azure Functions
azure-functions
azure-functions-durable
# API dependencies
numpy==1.21.0
decorator==4.4.2
pandas==1.1.5
opencv-python==4.6.0.66
librosa==0.8.0 #--no-binary=librosa
scipy==1.5.4
-f https://download.pytorch.org/whl/torch_stable.html
torch==1.8.1+cpu
torch-audiomentations==0.10.1 #--no-binary=torch-audiomentations
torchaudio==0.8.1 #--no-binary=torchaudio
torchvision== 0.9.1+cpu
moviepy==1.0.3
lightgbm==3.3.2
pyloudnorm==0.1.0
#fix dependency issues
#testresources
#urllib3==1.*
Here is typical log output for a remote build when it doesn't load the functions:
10:49:26 AM {appname}: Starting deployment...
10:49:26 AM {appname}: Creating zip package...
10:49:26 AM {appname}: Zip package size: 68.2 kB
10:49:29 AM {appname}: Fetching changes.
10:49:30 AM {appname}: Cleaning up temp folders from previous zip deployments and extracting pushed zip file /tmp/zipdeploy/bf975c4d-b0f0-4c6c-81fd-9a32561b3fe9.zip (0.07 MB) to /tmp/zipdeploy/extracted
10:49:32 AM {appname}: Updating submodules.
10:49:33 AM {appname}: Preparing deployment for commit id '97958f16-5'.
10:49:33 AM {appname}: PreDeployment: context.CleanOutputPath False
10:49:33 AM {appname}: PreDeployment: context.OutputPath /home/site/wwwroot
10:49:33 AM {appname}: Repository path is /tmp/zipdeploy/extracted
10:49:33 AM {appname}: Running oryx build...
10:49:33 AM {appname}: Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.8.6 -p packagedir=.python_packages/lib/site-packages
10:49:35 AM {appname}: Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
10:49:35 AM {appname}: You can report issues at https://github.com/Microsoft/Oryx/issues
10:49:35 AM {appname}: Oryx Version: 0.2.20210120.1, Commit: 66c7820d7df527aaffabd2563a49ad57930999c9, ReleaseTagName: 20210120.1
10:49:35 AM {appname}: Build Operation ID: |q6PhxsZNBBU=.4557dcce_
10:49:35 AM {appname}: Repository Commit : 97958f16-5298-4f2a-849f-62059bf4b170
10:49:35 AM {appname}: Detecting platforms...
10:49:37 AM {appname}: Detected following platforms:
10:49:37 AM {appname}: python: 3.8.6
10:49:37 AM {appname}: Version '3.8.6' of platform 'python' is not installed. Generating script to install it...
10:49:37 AM {appname}: Source directory : /tmp/zipdeploy/extracted
10:49:37 AM {appname}: Destination directory: /home/site/wwwroot
10:49:37 AM {appname}: Downloading and extracting 'python' version '3.8.6' to '/tmp/oryx/platforms/python/3.8.6'...
10:49:38 AM {appname}: Downloaded in 1 sec(s).
10:49:38 AM {appname}: Verifying checksum...
10:49:39 AM {appname}: Extracting contents...
10:49:42 AM {appname}: Done in 5 sec(s).
10:49:42 AM {appname}: Python Version: /tmp/oryx/platforms/python/3.8.6/bin/python3.8
10:49:42 AM {appname}: Running pip install...
10:49:42 AM {appname}: [14:49:42+0000] Looking in links: https://download.pytorch.org/whl/torch_stable.html
10:49:44 AM {appname}: [14:49:44+0000] Collecting azure-functions
10:49:44 AM {appname}: [14:49:44+0000] Downloading azure_functions-1.14.0-py3-none-any.whl (165 kB)
10:49:44 AM {appname}: [14:49:44+0000] Collecting azure-functions-durable
10:49:44 AM {appname}: [14:49:44+0000] Downloading azure_functions_durable-1.2.3-py3-none-any.whl (224 kB)
10:49:45 AM {appname}: [14:49:45+0000] Collecting numpy==1.21.0
10:49:45 AM {appname}: [14:49:45+0000] Downloading numpy-1.21.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.7 MB)
10:49:46 AM {appname}: [14:49:46+0000] Collecting decorator==4.4.2
10:49:46 AM {appname}: [14:49:46+0000] Downloading decorator-4.4.2-py2.py3-none-any.whl (9.2 kB)
10:49:47 AM {appname}: [14:49:47+0000] Collecting pandas==1.1.5
10:49:47 AM {appname}: [14:49:47+0000] Downloading pandas-1.1.5-cp38-cp38-manylinux1_x86_64.whl (9.3 MB)
10:49:48 AM {appname}: [14:49:48+0000] Collecting opencv-python==4.6.0.66
10:49:48 AM {appname}: [14:49:48+0000] Downloading opencv_python-4.6.0.66-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (60.9 MB)
10:49:52 AM {appname}: [14:49:52+0000] Collecting librosa==0.8.0
10:49:52 AM {appname}: [14:49:52+0000] Downloading librosa-0.8.0.tar.gz (183 kB)
10:49:53 AM {appname}: [14:49:53+0000] Collecting scipy==1.5.4
10:49:53 AM {appname}: [14:49:53+0000] Downloading scipy-1.5.4-cp38-cp38-manylinux1_x86_64.whl (25.8 MB)
10:49:54 AM {appname}: [14:49:54+0000] Collecting torch==1.8.1+cpu
10:49:54 AM {appname}: [14:49:54+0000] Downloading https://download.pytorch.org/whl/cpu/torch-1.8.1%2Bcpu-cp38-cp38-linux_x86_64.whl (169.1 MB)
10:50:00 AM {appname}: [14:50:00+0000] Collecting torch-audiomentations==0.10.1
10:50:00 AM {appname}: [14:50:00+0000] Downloading torch_audiomentations-0.10.1-py3-none-any.whl (36 kB)
10:50:01 AM {appname}: [14:50:01+0000] Collecting torchaudio==0.8.1
10:50:01 AM {appname}: [14:50:01+0000] Downloading torchaudio-0.8.1-cp38-cp38-manylinux1_x86_64.whl (1.9 MB)
10:50:01 AM {appname}: [14:50:01+0000] Collecting torchvision==0.9.1+cpu
10:50:01 AM {appname}: [14:50:01+0000] Downloading https://download.pytorch.org/whl/cpu/torchvision-0.9.1%2Bcpu-cp38-cp38-linux_x86_64.whl (13.3 MB)
10:50:02 AM {appname}: [14:50:02+0000] Collecting moviepy==1.0.3
10:50:02 AM {appname}: [14:50:02+0000] Downloading moviepy-1.0.3.tar.gz (388 kB)
10:50:03 AM {appname}: [14:50:03+0000] Collecting lightgbm==3.3.2
10:50:03 AM {appname}: [14:50:03+0000] Downloading lightgbm-3.3.2-py3-none-manylinux1_x86_64.whl (2.0 MB)
10:50:03 AM {appname}: [14:50:03+0000] Collecting pyloudnorm==0.1.0
10:50:03 AM {appname}: [14:50:03+0000] Downloading pyloudnorm-0.1.0-py3-none-any.whl (9.3 kB)
10:50:04 AM {appname}: [14:50:04+0000] Collecting requests==2.*
10:50:04 AM {appname}: [14:50:04+0000] Downloading requests-2.31.0-py3-none-any.whl (62 kB)
10:50:04 AM {appname}: [14:50:04+0000] Collecting python-dateutil>=2.8.0
10:50:04 AM {appname}: [14:50:04+0000] Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
10:50:06 AM {appname}: [14:50:06+0000] Collecting aiohttp>=3.6.2
10:50:06 AM {appname}: [14:50:06+0000] Downloading aiohttp-3.8.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB)
10:50:06 AM {appname}: [14:50:06+0000] Collecting furl>=2.1.0
10:50:06 AM {appname}: [14:50:06+0000] Downloading furl-2.1.3-py2.py3-none-any.whl (20 kB)
10:50:07 AM {appname}: [14:50:07+0000] Collecting pytz>=2017.2
10:50:07 AM {appname}: [14:50:07+0000] Downloading pytz-2023.3-py2.py3-none-any.whl (502 kB)
10:50:07 AM {appname}: [14:50:07+0000] Collecting audioread>=2.0.0
10:50:07 AM {appname}: [14:50:07+0000] Downloading audioread-3.0.0.tar.gz (377 kB)
10:50:08 AM {appname}: [14:50:08+0000] Collecting scikit-learn!=0.19.0,>=0.14.0
10:50:08 AM {appname}: [14:50:08+0000] Downloading scikit_learn-1.2.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.8 MB)
10:50:09 AM {appname}: [14:50:09+0000] Collecting joblib>=0.14
10:50:09 AM {appname}: [14:50:09+0000] Downloading joblib-1.2.0-py3-none-any.whl (297 kB)
10:50:09 AM {appname}: [14:50:09+0000] Collecting resampy>=0.2.2
10:50:09 AM {appname}: [14:50:09+0000] Downloading resampy-0.4.2-py3-none-any.whl (3.1 MB)
10:50:10 AM {appname}: [14:50:10+0000] Collecting numba>=0.43.0
10:50:10 AM {appname}: [14:50:10+0000] Downloading numba-0.57.0-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.6 MB)
10:50:10 AM {appname}: [14:50:10+0000] Collecting soundfile>=0.9.0
10:50:10 AM {appname}: [14:50:10+0000] Downloading soundfile-0.12.1-py2.py3-none-any.whl (24 kB)
10:50:10 AM {appname}: [14:50:10+0000] Collecting pooch>=1.0
10:50:10 AM {appname}: [14:50:10+0000] Downloading pooch-1.7.0-py3-none-any.whl (60 kB)
10:50:11 AM {appname}: [14:50:11+0000] Collecting typing-extensions
10:50:11 AM {appname}: [14:50:11+0000] Downloading typing_extensions-4.6.3-py3-none-any.whl (31 kB)
10:50:11 AM {appname}: [14:50:11+0000] Collecting torch-pitch-shift>=1.2.0
10:50:11 AM {appname}: [14:50:11+0000] Downloading torch_pitch_shift-1.2.4-py3-none-any.whl (4.9 kB)
10:50:11 AM {appname}: [14:50:11+0000] Collecting julius<0.3,>=0.2.3
10:50:11 AM {appname}: [14:50:11+0000] Downloading julius-0.2.7.tar.gz (59 kB)
10:50:13 AM {appname}: [14:50:13+0000] Collecting pillow>=4.1.1
10:50:13 AM {appname}: [14:50:13+0000] Downloading Pillow-9.5.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB)
10:50:13 AM {appname}: [14:50:13+0000] Collecting tqdm<5.0,>=4.11.2
10:50:13 AM {appname}: [14:50:13+0000] Downloading tqdm-4.65.0-py3-none-any.whl (77 kB)
10:50:14 AM {appname}: [14:50:14+0000] Collecting proglog<=1.0.0
10:50:14 AM {appname}: [14:50:14+0000] Downloading proglog-0.1.10-py3-none-any.whl (6.1 kB)
10:50:14 AM {appname}: [14:50:14+0000] Collecting imageio<3.0,>=2.5
10:50:14 AM {appname}: [14:50:14+0000] Downloading imageio-2.31.1-py3-none-any.whl (313 kB)
10:50:14 AM {appname}: [14:50:14+0000] Collecting imageio_ffmpeg>=0.2.0
10:50:14 AM {appname}: [14:50:14+0000] Downloading imageio_ffmpeg-0.4.8-py3-none-manylinux2010_x86_64.whl (26.9 MB)
10:50:16 AM {appname}: [14:50:16+0000] Collecting wheel
10:50:16 AM {appname}: [14:50:16+0000] Downloading wheel-0.40.0-py3-none-any.whl (64 kB)
10:50:16 AM {appname}: [14:50:16+0000] Collecting future>=0.16.0
10:50:16 AM {appname}: [14:50:16+0000] Downloading future-0.18.3.tar.gz (840 kB)
10:50:17 AM {appname}: [14:50:17+0000] Collecting idna<4,>=2.5
10:50:17 AM {appname}: [14:50:17+0000] Downloading idna-3.4-py3-none-any.whl (61 kB)
10:50:17 AM {appname}: [14:50:17+0000] Collecting certifi>=2017.4.17
10:50:18 AM {appname}: [14:50:17+0000] Downloading certifi-2023.5.7-py3-none-any.whl (156 kB)
10:50:18 AM {appname}: [14:50:17+0000] Collecting urllib3<3,>=1.21.1
10:50:18 AM {appname}: [14:50:17+0000] Downloading urllib3-2.0.3-py3-none-any.whl (123 kB)
10:50:18 AM {appname}: [14:50:18+0000] Collecting charset-normalizer<4,>=2
10:50:18 AM {appname}: [14:50:18+0000] Downloading charset_normalizer-3.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (195 kB)
10:50:18 AM {appname}: [14:50:18+0000] Collecting six>=1.5
10:50:18 AM {appname}: [14:50:18+0000] Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
10:50:19 AM {appname}: [14:50:19+0000] Collecting attrs>=17.3.0
10:50:19 AM {appname}: [14:50:19+0000] Downloading attrs-23.1.0-py3-none-any.whl (61 kB)
10:50:19 AM {appname}: [14:50:19+0000] Collecting frozenlist>=1.1.1
10:50:19 AM {appname}: [14:50:19+0000] Downloading frozenlist-1.3.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (161 kB)
10:50:20 AM {appname}: [14:50:20+0000] Collecting multidict<7.0,>=4.5
10:50:20 AM {appname}: [14:50:20+0000] Downloading multidict-6.0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (121 kB)
10:50:21 AM {appname}: [14:50:21+0000] Collecting async-timeout<5.0,>=4.0.0a3
10:50:21 AM {appname}: [14:50:21+0000] Downloading async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
10:50:21 AM {appname}: [14:50:21+0000] Collecting yarl<2.0,>=1.0
10:50:21 AM {appname}: [14:50:21+0000] Downloading yarl-1.9.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (266 kB)
10:50:22 AM {appname}: [14:50:22+0000] Collecting aiosignal>=1.1.2
10:50:22 AM {appname}: [14:50:22+0000] Downloading aiosignal-1.3.1-py3-none-any.whl (7.6 kB)
10:50:22 AM {appname}: [14:50:22+0000] Collecting orderedmultidict>=1.0.1
10:50:22 AM {appname}: [14:50:22+0000] Downloading orderedmultidict-1.0.1-py2.py3-none-any.whl (11 kB)
10:50:22 AM {appname}: [14:50:22+0000] Collecting threadpoolctl>=2.0.0
10:50:22 AM {appname}: [14:50:22+0000] Downloading threadpoolctl-3.1.0-py3-none-any.whl (14 kB)
10:50:23 AM {appname}: [14:50:23+0000] Collecting llvmlite<0.41,>=0.40.0dev0
10:50:23 AM {appname}: [14:50:23+0000] Downloading llvmlite-0.40.1rc1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (42.1 MB)
10:50:25 AM {appname}: [14:50:25+0000] Collecting importlib-metadata; python_version < "3.9"
10:50:25 AM {appname}: [14:50:25+0000] Downloading importlib_metadata-6.6.0-py3-none-any.whl (22 kB)
10:50:26 AM {appname}: [14:50:26+0000] Collecting cffi>=1.0
10:50:26 AM {appname}: [14:50:26+0000] Downloading cffi-1.15.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (442 kB)
10:50:26 AM {appname}: [14:50:26+0000] Collecting packaging>=20.0
10:50:26 AM {appname}: [14:50:26+0000] Downloading packaging-23.1-py3-none-any.whl (48 kB)
10:50:26 AM {appname}: [14:50:26+0000] Collecting platformdirs>=2.5.0
10:50:26 AM {appname}: [14:50:26+0000] Downloading platformdirs-3.5.3-py3-none-any.whl (15 kB)
10:50:27 AM {appname}: [14:50:27+0000] Collecting primePy>=1.3
10:50:27 AM {appname}: [14:50:27+0000] Downloading primePy-1.3-py3-none-any.whl (4.0 kB)
10:50:27 AM {appname}: [14:50:27+0000] Collecting zipp>=0.5
10:50:27 AM {appname}: [14:50:27+0000] Downloading zipp-3.15.0-py3-none-any.whl (6.8 kB)
10:50:27 AM {appname}: [14:50:27+0000] Collecting pycparser
10:50:27 AM {appname}: [14:50:27+0000] Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
10:50:27 AM {appname}: [14:50:27+0000] Building wheels for collected packages: librosa, moviepy, audioread, julius, future
10:50:27 AM {appname}: [14:50:27+0000] Building wheel for librosa (setup.py): started
10:50:28 AM {appname}: [14:50:28+0000] Building wheel for librosa (setup.py): finished with status 'done'
10:50:28 AM {appname}: [14:50:28+0000] Created wheel for librosa: filename=librosa-0.8.0-py3-none-any.whl size=201379 sha256=384532a466ebf3a5ed4379789174c7b1274e1aee3bde96ce1194df17e8983c47
10:50:28 AM {appname}: [14:50:28+0000] Stored in directory: /usr/local/share/pip-cache/wheels/aa/5a/92/d52f6f8560ff05a2525e6030a1903412df876714241fb76802
10:50:28 AM {appname}: [14:50:28+0000] Building wheel for moviepy (setup.py): started
10:50:29 AM {appname}: [14:50:29+0000] Building wheel for moviepy (setup.py): finished with status 'done'
10:50:29 AM {appname}: [14:50:29+0000] Created wheel for moviepy: filename=moviepy-1.0.3-py3-none-any.whl size=110728 sha256=6e0f257ca1d6fec103deecf5c5198aed27ad4d3e57d7e1de2e0947f1c88637f7
10:50:29 AM {appname}: [14:50:29+0000] Stored in directory: /usr/local/share/pip-cache/wheels/e4/a4/db/0368d3a04033da662e13926594b3a8cf1aa4ffeefe570cfac1
10:50:29 AM {appname}: [14:50:29+0000] Building wheel for audioread (setup.py): started
10:50:29 AM {appname}: [14:50:29+0000] Building wheel for audioread (setup.py): finished with status 'done'
10:50:29 AM {appname}: [14:50:29+0000] Created wheel for audioread: filename=audioread-3.0.0-py3-none-any.whl size=23703 sha256=c53ea185db39d9ab46618d6aa9af9f843298368f7e4d98be735fee3d205d8d9e
10:50:29 AM {appname}: [14:50:29+0000] Stored in directory: /usr/local/share/pip-cache/wheels/0a/ed/be/49df2538fca496690a024a4374455584d65c2afd6fc3d6e9c7
10:50:29 AM {appname}: [14:50:29+0000] Building wheel for julius (setup.py): started
10:50:30 AM {appname}: [14:50:30+0000] Building wheel for julius (setup.py): finished with status 'done'
10:50:30 AM {appname}: [14:50:30+0000] Created wheel for julius: filename=julius-0.2.7-py3-none-any.whl size=21878 sha256=e5957ca9ef0c5a0aa12c7755732ba1aa55151a6c11594d99f3f0741c2fa70fe3
10:50:30 AM {appname}: [14:50:30+0000] Stored in directory: /usr/local/share/pip-cache/wheels/85/89/4f/88596b58a42ee452100fe1cd6ac31265bb192e597cf85908da
10:50:30 AM {appname}: [14:50:30+0000] Building wheel for future (setup.py): started
10:50:30 AM {appname}: [14:50:30+0000] Building wheel for future (setup.py): finished with status 'done'
10:50:30 AM {appname}: [14:50:30+0000] Created wheel for future: filename=future-0.18.3-py3-none-any.whl size=492025 sha256=6e96441d2a15fe2888fde243b4fa8c52a2f09283e1af1fff129971778fcb0fff
10:50:30 AM {appname}: [14:50:30+0000] Stored in directory: /usr/local/share/pip-cache/wheels/a0/0b/ee/e6994fadb42c1354dcccb139b0bf2795271bddfe6253ccdf11
10:50:30 AM {appname}: [14:50:30+0000] Successfully built librosa moviepy audioread julius future
10:50:31 AM {appname}: [14:50:31+0000] Installing collected packages: azure-functions, idna, certifi, urllib3, charset-normalizer, requests, six, python-dateutil, attrs, frozenlist, multidict, async-timeout, yarl, aiosignal, aiohttp, orderedmultidict, furl, azure-functions-durable, numpy, decorator, pytz, pandas, opencv-python, audioread, scipy, joblib, threadpoolctl, scikit-learn, llvmlite, zipp, importlib-metadata, numba, resampy, pycparser, cffi, soundfile, packaging, platformdirs, pooch, librosa, typing-extensions, torch, torchaudio, primePy, torch-pitch-shift, julius, torch-audiomentations, pillow, torchvision, tqdm, proglog, imageio, imageio-ffmpeg, moviepy, wheel, lightgbm, future, pyloudnorm
10:51:15 AM {appname}: [14:51:15+0000] Successfully installed aiohttp-3.8.4 aiosignal-1.3.1 async-timeout-4.0.2 attrs-23.1.0 audioread-3.0.0 azure-functions-1.14.0 azure-functions-durable-1.2.3 certifi-2023.5.7 cffi-1.15.1 charset-normalizer-3.1.0 decorator-4.4.2 frozenlist-1.3.3 furl-2.1.3 future-0.18.3 idna-3.4 imageio-2.31.1 imageio-ffmpeg-0.4.8 importlib-metadata-6.6.0 joblib-1.2.0 julius-0.2.7 librosa-0.8.0 lightgbm-3.3.2 llvmlite-0.40.1rc1 moviepy-1.0.3 multidict-6.0.4 numba-0.57.0 numpy-1.21.0 opencv-python-4.6.0.66 orderedmultidict-1.0.1 packaging-23.1 pandas-1.1.5 pillow-9.5.0 platformdirs-3.5.3 pooch-1.7.0 primePy-1.3 proglog-0.1.10 pycparser-2.21 pyloudnorm-0.1.0 python-dateutil-2.8.2 pytz-2023.3 requests-2.31.0 resampy-0.4.2 scikit-learn-1.2.2 scipy-1.5.4 six-1.16.0 soundfile-0.12.1 threadpoolctl-3.1.0 torch-1.8.1+cpu torch-audiomentations-0.10.1 torch-pitch-shift-1.2.4 torchaudio-0.8.1 torchvision-0.9.1+cpu tqdm-4.65.0 typing-extensions-4.6.3 urllib3-2.0.3 wheel-0.40.0 yarl-1.9.2 zipp-3.15.0
10:51:16 AM {appname}: WARNING: You are using pip version 20.2.3; however, version 23.1.2 is available.
10:51:16 AM {appname}: You should consider upgrading via the '/tmp/oryx/platforms/python/3.8.6/bin/python3.8 -m pip install --upgrade pip' command.
10:51:17 AM {appname}: Done in 95 sec(s).
10:51:17 AM {appname}: Preparing output...
10:51:17 AM {appname}: Copying files to destination directory '/home/site/wwwroot'...
10:52:33 AM {appname}: Done in 76 sec(s).
10:52:33 AM {appname}: Removing existing manifest file
10:52:33 AM {appname}: Creating a manifest file...
10:52:33 AM {appname}: Manifest file created.
10:52:33 AM {appname}: Done in 176 sec(s).
10:52:35 AM {appname}: Running post deployment command(s)...
10:52:35 AM {appname}: Generating summary of Oryx build
10:52:35 AM {appname}: Deployment Log file does not exist in /tmp/oryx-build.log
10:52:35 AM {appname}: The logfile at /tmp/oryx-build.log is empty. Unable to fetch the summary of build
10:52:35 AM {appname}: Triggering recycle (preview mode disabled).
10:52:35 AM {appname}: Linux Consumption plan has a 1.5 GB memory limit on a remote build container.
10:52:35 AM {appname}: To check our service limit, please visit https://docs.microsoft.com/en-us/azure/azure-functions/functions-scale#service-limits
10:52:35 AM {appname}: Writing the artifacts to a squashfs file
10:52:42 AM {appname}: Parallel mksquashfs: Using 1 processor
10:52:43 AM {appname}: Creating 4.0 filesystem on /home/site/artifacts/functionappartifact.squashfs, block size 131072.
10:52:46 AM {appname}: [==/ ] 1100/24258 4%
10:53:08 AM {appname}: [===| ] 1300/24258 5%
10:53:16 AM {appname}: [==========- ] 4200/24258 17%
10:54:54 AM {appname}: [============- ] 5000/24258 20%
10:55:19 AM {appname}: [==============================================/ ] 19000/24258 78%
10:55:27 AM {appname}: [==================================================- ] 20600/24258 84%
10:55:35 AM {appname}: [==================================================- ] 20900/24258 86%
10:55:50 AM {appname}: [===================================================- ] 21300/24258 87%
10:56:00 AM {appname}: [======================================================\ ] 22500/24258 92%
10:56:10 AM {appname}: [=======================================================/ ] 22900/24258 94%
10:56:12 AM {appname}: [=========================================================\ ] 23800/24258 98%
10:56:12 AM {appname}: [===========================================================-] 24258/24258 100%
10:56:12 AM {appname}: Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 131072
10:56:12 AM {appname}: compressed data, compressed metadata, compressed fragments, compressed xattrs
10:56:12 AM {appname}: duplicates are removed
10:56:12 AM {appname}: Filesystem size 405573.23 Kbytes (396.07 Mbytes)
10:56:12 AM {appname}: 31.39% of uncompressed filesystem size (1292102.18 Kbytes)
10:56:12 AM {appname}: Inode table size 187403 bytes (183.01 Kbytes)
10:56:12 AM {appname}: 31.40% of uncompressed inode table size (596847 bytes)
10:56:12 AM {appname}: Directory table size 179664 bytes (175.45 Kbytes)
10:56:12 AM {appname}: 36.69% of uncompressed directory table size (489701 bytes)
10:56:12 AM {appname}: Number of duplicate files found 718
10:56:12 AM {appname}: Number of inodes 17491
10:56:12 AM {appname}: Number of files 15879
10:56:12 AM {appname}: Number of fragments 1347
10:56:12 AM {appname}: Number of symbolic links 0
10:56:12 AM {appname}: Number of device nodes 0
10:56:12 AM {appname}: Number of fifo nodes 0
10:56:12 AM {appname}: Number of socket nodes 0
10:56:12 AM {appname}: Number of directories 1612
10:56:12 AM {appname}: Number of ids (unique uids + gids) 1
10:56:12 AM {appname}: Number of uids 1
10:56:12 AM {appname}: root (0)
10:56:12 AM {appname}: Number of gids 1
10:56:12 AM {appname}: root (0)
10:56:12 AM {appname}: Creating placeholder blob for linux consumption function app...
10:56:12 AM {appname}: SCM_RUN_FROM_PACKAGE placeholder blob scm-latest-{appname}.zip located
10:56:12 AM {appname}: Uploading built content /home/site/artifacts/functionappartifact.squashfs for linux consumption function app...
10:56:31 AM {appname}: Resetting all workers for {appname}.azurewebsites.net
10:56:31 AM {appname}: Deployment successful. deployer = ms-azuretools-vscode deploymentPath = Functions App ZipDeploy. Extract zip. Remote build.
10:56:44 AM {appname}: Syncing triggers...
10:57:00 AM {appname}: Querying triggers...
10:57:01 AM {appname}: No HTTP triggers found.
Upvotes: 1
Views: 1917
Reputation: 31
I had a similar problem, and what worked for me was to make sure that the requirements were installing in the correct folder. Like so:
pip install --target='./FunctionApp1/.python_packages/lib/site-packages' -r ./FunctionApp1/requirements.txt
I added this to the pipeline and all the functions became visible again in the Azure portal.
Upvotes: 0
Reputation: 77
I think, I get the error when my local.settings.json
file is not correct (or missing). To run locally, you need this file, and the AzureWebJobsStorage
key should have a working connection string to a storage account.
You can run the following command to sync the file locally:
func azure functionapp fetch-app-settings YOURFUNCTIONAPPNAME
(I assume you use the azure function core tools)
Upvotes: 0
Reputation: 8167
I tried to resolve the error and got the results below:-
My function_app.py:-
import logging
import azure.functions as func
import numpy as np
import pandas as pd
import cv2
import librosa
import torch
import torchaudio
import torch_audiomentations
import torchvision
from azure.functions import HttpRequest
app = func.FunctionApp(http_auth_level=func.AuthLevel.FUNCTION)
@app.route(route="HttpTrigger")
def HttpTrigger(req: func.HttpRequest) -> func.HttpResponse:
logging.info('Python HTTP trigger function processed a request.')
#code block with imported packages
arr = np.array([1, 2, 3])
df = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})
image = cv2.imread('Screenshot (1).png')
audio_data, sample_rate = librosa.load('sample.wav.mp3')
tensor = torch.tensor([1, 2, 3])
transformed_tensor = torch_audiomentations.PitchShift(sample_rate=sample_rate, p=1.0)
torchvision.transforms.ToTensor()(image)
name = req.params.get('name')
if not name:
try:
req_body = req.get_json()
except ValueError:
pass
else:
name = req_body.get('name')
if name:
return func.HttpResponse(f"Hello, {name}. This HTTP triggered function executed successfully.")
else:
return func.HttpResponse(
"This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response.",
status_code=200
)
Output:-
When I use arr and the whole code block with imported packages outside the @app.route, I received the same error code:-
My requirements.txt:-
I did not explicitly specify any package version and just left the packages as it is:-
numpy
pandas
opencv-python-headless
librosa
torch
torchaudio
torch-audiomentations
torchvision
azure-functions
I tried deploying the Above Function to my Python function app and it failed, As the size of torch package exceeded the deployment limitations of Consumption plan based Functions. Thus, you can either remove all torch packages from your requirements.txt and perform the deployment again , As Consumption plan can only have 1.5 gb of files and packages deployed in it. Or create a dedicated function app and run the deployment again.
I deployed the above function in Consumption based plan and the function was not visible, But the Files were deployed, Refer below:-
Make sure you add AzureWebJobsFeatureFlags:EnableWorkerIndexing settings in Azure Function Configuration app as referred from this SO thread answer
Upvotes: 0