faint-dress-64989
12/06/2022, 10:44 PM./pants run src/python/maergo:main
. When attempting to run the application via docker with ./pants run src/docker/maergo:python
I encounter the following:
Failed to find compatible interpreter on path /usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin.
Examined the following interpreters:
1.) /usr/local/bin/python3.10 CPython==3.10.7
2.) /usr/bin/python3.9 CPython==3.9.2
No interpreter compatible with the requested constraints was found:
Failed to resolve requirements from PEX environment @ /root/.pex/unzipped_pexes/dbe958d0761ce1dbfdab65e69c2ae9a4658f75b5.
Needed cp310-cp310-manylinux_2_31_aarch64 compatible dependencies for:
1: pydantic!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0,>=1.6.2
Required by:
fastapi 0.85.2
But this pex had no ProjectName(raw='pydantic', normalized='pydantic') distributions.
2: pydantic<2.0.0,>=1.10.2
But this pex had no ProjectName(raw='pydantic', normalized='pydantic') distributions.
This is a link to my test repository. Is there some other dependency I need to add to my Dockerfile to enable the execution of pex files?enough-analyst-54434
12/06/2022, 10:54 PMcp310-manylinux_2_31_aarch64
- appears to be your Python / arch, what is the arch of the python:3.10-bullseye
image?enough-analyst-54434
12/06/2022, 10:55 PMfaint-dress-64989
12/06/2022, 10:55 PMsupport running Pants build steps in containers though.
-> this would be amazingenough-analyst-54434
12/06/2022, 10:56 PMenough-analyst-54434
12/06/2022, 10:57 PMfaint-dress-64989
12/06/2022, 10:58 PMenough-analyst-54434
12/06/2022, 10:58 PMenough-analyst-54434
12/06/2022, 10:58 PMfaint-dress-64989
12/06/2022, 10:58 PMenough-analyst-54434
12/06/2022, 10:58 PMenough-analyst-54434
12/06/2022, 10:59 PMenough-analyst-54434
12/06/2022, 10:59 PMenough-analyst-54434
12/06/2022, 10:59 PM[python-setup] find-links
or similar.enough-analyst-54434
12/06/2022, 11:01 PMcomplete_platforms
, that provides an exact match to your container with more one time setup work to generate the complete platform JSON. The `platforms`is lossy and can pick bad glibc versions, etc since its underspecified.faint-dress-64989
12/06/2022, 11:10 PMResolveError: The file or directory 'linux-x86_64-pp-310-none' does not exist on disk in the workspace, so the address 'linux-x86_64-pp-310-none' from the `complete_platforms` from the target src/python/maergo:main cannot be resolved.
faint-dress-64989
12/06/2022, 11:21 PMbroad-processor-92400
12/06/2022, 11:36 PM3rdparty/platforms/
which contains a BUILD
like the following, along with docker_python_3_9_10_bullseye_amd64.json
and docker_python_3_9_10_bullseye_arm64.json
(amd vs. arm) generated by the commands listed
# docker run -it --platform linux/arm64 python:3.9.10-bullseye bash -c 'pip install pex; pex3 interpreter inspect --markers --tags'
# docker run -it --platform linux/amd64 python:3.9.10-bullseye bash -c 'pip install pex; pex3 interpreter inspect --markers --tags'
files(
name="docker_python_3_9_10_bullseye",
sources=["docker_python_3_9_10_bullseye_*.json"],
)
(you'll presumably need to change the image used)
This is then referred to like pex_binary(..., complete_platforms=("3rdparty/platforms:docker_python_3_9_10_bullseye",))
Slightly annoyingly, we build an ARM image on macOS, and an x86-64/AMD image on CI, hence having both complete platforms.faint-dress-64989
12/07/2022, 4:25 PMdocker_python_3_9_10_bullseye_amd64.json
file? Also at what point to execute the docker run
commands specified above?faint-dress-64989
12/07/2022, 4:28 PMenough-analyst-54434
12/07/2022, 4:34 PMenough-analyst-54434
12/07/2022, 4:35 PMenough-analyst-54434
12/07/2022, 4:36 PMfaint-dress-64989
12/07/2022, 4:39 PMfaint-dress-64989
12/07/2022, 4:40 PMfaint-dress-64989
12/07/2022, 4:43 PMpex3 interpreter inspect
to generate the complete platform json fileenough-analyst-54434
12/07/2022, 4:44 PMenough-analyst-54434
12/07/2022, 4:46 PMenough-analyst-54434
12/07/2022, 4:53 PMfaint-dress-64989
12/07/2022, 5:52 PM