Can you post the pex file you get from running `./...
# general
Can you post the pex file you get from running
./pants binary
, and also your BUILD file
@happy-kitchen-89482 is this okay? uploaded to git
That's good, but I also need the pex from your
okay. will upload that too.
I think I see the problem
you're uploading
That's the non-lambda-ified pex
is the result of applying lambdex to
that's the one you want to upload
Also, you mentioned that your command is
pants binary :hello-lambda
, does that mean your code is in the root of the repo? I can imagine that not working
If I run
./pants binary contrib/awslambda/python/src/python/pants/contrib/awslambda/python/examples:hello-lambda
in the pants repo, I get a valid lambda
So try uploading
and not
, and if that doesn't work, also try moving the code under some subdir, like
Will check.
@happy-kitchen-89482 it wasn't generating hello-lambda.pex if I use the goal as
but works if I use
tested with
lambdex test
and it works but still when I upload it as zip to lambda service, it throws the same error which I mentioned before
@happy-kitchen-89482 I was able to make it work by deploying the pex without zipping
have you faced this issue before? zipping and uploading the pex is not working.
Ah, yes, I missed that detail. The thing you need to run on the cmd line is
pants bundle <target>
. There is an unfortunate historical distinction between
that we may want to get rid of.
And you are supposed to upload the pex itself, you do not need to zip it. A pex is just a zip file with some header magic and a .pex extension.
What instructions were you following? Clearly I need to update them and clarify them.
I couldn't find any instruction, was just looking at pants code and lambdex code.
moreover, because of aws lambda size limitation I have to upload the pex file to s3 and get the link and share it to aws lambda. but if I do that It says
unzipped files should not exceed 269 mb
, eventhough the pex is just 100 mb. any reason for this?
is it trying to unzip it and telling me that the size is above 269 mb?
@happy-kitchen-89482 any follow up?
It sounds like you have this ~working? All you should need to do is
./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: 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.