Hi Guys, I'm new to pants and may I ask for some h...
# general
l
Hi Guys, I'm new to pants and may I ask for some help with an issue? Currently when I'm running
pants package my_project
I kept getting this error:
Copy code
#18 [builder-personalized-watch-next 9/9] RUN PEX_TOOLS=1 python ./dist/personalized-watch-next/orchestration.pex venv --compile ./bin/personalized-watch-next/orchestration
#18 10.03 Failed to find compatible interpreter on path /usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin.
#18 10.03 
#18 10.03 Examined the following interpreters:
#18 10.03 1.) /usr/local/bin/python3.10 CPython==3.10.12
#18 10.03 2.)        /usr/bin/python2.7 CPython==2.7.16
#18 10.03 3.)        /usr/bin/python3.7 CPython==3.7.3
#18 10.03 
#18 10.03 No interpreter compatible with the requested constraints was found:
#18 10.03 
#18 10.03   Failed to resolve requirements from PEX environment @ /root/.pex/unzipped_pexes/95dbbbb337818e7368a21d1eeec2a32f87f03cce.
#18 10.03   Needed cp310-cp310-manylinux_2_28_x86_64 compatible dependencies for:
#18 10.03    1: tensorboard-data-server<0.8.0,>=0.7.0
#18 10.03       Required by:
#18 10.03         tensorboard 2.13.0
#18 10.03       But this pex had no ProjectName(raw='tensorboard-data-server', normalized='tensorboard-data-server') distributions.
#18 ERROR: process "/bin/sh -c PEX_TOOLS=1 python ./dist/personalized-watch-next/orchestration.pex venv --compile ./bin/personalized-watch-next/orchestration" did not complete successfully: exit code: 1
------
 > [builder-personalized-watch-next 9/9] RUN PEX_TOOLS=1 python ./dist/personalized-watch-next/orchestration.pex venv --compile ./bin/personalized-watch-next/orchestration:
10.03 3.)        /usr/bin/python3.7 CPython==3.7.3
10.03 
10.03 No interpreter compatible with the requested constraints was found:
10.03 
10.03   Failed to resolve requirements from PEX environment @ /root/.pex/unzipped_pexes/95dbbbb337818e7368a21d1eeec2a32f87f03cce.
10.03   Needed cp310-cp310-manylinux_2_28_x86_64 compatible dependencies for:
10.03    1: tensorboard-data-server<0.8.0,>=0.7.0
10.03       Required by:
10.03         tensorboard 2.13.0
10.03       But this pex had no ProjectName(raw='tensorboard-data-server', normalized='tensorboard-data-server') distributions.
------
Dockerfile:16
--------------------
  14 |     RUN PEX_TOOLS=1 python ./dist/personalized-watch-next/dataflow-main.pex venv --compile ./bin/personalized-watch-next/dataflow
  15 |     RUN PEX_TOOLS=1 python ./dist/personalized-watch-next/update-pwn-featurestore.pex venv --compile ./bin/personalized-watch-next/update-pwn-featurestore
  16 | >>> RUN PEX_TOOLS=1 python ./dist/personalized-watch-next/orchestration.pex venv --compile ./bin/personalized-watch-next/orchestration
  17 |     
  18 |     FROM python:3.10-buster
--------------------
ERROR: failed to solve: process "/bin/sh -c PEX_TOOLS=1 python ./dist/personalized-watch-next/orchestration.pex venv --compile ./bin/personalized-watch-next/orchestration" did not complete successfully: exit code: 1



Use `--keep-sandboxes=on_failure` to preserve the process chroot for inspection.
I've checked the locker file: in the locker file:
Copy code
"project_name": "tensorboard-data-server",
"requires_dists": [],
"requires_python": ">=3.7",
"version": "0.7.2"
and for tensorboard:
Copy code
"project_name": "tensorboard",
"requires_python": ">=3.8",
"version": "2.13.0"
I'm using a
python:3.10-buster
so it should meet the requirement. Does anyone know why is that happening?
b
Sorry for the trouble. Can you give a bit more info about what you’re doing? For instance target definitions of the docker image and PEXes. Also, what platform is that machine?
l
Hi Huon, thanks for your reply, this is the definition of the docker_image:
Copy code
pex_binary(
    name="dataflow-main",
    entry_point="watch_next_dataflow.__init__:cli",
    execution_mode="venv",
)

pex_binary(
    name="update-pwn-featurestore",
    entry_point="featurestore.__init__:cli",
    execution_mode="venv",
)

pex_binary(
    name="train-pwn-model",
    entry_point="personalized_watch_next_model.__init__:cli",
    execution_mode="venv",
)

pex_binary(
    name="orchestration",
    entry_point="orchestration.__init__:cli",
    execution_mode="venv",
)

docker_image(
    name="personalized-watch-next",
    image_tags=["{build_args.DEFAULT_TAG}"],
    registries=["us-docker.pkg.dev"],
    source="Dockerfile",
    dependencies=[
        "archipelago:cli",
        "personalized-watch-next:dataflow-main",
        "personalized-watch-next:update-pwn-featurestore",
        "personalized-watch-next:orchestration",
    ],
)
I'm using Ubuntu
Copy code
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.3 LTS
Release:	22.04
Codename:	jammy
b
Okay. Thanks. The usual source of these issues is the pex binaries are built to be compatible with the host environment, not the docker environment that they are actually being run in. For example, any dependencies with native code might need to be carefully chosen. In https://github.com/pantsbuild/pants/discussions/18756, you can see what we do to get docker images that work, using “complete platforms”