adamant-magazine-1675110/04/2022, 10:36 AM
. The problem here is that
celery -A path.to.module inspect ping
is a part of the .pex file, and it is unclear how to find it and execute it. One way to just find the binary would be to package the pexes in
to a known location and then to use
This way I can reach the binary. But the problem remains, because I can't reach the module I need (it is in user code). I suppose I'd also need to set up PYTHONPATH. Another way to reach the binary would be to just install
itself separately in the system python distribution, but I would still need to reach the user code binary. Both the solutions seem like a lot of hackery and I'm not even sure if it's possible to pull any of them off. Is there an easier way to achieve this - accessing venv binaries without running the pex file itself? Or maybe you can override the entrypoint when running venv. Or maybe there is a better way to package docker images? Any help would be much appreciated
is already set to
so I can just run the pex itself with two different sets of arguments. However the problem would remain if I needed to run two different binaries
and needing to run anything else (can't think of any use case right now, but this could be anything that executes as a command like
enough-analyst-5443410/04/2022, 1:33 PM
runs the PEX entry point, but you can also run any of the
scripts the distributions in your PEX provide.
adamant-magazine-1675110/04/2022, 1:37 PM
enough-analyst-5443410/04/2022, 1:42 PM
adamant-magazine-1675110/04/2022, 3:35 PM
field set in the
pex. I end up with this error though
It is reasonable, I excluded the requirements, but I know it will be there in the final Docker image. If I leave the script field only in the
pex.pex_builder.PEXBuilder.InvalidExecutableSpecification: Could not find script 'celery' in any distribution within PEX!
pex, it gets overwritten and the entrypoint ends up being python. Is there any way around it or do I have to resort to the first configuration with multi-stage build but single pex?
enough-analyst-5443410/04/2022, 4:01 PM
targets forming the split; then in the docker image set
(which corresponds to
(which corresponds to
). I personally don't like this at all, I'd rather have a pex_binary target in my BUILD that I can test and know the final PEX in the Docker image will work the same as. A bit too many moving parts for my taste - but it should work.
adamant-magazine-1675110/04/2022, 4:04 PM