happy-kitchen-89482
08/22/2019, 5:04 PM./pants binary
, and also your BUILD filebrave-policeman-49804
08/22/2019, 5:11 PM<https://github.com/reaganrewop/lambda_pex>
happy-kitchen-89482
08/22/2019, 5:12 PMdist
dirbrave-policeman-49804
08/22/2019, 5:12 PMbrave-policeman-49804
08/22/2019, 5:16 PMhappy-kitchen-89482
08/22/2019, 7:30 PMhappy-kitchen-89482
08/22/2019, 7:30 PMhello-bin.pex
?happy-kitchen-89482
08/22/2019, 7:30 PMhappy-kitchen-89482
08/22/2019, 7:31 PMhello-lambda.pex
is the result of applying lambdex to hello-bin.pex
happy-kitchen-89482
08/22/2019, 7:31 PMhappy-kitchen-89482
08/22/2019, 7:32 PMpants binary :hello-lambda
, does that mean your code is in the root of the repo? I can imagine that not workinghappy-kitchen-89482
08/22/2019, 7:32 PM./pants binary contrib/awslambda/python/src/python/pants/contrib/awslambda/python/examples:hello-lambda
in the pants repo, I get a valid lambdahappy-kitchen-89482
08/22/2019, 7:33 PMhello-lambda.pex
and not hello-bin.pex
, and if that doesn't work, also try moving the code under some subdir, like src/python/hello
brave-policeman-49804
08/23/2019, 5:24 AMbrave-policeman-49804
08/23/2019, 7:04 AMbinary
but works if I use bundle
.brave-policeman-49804
08/23/2019, 7:05 AMlambdex test
and it works but still when I upload it as zip to lambda service, it throws the same error which I mentioned beforebrave-policeman-49804
08/23/2019, 7:13 AMbrave-policeman-49804
08/23/2019, 10:04 AMhappy-kitchen-89482
08/23/2019, 3:43 PMpants bundle <target>
. There is an unfortunate historical distinction between binary
and bundle
that we may want to get rid of.happy-kitchen-89482
08/23/2019, 3:44 PMhappy-kitchen-89482
08/23/2019, 3:44 PMbrave-policeman-49804
08/23/2019, 4:08 PMbrave-policeman-49804
08/23/2019, 4:09 PMunzipped files should not exceed 269 mb
, eventhough the pex is just 100 mb. any reason for this?brave-policeman-49804
08/23/2019, 4:10 PMbrave-policeman-49804
08/25/2019, 3:47 PMhappy-kitchen-89482
08/25/2019, 7:39 PM./pants bundle path/to/python_awslambda_target
, and then upload the resulting lambda pex to s3 the way you would any other lambda.
According to this: https://docs.aws.amazon.com/lambda/latest/dg/limits.html you are limited to a 50MB zipped/250MB unzipped pex size. An 100MB pex is pretty huge, are you using many large 3rdparty dependencies? Are you pulling in deps you may not actually need? The pex overhead is ~500K compressed, so that shouldn't be an issue. Your next step should probably be to figure out why your resulting bundle is so huge.