billions-apple-73852
09/24/2024, 8:13 AMdocker run -it --rm -p 8000:8000 sha256:ae5bd62b0c5dacbc2c711a8af9aaa6eae99eed00a20f1f392a1cbcb53084a7ea
The error I'm getting:
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.12 CPython==3.12.6
2.) /usr/bin/python3.11 CPython==3.11.2
No interpreter compatible with the requested constraints was found:
Failed to resolve requirements from PEX environment @ /root/.pex/unzipped_pexes/d68b21b11fd496463c05648307e5236930357f95.
Needed cp312-cp312-manylinux_2_36_aarch64 compatible dependencies for:
1: pydantic-core==2.23.4
Required by:
pydantic 2.9.2
But this pex had no ProjectName(raw='pydantic-core', validated=False, normalized='pydantic-core') distributions.
2: protobuf!=3.20.0,!=3.20.1,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<6.0.0.dev0,>=3.20.2
Required by:
googleapis-common-protos 1.65.0
But this pex had no ProjectName(raw='protobuf', validated=False, normalized='protobuf') distributions.
3: protobuf!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<6.0.0.dev0,>=3.19.5
Required by:
google-api-core 2.20.0
But this pex had no ProjectName(raw='protobuf', validated=False, normalized='protobuf') distributions.
4: protobuf<6.0.0dev,>=3.19.0
Required by:
proto-plus 1.24.0
But this pex had no ProjectName(raw='protobuf', validated=False, normalized='protobuf') distributions.
5: charset-normalizer<4,>=2
Required by:
requests 2.32.3
But this pex had no ProjectName(raw='charset-normalizer', validated=False, normalized='charset-normalizer') distributions.
6: grpcio<2.0dev,>=1.33.2; extra == "grpc"
Required by:
google-api-core 2.20.0
But this pex had no ProjectName(raw='grpcio', validated=False, normalized='grpcio') distributions.
7: protobuf<6.0dev,>=5.26.1
Required by:
grpcio-status 1.66.1
But this pex had no ProjectName(raw='protobuf', validated=False, normalized='protobuf') distributions.
8: grpcio>=1.66.1
Required by:
grpcio-status 1.66.1
But this pex had no ProjectName(raw='grpcio', validated=False, normalized='grpcio') distributions.
9: grpcio<2.0dev,>=1.49.1; python_version >= "3.11" and extra == "grpc"
Required by:
google-api-core 2.20.0
But this pex had no ProjectName(raw='grpcio', validated=False, normalized='grpcio') distributions.
10: protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<6.0.0dev,>=3.20.2
Required by:
google-cloud-aiplatform 1.67.1
google-cloud-resource-manager 1.12.5
But this pex had no ProjectName(raw='protobuf', validated=False, normalized='protobuf') distributions.
11: google-crc32c<2.0dev,>=1.0
Required by:
google-resumable-media 2.7.2
google-cloud-storage 2.18.2
But this pex had no ProjectName(raw='google-crc32c', validated=False, normalized='google-crc32c') distributions.
12: grpcio<2.0.0dev,>=1.44.0
Required by:
grpc-google-iam-v1 0.13.1
But this pex had no ProjectName(raw='grpcio', validated=False, normalized='grpcio') distributions.
13: grpcio<2.0.0.dev0,>=1.44.0; extra == "grpc"
Required by:
googleapis-common-protos 1.65.0
But this pex had no ProjectName(raw='grpcio', validated=False, normalized='grpcio') distributions.
14: protobuf!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<6.0.0dev,>=3.20.2
Required by:
grpc-google-iam-v1 0.13.1
But this pex had no ProjectName(raw='protobuf', validated=False, normalized='protobuf') distributions.
15: shapely<3.0.0dev
Required by:
google-cloud-aiplatform 1.67.1
But this pex had no ProjectName(raw='shapely', validated=False, normalized='shapely') distributions.
16: jiter<1,>=0.4.0
Required by:
openai 1.47.1
But this pex had no ProjectName(raw='jiter', validated=False, normalized='jiter') distributions.
Things I've tried:
• added platforms=["linux-x86_64-cp-37-cp37m", "macosx_10_15_x86_64-cp-38-cp38"]
suggested here: https://www.pantsbuild.org/stable/docs/python/goals/package#injecting-command-line-arguments-and-environment-variables, to pex_binary, but it gives syntax error.
• Re-installed pants with brew, made sure the pantsd is running in arm64 mode.
• using zsh instead of bash, making sure it's running in arm64
• pants package :: --no-watch-filesystem --no-pantsd
This is my dockerfile:
FROM europe-docker.pkg.dev/ewx-global/docker-hub-proxy/python:3.12
WORKDIR /app
COPY context.ewx-opsy.src.ewx_opsy/bin.pex /app/bin.pex
CMD ["/app/bin.pex"]
This is my BUILD file inside src/ewx_opsy
python_sources(
resolve="opsy",
dependencies=[
":settings_files",
],
)
resources(
name="settings_files",
sources=["*.toml"],
)
pex_binary(
name="bin",
script="uvicorn",
args=["ewx_opsy.server:app", "--host=0.0.0.0", "--port=8000", "--log-level=debug"],
# execution_mode="venv",
dependencies=[
"./server.py",
"context/ewx-opsy:poetry#uvicorn",
],
resolve="opsy",
resolve_local_platforms=True
)
broad-processor-92400
09/24/2024, 10:05 PMplatforms=...
but that's been deprecated and removed because it wasn't reliable. The better way is to use complete_platforms=...
: https://www.pantsbuild.org/prerelease/docs/python/overview/pex#setting-the-target-platforms-for-a-pex (linking to prerelease docs because they're better than the current stable)broad-processor-92400
09/24/2024, 10:07 PMplatforms
, so you were always going to have trouble to get this working! that's not very helpful of us (the pants project) 🙂
Are you in a position to file an issue about that problem in the docs? Maybe even open a pull request to fix them? Let me know if I can help 🙂billions-apple-73852
09/26/2024, 10:37 AMpython_sources(
resolve="opsy",
dependencies=[
":settings_files",
],
)
resources(
name="settings_files",
sources=["*.toml"],
)
file(
name="linux",
source="linux.json",
)
pex_binary(
name="bin",
script="uvicorn",
args=["ewx_opsy.server:app", "--host=0.0.0.0", "--port=8000", "--log-level=debug"],
# execution_mode="venv",
dependencies=[
"./server.py",
"context/ewx-opsy:poetry#uvicorn",
],
resolve="opsy",
complete_platforms=[":linux"],
)
the linux.json looks like this, which compatible_tags has more than 1000 items
{
"path": "/usr/bin/python3.12",
"compatible_tags":[
"cp312-cp312-manylinux_2_40_x86_64",
"cp312-cp312-manylinux_2_39_x86_64",
.....
]
"marker_environment": {
"implementation_name": "cpython",
"implementation_version": "3.12.6",
"os_name": "posix",
"platform_machine": "x86_64",
"platform_python_implementation": "CPython",
"platform_release": "6.10.10-arch1-1",
"platform_system": "Linux",
"platform_version": "#1 SMP PREEMPT_DYNAMIC Thu, 12 Sep 2024 17:21:02 +0000",
"python_full_version": "3.12.6",
"python_version": "3.12",
"sys_platform": "linux"
}
}
broad-processor-92400
09/26/2024, 1:46 PMpowerful-scooter-95162
10/01/2024, 2:58 AMpowerful-scooter-95162
10/01/2024, 3:00 AMbillions-apple-73852
10/01/2024, 8:46 PMbillions-apple-73852
10/01/2024, 8:46 PM