amazon-transcribe-streaming-sdk icon indicating copy to clipboard operation
amazon-transcribe-streaming-sdk copied to clipboard

Unable to deploy to AWS Lambda

Open etozzato opened this issue 4 years ago • 7 comments

The SDK is very promising! The local prototype works like a charm.

However, I haven’t been able to deploy to AWS lambda. When the handler is loaded, an error about the undefined module _awscrt terminates the execution.

I’ve installed transcribe as a dependency, Python 3.8 locally and on the lambda.

Perhaps the binary must be added as a layer?

etozzato avatar Nov 29 '20 00:11 etozzato

Hi, I had a similar issue while deploying to Lambda.

I used this link to download the awscrt-0.6.1-cp38-cp38-manylinux2014_x86_64.whl file. Unzipped it and packaged within a ZIP file along with the lambda_function.py file to upload onto the AWS console Lambda function.

I do like the idea of having it as a Layer though!

Hope this helps.

cheers!

vrbros avatar Nov 30 '20 00:11 vrbros

Hi etozzato,

Sorry my question is not related with your issue. You said "The local prototype works like a charm", Did you test the streaming for audio that have a long duration 30 minutes or 1 hour? If yes is it working until end of audio? I have an issue_here and really want to know if anyone have the same?

bangnguyen avatar Nov 30 '20 04:11 bangnguyen

@vrbos Is on the right track, you'll need to include the wheel compiled for the appropriate platform. This help page has some more information on including native dependencies in python here:

https://aws.amazon.com/premiumsupport/knowledge-center/lambda-python-package-compatible/

We should update the readme/docs to include a note about lambda usage.

joguSD avatar Dec 01 '20 22:12 joguSD

Thank you for your participation in this issue!

Thank you @vrbros/ @joguSD we shall try to deploy the complied awscrt along with the rest of the lambda, we were on the right track, but python is completely new territory for us and we ended up implementing the transcribe functionality in Ruby and invoke that single responsibility lambda from the "main" lambda... Not optimal, but it ended up working for our small, 100k attendee event with five channels;

@bangnguyen I can't answer that, as we're extractig audio from HLS video segments and they are small (±300kb) files

etozzato avatar Dec 10 '20 14:12 etozzato

I might try this again during holidays and open a PR to update the documentation!

etozzato avatar Dec 10 '20 14:12 etozzato

@vrbos Is on the right track, you'll need to include the wheel compiled for the appropriate platform. This help page has some more information on including native dependencies in python here:

https://aws.amazon.com/premiumsupport/knowledge-center/lambda-python-package-compatible/

We should update the readme/docs to include a note about lambda usage.

Does this mean there is no way to include this in the lambda layer? I've been bugging my head the whole day :disappointed:

ReyanshKharga avatar Apr 17 '21 11:04 ReyanshKharga

Hi @vrbros I used your method but couldn't make it work. Please look at the image below:

https://ibb.co/RP4zDfn

ReyanshKharga avatar Apr 17 '21 12:04 ReyanshKharga