Is there any good way to get the hash values for `...
# general
r
Is there any good way to get the hash values for
.pex/unzipped_pexes/<hash>
from a scie binary executable? I've tried
SCIE=inspect ./executable
but there seems to be no direct references of the unzipped pex hash used at
.pex/unzipped_pexes
from
.cache/nce
and the inspection result.
Copy code
joongi@fresh-test:~$ ls -l .cache/nce
total 0
drwxr-xr-x 1 joongi joongi 278 Nov 20 08:18 3e26a672df17708c4dc928475a5974c3fb3a34a9b45c65fb4bd1e50504cc84ec  # contains the standalone python
drwxr-xr-x 1 joongi joongi  44 Nov 20 08:17 a179cb83d7f37fb3ac1e1998712a8585937c7f73bce851ad555e2d69e0f966f5  # contains `src.ai.backend.install/pex.pex`
drwxr-xr-x 1 joongi joongi  80 Nov 20 08:17 b71bea2deda31242e8d5d8749d173f4fe166182e8ebbef3ef605da06320bf24a  # contains the ptex tool
drwxr-xr-x 1 joongi joongi  34 Nov 20 08:17 d7090c8110acc559f4d0210c46450bfc15a50a66f29bf012be238a2a9f0cb6ee  # contains lift.json
joongi@fresh-test:~$ ls -l .pex/unzipped_pexes/
total 0
drwxr-xr-x 1 joongi joongi 128 Nov 20 08:16 a8bb54e74cfea9df62a1236164c2cdc6dec2f6b6  # how to get to know this hash value from .cache/nce or SCIE=xxx commands?
Calculating the hash of
pex.pex
file above returns
a179cb...
, not
a8bb54...
.
b
I think there's a
PEX_INFO
file at the top level of the .pex files, that contains hashes
Just in case this is an "x-y problem", what are you trying to do with the final path?
r
I'm writing a step-by-step guide to our on-site support engineers to hack around the scie/pex based distributions, such as monkeypatching...
I just found a way to get the hash:
PEX_VERBOSE=1 PEX_INTERPRETER=1 ./scie-executable
Copy code
joongi@fresh-test:~$ PEX_VERBOSE=1 PEX_INTERPRETER=1 /mnt/machines/localdev/home/joongi/bai-edge/dist/backendai-install-linux-aarch64
pex: Laying out PEX zipfile /home/joongi/.cache/nce/a179cb83d7f37fb3ac1e1998712a8585937c7f73bce851ad555e2d69e0f966f5/src.ai.backend.install/pex.pex: 0.1ms
pex: Executing installed PEX for /home/joongi/.cache/nce/a179cb83d7f37fb3ac1e1998712a8585937c7f73bce851ad555e2d69e0f966f5/src.ai.backend.install/pex.pex at /home/joongi/.pex/unzipped_pexes/a8bb54e74cfea9df62a1236164c2cdc6dec2f6b6
pex: Testing /home/joongi/.cache/nce/3e26a672df17708c4dc928475a5974c3fb3a34a9b45c65fb4bd1e50504cc84ec/cpython-3.11.6+20231002-aarch64-unknown-linux-gnu-install_only.tar.gz/python/bin/python3.11 can resolve PEX at /home/joongi/.pex/unzipped_pexepex:   Testing /home/joongi/.cache/nce/3e26a672df17708c4dc928475a5974c3fb3a34a9b45c65fb4bd1e50504cc84ec/cpython-3.11.6+20231002-aarch64-unknown-linux-gnu-install_only.tar.gz/python/bin/python3.11 can resolve PEX at /home/joongi/.pex/unzipped_pexes/a8bb54e74cfea9df62a1236164c2cdc6dec2f6b6: 37.4ms
pex: Using the current interpreter /home/joongi/.cache/nce/3e26a672df17708c4dc928475a5974c3fb3a34a9b45c65fb4bd1e50504cc84ec/cpython-3.11.6+20231002-aarch64-unknown-linux-gnu-install_only.tar.gz/python/bin/python3.11 since it matches constraints and PYTHONPATH is not set.
pex: Discarding site packages path: /home/joongi/.cache/nce/3e26a672df17708c4dc928475a5974c3fb3a34a9b45c65fb4bd1e50504cc84ec/cpython-3.11.6+20231002-aarch64-unknown-linux-gnu-install_only.tar.gz/python/lib/python3.11/site-packages
pex: Tainted path element: /home/joongi/.cache/nce/3e26a672df17708c4dc928475a5974c3fb3a34a9b45c65fb4bd1e50504cc84ec/cpython-3.11.6+20231002-aarch64-unknown-linux-gnu-install_only.tar.gz/python/lib/python3.11/site-packages
pex: Scrubbing from user site: /home/joongi/.local/lib/python3.11/site-packages
pex: Scrubbing from site-packages: /home/joongi/.cache/nce/3e26a672df17708c4dc928475a5974c3fb3a34a9b45c65fb4bd1e50504cc84ec/cpython-3.11.6+20231002-aarch64-unknown-linux-gnu-install_only.tar.gz/python/lib/python3.11/site-packages
pex: New sys.path: ['/home/joongi/.pex/unzipped_pexes/a8bb54e74cfea9df62a1236164c2cdc6dec2f6b6/.bootstrap/pex/vendor/_vendored/attrs', '/home/joongi/.pex/unzipped_pexes/a8bb54e74cfea9df62a1236164c2cdc6dec2f6b6/.bootstrap', '/home/joongi/.pex/unzipped_pexes/a8bb54e74cfea9df62a1236164c2cdc6dec2f6b6', '/home/joongi/.cache/nce/3e26a672df17708c4dc928475a5974c3fb3a34a9b45c65fb4bd1e50504cc84ec/cpython-3.11.6+20231002-aarch64-unknown-linux-gnu-install_only.tar.gz/python/lib/python311.zip', '/home/joongi/.cache/nce/3e26a672df17708c4dc928475a5974c3fb3a34a9b45c65fb4bd1e50504cc84ec/cpython-3.11.6+20231002-aarch64-unknown-linux-gnu-install_only.tar.gz/python/lib/python3.11', '/home/joongi/.cache/nce/3e26a672df17708c4dc928475a5974c3fb3a34a9b45c65fb4bd1e50504cc84ec/cpython-3.11.6+20231002-aarch64-unknown-linux-gnu-install_only.tar.gz/python/lib/python3.11/lib-dynload']
pex: Activating PEX virtual environment from /home/joongi/.pex/unzipped_pexes/a8bb54e74cfea9df62a1236164c2cdc6dec2f6b6: 5.8ms
pex: PEX_INTERPRETER specified, dropping into interpreter
pex: Bootstrap complete, performing final sys.path modifications...
pex: PYTHONPATH contains:
pex:   *
pex:     /home/joongi/.pex/unzipped_pexes/a8bb54e74cfea9df62a1236164c2cdc6dec2f6b6
...
Copy code
/home/joongi/.pex/unzipped_pexes/a8bb54e74cfea9df62a1236164c2cdc6dec2f6b6
this part is what I wanted