Open eighttails opened 5 years ago
you could always create a layer with pytorch. There's an example here: https://github.com/mattmcclean/sam-pytorch-example and see if that works.
Hi, just to state that I hit the same issue today which led me here. I was able to work around by duplicating one of the packages I was bundling up into the requirements.txt but it caused me confusion for a while. I notice that the "aws cloudformation package" command seems to keep these files, not sure if this is relevant at all....
Same issue for linux libraries *.so
files which was omitted with sam build
, I wonder if there is a way to do this without using layers.
I am having the same issue with a custom extension I created. No *.so files are copied into the build folder. I know this used to work as I build an application that packaged lxml. I can't use layers for this at the moment due to our build pipeline.
Lambda builders explicitly exclude .so
files which was configured here; https://github.com/aws/aws-lambda-builders/blob/develop/aws_lambda_builders/workflows/python_pip/workflow.py#L33
You can use custom makefile builds to fix this issue, which was explained here: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/building-custom-runtimes.html
Description
I want to deploy pytorch library with my Lambda function. Official pytorch library in pip repository is too large to bundle with Lambda. So I try to use this one https://github.com/ryfeus/lambda-packs/tree/master/pytorch which is not available via pip. I extracted pytorch libs to Lambda function dir and did
sam build
but deployed package seems not contain cpython native libraries.Steps to reproduce
The following script demonstrates the issue.
./torch/_dl.cpython-36m-x86_64-linux-gnu.so and ./torch/_C.cpython-36m-x86_64-linux-gnu.so in source.txt are necessary to import pytorch but they are not contained in dest.txt(built package). So
import torch
in Lambda function makes error.While
.aws-sam/build/HelloWorldFunction/psycopg2/_psycopg.cpython-36m-x86_64-linux-gnu.so
installed via requirements.txt is correctly contained in the package.Observed result
Expected result
All cpython DLLs are contained in deploy package.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
:SAM CLI, version 0.11.0Add --debug flag to command you are running