Hello everyone. Found out about Pants from the Pex...
# general
m
Hello everyone. Found out about Pants from the Pex GitHub readme and it’s exactly what I needed for a python project I’m building into a docker container for aws lambda. I’m further using the built image in an aws sam template and am using a run_shell_command target to invoke the sam cli. What I’d like to know is if it’s possible to change which goal a run_shell_command/shell_command runs for. It would be nice to have the command run for the publish goal instead of run.
👋 3
l
Mason, I don't believe there is something you can do in configuration to cause 'publish' to run the
run_shell_command
. In pants the artifact or target is the 'what' of 'what do you want to publish?'. The same artifact can be built with
package
, run with
run
or published with
publish
. (like for a docker image) Also, perhaps unrelated, have you considered directly packaging the zip for lambda rather than via first dockerizing? https://www.pantsbuild.org/docs/awslambda-python
m
The lambda relies on some pretty hefty dependencies and thus is too large for aws lambda’s maximum size, so zip isn’t possible. The load is going to be really inconsistent, so something like lambda still seems the correct solution, but it definitely needs to be a docker container.
👍 1