many-waiter-76097
05/31/2024, 8:07 PMx86_64
instead of aarch64
.
Failed to find compatible interpreter on path /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin.
Examined the following interpreters:
1.) /usr/bin/python3.10 CPython==3.10.12
2.) /usr/bin/python3.11 CPython==3.11.9
No interpreter compatible with the requested constraints was found:
A distribution for pendulum could not be resolved for /usr/bin/python3.11.
Found 1 distribution for pendulum that do not apply:
1.) The wheel tags for pendulum 2.1.2 are cp311-cp311-manylinux_2_35_x86_64 which do not match the supported tags of /usr/bin/python3.11:
cp311-cp311-manylinux_2_35_aarch64
BUILD:
python_sources()
pex_binary(
name = 'hello_world',
entry_point="hello_world.py",
dependencies = [
"//:root#pendulum",
],
environment="linux",
complete_platforms=["//:linux_x86_py311"],
)
root BUILD:
docker_environment(
name="linux",
platform="linux_x86_64",
image="<http://X.dkr.ecr.us-east-1.amazonaws.com/image:tag|X.dkr.ecr.us-east-1.amazonaws.com/image:tag>"
)
file(
name="linux_x86_py311",
source="linux.json",
)
linux.json is large. I've attempted to remove everything but the tag I want, but that leads to a division by zero
error.
Help me Obi-Wan :pbroad-processor-92400
05/31/2024, 9:19 PMmany-waiter-76097
05/31/2024, 10:14 PMdocker run -it --platform linux/amd64 <http://X.dkr.ecr.us-east-1.amazonaws.com/image:tag|X.dkr.ecr.us-east-1.amazonaws.com/image:tag> /bin/bash -c 'pip install pex; pex3 interpreter inspect --markers --tags' > linux.json
broad-processor-92400
05/31/2024, 10:54 PMbillowy-cat-69904
06/01/2024, 10:20 AMdocker_environment
target? What purpose does it serve?many-waiter-76097
06/01/2024, 12:31 PMdocker_environment
causes pants to build the project in the specified image?many-waiter-76097
06/01/2024, 12:34 PMpants run project/path:name
billowy-cat-69904
06/01/2024, 4:04 PMdocker_environment
name in my pants.toml
file under the section:
[environments-preview.name]
linux="//:linux"
then I use this name in pex_binary(environment="linux", ...)
. with this I also didn't need to mention complete_platforms
. I used the same options for docker_environment
as yours. This worked on my local, but it failed in CI. In CI, I got the following error:
ProcessExecutionFailure: Process 'Extract environment variables from the Docker image python:3.11.9-slim' failed with exit code 126.
| stdout:
| OCI runtime exec failed: exec failed: unable to start container process: chdir to cwd ("/pants-sandbox/pants-sandbox-NA71HL") set in config.json failed: no such file or directory: unknown
(Reference: https://www.pantsbuild.org/2.19/docs/using-pants/environments)powerful-scooter-95162
06/19/2024, 9:01 PMFROM --platform=linux/amd64
syntax in Dockerfiles was not working unless I used --no-pants-cache to kick it in the pants.