Home > database >  Azure: How to deploy a functions app with tensorflow
Azure: How to deploy a functions app with tensorflow

Time:09-13

I am trying to deploy the TensorFlow sample from Microsoft to azure (it works locally). The only change I made is to TensorFlow version in the requirements.txt. Instead of specifying a version I left it blank because errors appeared:

ERROR: Could not find a version that satisfies the requirement tensorflow==1.14 (from -r requirements.txt (line 4)) (from versions: 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0rc0, 2.6.0rc1, 2.6.0rc2, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.7.0rc0, 2.7.0rc1, 2.7.0, 2.7.1, 2.7.2, 2.7.3, 2.7.4, 2.8.0rc0, 2.8.0rc1, 2.8.0, 2.8.1, 2.8.2, 2.8.3, 2.9.0rc0, 2.9.0rc1, 2.9.0rc2, 2.9.0, 2.9.1, 2.9.2, 2.10.0rc0, 2.10.0rc1, 2.10.0rc2, 2.10.0rc3, 2.10.0)

azure-functions
#tensorflow==1.14
tensorflow
Pillow
requests

The deployment is unsuccessful as soon as the TensorFlow requirement is added:

01:06:17 Test19542413: Starting deployment...
01:06:19 Test19542413: Creating zip package...
01:06:20 Test19542413: Zip package size: 4.69 MB
01:06:24 Test19542413: Updating submodules.
01:06:25 Test19542413: Preparing deployment for commit id 'b2f177b6-7'.
01:06:25 Test19542413: PreDeployment: context.CleanOutputPath False
01:06:25 Test19542413: PreDeployment: context.OutputPath /home/site/wwwroot
01:06:25 Test19542413: Repository path is /tmp/zipdeploy/extracted
01:06:25 Test19542413: Running oryx build...
01:06:25 Test19542413: Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.9.7 -p packagedir=.python_packages/lib/site-packages
01:06:27 Test19542413: Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
01:06:27 Test19542413: You can report issues at https://github.com/Microsoft/Oryx/issues
01:06:27 Test19542413: Oryx Version: 0.2.20210120.1, Commit: 66c7820d7df527aaffabd2563a49ad57930999c9, ReleaseTagName: 20210120.1
01:06:27 Test19542413: Build Operation ID: |F eWRyTKD/s=.b5e2f596_
01:06:27 Test19542413: Repository Commit : b2f177b6-7c7f-4747-bc49-052de459bfcb
01:06:27 Test19542413: Detecting platforms...
01:06:27 Test19542413: Detected following platforms:
01:06:27 Test19542413:   python: 3.9.7
01:06:28 Test19542413: Source directory     : /tmp/zipdeploy/extracted
01:06:28 Test19542413: Destination directory: /home/site/wwwroot
01:06:28 Test19542413: Python Version: /tmp/oryx/platforms/python/3.9.7/bin/python3.9
01:06:28 Test19542413: Running pip install...
01:06:29 Test19542413: [23:06:29 0000] Collecting azure-functions
01:06:29 Test19542413: [23:06:29 0000]   Using cached azure_functions-1.11.2-py3-none-any.whl (206 kB)
01:06:29 Test19542413: [23:06:29 0000] Collecting tensorflow
01:06:29 Test19542413: [23:06:29 0000]   Downloading tensorflow-2.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (578.1 MB)
01:06:40 Test19542413: Done in 12 sec(s).
01:06:42 Test19542413: /opt/Kudu/Scripts/starter.sh oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.9.7 -p packagedir=.python_packages/lib/site-packages
01:06:42 Test19542413: Generating summary of Oryx build
01:06:42 Test19542413: Deployment Log file does not exist in /tmp/oryx-build.log
01:06:42 Test19542413: The logfile at /tmp/oryx-build.log is empty. Unable to fetch the summary of build
01:06:42 Test19542413: Deployment Failed. deployer = Push-Deployer deploymentPath = Functions App ZipDeploy. Extract zip. Remote build.
01:06:46 Test19542413: Deployment failed.

Unfortunately, the error message is not giving me any hint on how to solve this issue. Do you have any idea? I used the integrated tools in VS Code to perform the publish. Using the CLI, I get the same result tho:

>>> func azure functionapp publish Test19542413

Getting site publishing info...
Creating archive for current directory...
Performing remote build for functions project.
Deleting the old .python_packages directory
Uploading 4,47 MB [###############################################################################]
Remote build in progress, please wait...
Updating submodules.
Preparing deployment for commit id '5eec9b3a-6'.
PreDeployment: context.CleanOutputPath False
PreDeployment: context.OutputPath /home/site/wwwroot
Repository path is /tmp/zipdeploy/extracted
Running oryx build...
Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.9.7 -p packagedir=.python_packages/lib/site-packages
Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
You can report issues at https://github.com/Microsoft/Oryx/issues

Oryx Version: 0.2.20210120.1, Commit: 66c7820d7df527aaffabd2563a49ad57930999c9, ReleaseTagName: 20210120.1

Build Operation ID: |RM3MxQKeUzo=.1973e39e_
Repository Commit : 5eec9b3a-6c81-4f46-a4af-1989f39a3d6e

Detecting platforms...
Detected following platforms:
  python: 3.9.7


Source directory     : /tmp/zipdeploy/extracted
Destination directory: /home/site/wwwroot

Python Version: /tmp/oryx/platforms/python/3.9.7/bin/python3.9

Running pip install...
[13:04:20 0000] Collecting azure-functions
[13:04:20 0000]   Using cached azure_functions-1.11.2-py3-none-any.whl (206 kB)
[13:04:20 0000] Collecting tensorflow
[13:04:20 0000]   Downloading tensorflow-2.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (578.1 MB)
Done in 12 sec(s).
\n/opt/Kudu/Scripts/starter.sh oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.9.7 -p packagedir=.python_packages/lib/site-packages

Generating summary of Oryx build
Deployment Log file does not exist in /tmp/oryx-build.log
The logfile at /tmp/oryx-build.log is empty. Unable to fetch the summary of build
Deployment Failed. deployer = Push-Deployer deploymentPath = Functions App ZipDeploy. Extract zip. Remote build.
Remote build failed!

CodePudding user response:

you need to specify tensorflow 2.8, that fixed the problem for me. in the function requirements.txt file put "tensorflow==2.8.0" instead of just "tensorflow"

  • Related