daily-co / daily-python

Daily Client SDK for Python
BSD 2-Clause "Simplified" License
38 stars 7 forks source link

how to deploy into AWS Lambda function #25

Open weedge opened 1 month ago

weedge commented 1 month ago

from: https://www.daily.co/blog/introducing-daily-python-an-sdk-for-ai-powered-interactive-video-and-audio/ Python is a ubiquitous language and is a de facto standard for Al and machine learning development. daily-python code runs equally well on a Microsoft Azure VM, a Cerebrium application, an AWS Lambda function, your desktop machine, popular loT platforms, and even in a colab notebook.

use sam build --debug info:

2024-08-14 14:57:28,279 | PythonPipBuilder:ResolveDependencies failed
Traceback (most recent call last):
  File "/usr/local/Cellar/aws-sam-cli/1.97.0/libexec/lib/python3.8/site-packages/aws_lambda_builders/workflows/python_pip/actions.py", line 51, in execute
    package_builder.build_dependencies(
  File "/usr/local/Cellar/aws-sam-cli/1.97.0/libexec/lib/python3.8/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 158, in build_dependencies
    self._dependency_builder.build_site_packages(requirements_path, artifacts_dir_path, scratch_dir_path)
  File "/usr/local/Cellar/aws-sam-cli/1.97.0/libexec/lib/python3.8/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 261, in build_site_packages
    raise MissingDependencyError(packages_without_wheels)
aws_lambda_builders.workflows.python_pip.packager.MissingDependencyError: {daily-python==0.10.1(wheel)}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/Cellar/aws-sam-cli/1.97.0/libexec/lib/python3.8/site-packages/aws_lambda_builders/workflow.py", line 371, in run
    action.execute()
  File "/usr/local/Cellar/aws-sam-cli/1.97.0/libexec/lib/python3.8/site-packages/aws_lambda_builders/workflows/python_pip/actions.py", line 57, in execute
    raise ActionFailedError(str(ex))
aws_lambda_builders.actions.ActionFailedError: {daily-python==0.10.1(wheel)}
weedge commented 3 weeks ago

use public.ecr.aws/sam/build-python3.11:latest-x86_64 docker to CI

sh-4.2# uname -a
Linux 85e124769e9e 6.6.16-linuxkit #1 SMP PREEMPT_DYNAMIC Fri Feb 16 11:55:08 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

but pip install daily-python no version to match

sh-4.2# pip install daily-python
ERROR: Could not find a version that satisfies the requirement daily-python (from versions: none)
ERROR: No matching distribution found for daily-python

use linux x86 whl don't match

sh-4.2# pip install /tmp/daily_python-0.10.1-cp37-abi3-manylinux_2_28_x86_64.whl 
ERROR: daily_python-0.10.1-cp37-abi3-manylinux_2_28_x86_64.whl is not a supported wheel on this platform.
aconchillo commented 5 days ago

The reason is because this is based on RedHat 7.3 which ships with glibc 2.26. daily-python needs glib >= 2.28.