refined-addition-53644
11/30/2022, 2:41 PM/function/service.pex/.bootstrap/pex/variables.py:582: PEXWarning: PEX_ROOT is configured as /pex_root but that path is un-writeable, falling back to a temporary PEX_ROOT of /tmp/tmpxcb25rwu which will hurt performance.
refined-addition-53644
11/30/2022, 2:42 PMbillions-keyboard-33102
11/30/2022, 2:47 PMPEX_ROOT=/tmp/.pex
refined-addition-53644
11/30/2022, 3:00 PMenough-analyst-54434
11/30/2022, 3:00 PM--runtime-pex-root
on the Pex CLI or setting that env var somewhere, in the docker image using ENV instructions or in the lambda config as @billions-keyboard-33102 suggests. There are no other ways I'm aware of. How did you try to configure this @refined-addition-53644?refined-addition-53644
11/30/2022, 3:00 PMENV PEX_ROOT=/pex_root
enough-analyst-54434
11/30/2022, 3:01 PMrefined-addition-53644
11/30/2022, 3:01 PM/tmp/.pex
as suggested by Jake.enough-analyst-54434
11/30/2022, 3:02 PMrefined-addition-53644
11/30/2022, 3:02 PMenough-analyst-54434
11/30/2022, 3:02 PMenough-analyst-54434
11/30/2022, 3:02 PMenough-analyst-54434
11/30/2022, 3:03 PMrefined-addition-53644
11/30/2022, 3:03 PMenough-analyst-54434
11/30/2022, 3:03 PMenough-analyst-54434
11/30/2022, 3:04 PMrefined-addition-53644
11/30/2022, 3:05 PM/tmp
directory with between 512 MB and 10,240 MB, in 1-MB increments, of storage.
• The default Lambda user must be able to read all the files required to run your function code. Lambda follows security best practices by defining a default Linux user with least-privileged permissions. Verify that your application code does not rely on files that other Linux users are restricted from running.
I don’t know how to fetch this default Lambda user.
https://docs.aws.amazon.com/lambda/latest/dg/images-create.htmlenough-analyst-54434
11/30/2022, 3:05 PMenough-analyst-54434
11/30/2022, 3:06 PMenough-analyst-54434
11/30/2022, 7:26 PMrefined-addition-53644
11/30/2022, 8:13 PMenough-analyst-54434
12/01/2022, 4:05 PMbillions-keyboard-33102
12/06/2022, 5:19 PMPEX_INHERIT_PATH=fallback
- I couldn’t remove the /var/runtime
from the python path 😞
https://pex.readthedocs.io/en/latest/api/vars.html#PEX_INHERIT_PATHenough-analyst-54434
12/06/2022, 5:47 PMsys.path
? If its the latter, I think you can, you just don't use - I forget the terminology exactly - the standard AWS Lambda executor. They have an API to plug that.enough-analyst-54434
12/06/2022, 5:48 PMenough-analyst-54434
12/06/2022, 5:50 PM-D <dir>
where that dir includes an executable bootstrap
file meeting their specs. If that proves difficult, perhaps a feature can be added to ... Pants I think, to do that for you. This feels 1 level higher than Pex, Pants knows AWS Lambda, Pex does not - currently.billions-keyboard-33102
12/06/2022, 5:58 PMenough-analyst-54434
12/06/2022, 6:17 PMpex_binary
instead. That supports PEX_INHERIT_PATH
config (https://www.pantsbuild.org/docs/reference-pex_binary#codeinherit_pathcode). You really only need python_awslambda
for the lambda zip deployment scheme and even that is only historically true. You can now use a plain old PEX (pex_binary
again) for that too; you just prefix your lambda entry point configuration value out in AWS with __pex__.
to make PEX files as lambda zips work.billions-keyboard-33102
12/06/2022, 6:30 PMenough-analyst-54434
12/06/2022, 6:34 PMpex_binary
like I said and ensure a few things like a platforms
or complete_platforms
that matches AWS (I can provide more info there is needed), inherit_path
to solve your problem without having to set PEX_*
env vars out in AWS and a handler spec like __<http://pex__.my|pex__.my>_<http://package.my|package.my>_module:my_handler_func
.billions-keyboard-33102
12/06/2022, 6:35 PMenough-analyst-54434
12/06/2022, 6:35 PMpython_awslambda
target / rules.