fresh-cat-90827
02/04/2022, 11:15 PMps
call.fresh-cat-90827
02/04/2022, 11:15 PM$ ./pants run project/bar.py -- --input="baz"
This is what one can see in local ps ww
on a MacOS device:
44762 s010 S+ 0:00.51 /usr/local/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/Resources/Python.app/Contents/MacOS/Python /Users/user-name/.cache/pants/setup/bootstrap-Darwin-x86_64/2.7.1_py39/bin/pants --pants-bin-name=./pants --pants-version=2.7.1 run project/bar.py -- --input=baz
However, once a PEX file is produced via the package
command and then run:
$ python3 dist/project/bar.pex --input="baz"
you don’t see much any longer on `ps ww`:
46131 s010 S+ 0:00.78 /usr/bin/python3 /Users/user-name/.pex/unzipped_pexes/e9eb91dcb789973ca601f8bfb4401555f188d841 --input=baz
One can inspect the /Users/user-name/.pex/unzipped_pexes/e9eb91dcb789973ca601f8bfb4401555f188d841/PEX-INFO
file’s entry_point
property to see what module is being run, but this is not visible from the ps
output.
The use case is that at a given point of time there may be multiple PEX files running, and it would be handy to see which ones are running from the ps
output (or somehow else). Any ideas?happy-kitchen-89482
02/04/2022, 11:45 PMpants
process itself, not your running binary's process, is that intentional?fresh-cat-90827
02/06/2022, 10:18 PMps
only gives me only one process that Pants started; there are no other processes related to the Pants run
command executionhappy-kitchen-89482
02/07/2022, 1:28 AM./pants
process itself, but I don't see the process that was invoked by ./pants run
happy-kitchen-89482
02/07/2022, 1:28 AMfresh-cat-90827
02/07/2022, 7:33 AM./pants run
and running a .pex
file with Python are two very different things. I mentioned both to illustrate how helpful ./pants run
process metadata is and how little is known about running .pex
file. I was just wondering whether when running $ python3 dist/project/bar.pex --input="baz"
the pex is capable of leaking some metadata about itself into the process details. Perhaps @enough-analyst-54434 would know given it’s PEX related?happy-kitchen-89482
02/07/2022, 4:04 PM501 52424 1023 0 8:00AM ttys000 0:00.53 /Users/benjyw/.cache/pants/setup/bootstrap-Darwin-x86_64/2.10.0.dev3_py38/bin/python /Users/benjyw/.cache/pants/setup/bootstrap-Darwin-x86_64/2.10.0.dev3_py38/bin/pants --pants-bin-name=./pants --pants-version=2.10.0.dev3 run project/bar.py -- --input=baz
501 52458 16356 0 8:00AM ?? 0:00.43 /Users/benjyw/.pyenv/versions/3.8.12/bin/python3.8 /Users/benjyw/.cache/pants/named_caches/pex_root/unzipped_pexes/2312ebcec214434cf2349791389503f03e1033a7 --input=baz
and the second one looks very much like the standalone case when you package and then run the packaged binary outside Pants.happy-kitchen-89482
02/07/2022, 4:06 PMps
is basically the command line that the process was run withhappy-kitchen-89482
02/07/2022, 4:06 PMhappy-kitchen-89482
02/07/2022, 4:07 PMhappy-kitchen-89482
02/07/2022, 4:10 PMunzipped_pexes/2312ebcec214434cf2349791389503f03e1033a7
we could possibly unpack it to unzipped_pexes/2312ebcec214434cf2349791389503f03e1033a7/bar.pex
happy-kitchen-89482
02/07/2022, 4:11 PMfresh-cat-90827
02/07/2022, 5:08 PM