bulky-evening-62934
06/08/2020, 11:40 AMpex
doesn’t allow to specify the script
and entry_point
at the same time, any special reason for that ? Sometime it’s convenient to run the command like gunicorn app:app
enough-analyst-54434
06/08/2020, 2:29 PMgunicorn
in your example a script that needs an entry point argument to run? In other words are you wanting Pex to accept both an entry point (whether specified by a script
or an entry_point
) and some additional fixed arguments to always pass to that entry point?bulky-evening-62934
06/08/2020, 2:32 PMgunicorn
and run the specific entry point with the built pex file.
But why we set this limitation ?enough-analyst-54434
06/08/2020, 2:41 PMgunicorn
script expects an entry point argument and that you want to seal that argument in to the PEX file so that you do not need to type ./my-gunicorn.pex my.entry:point
but instead can just type ./my-gunicorn.pex
?bulky-evening-62934
06/08/2020, 2:41 PMenough-analyst-54434
06/08/2020, 2:44 PMpex gunicorn my_app==1.0.0. -c gunicorn --program-args my.entry:point -o my-gunicorn.pex
In other words, the fact this one script (gunicorn) needs an entry point argument is specific. More generally, you may have a different console script that needs other types of arguments. The main point is you want to set those arguments once at pex creation time.--program-args
would be the new feature.--program-env
to seal in default environment variables to the PEX that the entry point needs.bulky-evening-62934
06/08/2020, 2:53 PMprogram-args
seems to be an appealing option. To make sure, that’s the same effect as I pass those args when running the built pex file right ?enough-analyst-54434
06/08/2020, 2:58 PM[script|entry point] (program-args) ... additional command line args ...
.
So for the example above of:
ex gunicorn my_app==1.0.0. -c gunicorn --program-args my.entry:point -o my-gunicorn.pex
Running:
./my-gunicorn.pex --bob sally george
Would actually run:
./my-gunicorn.pex my.entry:point --bob sally george
bulky-evening-62934
06/08/2020, 3:00 PMPEX_PYTHON=/path/to/python
should be enough ?enough-analyst-54434
06/08/2020, 3:04 PM/path/to/python my.pex
is enough. Using PEX_PYTHON=/path/to/python my.pex
works too, but is a bit more indirect than it need be.bulky-evening-62934
06/08/2020, 3:08 PMPEX_ROOT=/path
? do you know where I could find the document/code which lists those Pex ENV VARs ?enough-analyst-54434
06/08/2020, 3:26 PMpex --help-variables
.--runtime-pex-root
that lets you seal in a PEX_ROOT
for your PEX file to use when run. This may allow you to eliminate saying PEX_ROOT=foo ./my.pex
if you know the machines you'll run this pex on always have foo
available as an appropriate PEX_ROOT
.bulky-evening-62934
06/08/2020, 3:30 PMenough-analyst-54434
06/08/2020, 3:32 PMbulky-evening-62934
06/09/2020, 8:16 PM--program-args
could be something complex like app:main --arg1 XX --arg2 XX
or just app:main
?enough-analyst-54434
06/09/2020, 8:17 PMbulky-evening-62934
06/10/2020, 5:46 PM