victorious-zebra-49010
10/04/2023, 5:16 AMpants package
, running locally on macos, to successfully build a docker image (linux) with a pex binary inside that has all the right platform-specific wheels for all the 3rd party dependencies in the pex binary.
we're running into issues, though, when building the docker container through pants package
. this is the setup so far along with all the command output and logging: https://gist.github.com/andreaimprovised/1ef0e1a6a215f9b84d5de9dcecb2d615 .
it is complaining "There was 1 error downloading required artifacts" and pex is raising a "MetadataGenerationFailed" exception. i haven't been able to figure out what exactly is wrong
any help?victorious-zebra-49010
10/04/2023, 5:22 AMpants package
inside circleci's docker executor (circleci does a docker-in-docker build thing) and hopefully pants publish
to get the image into AWS ECR.
atm, if i can't get pants package
to work, i'll probably end up just putting all my code in the Dockerfile, installing pants, and running pants package
to build the PEX binary inside the target platform environment. then, i can use the pex binary as the entrypointvictorious-zebra-49010
10/04/2023, 5:23 AMenough-analyst-54434
10/04/2023, 5:38 AM"linux_arm64-cp-311-cp311m"
. That's both not correct - there is no such thing as cp311m
, CPython dropped the pymalloc m
abi tag starting in 3.8 - and it's not a tag of any of the wheels supplied by pydantic-core: https://pypi.org/project/pydantic-core/2.10.1/#files
As such, you're forced into attempting a build of the sdist. Pydantic is semi-famous for having gone through a big effort to switch to Rust. Presumably you don't have the cargo toolchain installed on your machine, which, IIUC, is required to build this sdist.enough-analyst-54434
10/04/2023, 5:39 AM"linux_arm64-cp-311-cp311"
, but you really, really don't want to be using platforms
. Use complete_platforms
instead: https://www.pantsbuild.org/docs/reference-pex_binary#codecomplete_platformscodeenough-analyst-54434
10/04/2023, 5:40 AMvictorious-zebra-49010
10/04/2023, 5:41 AMenough-analyst-54434
10/04/2023, 5:44 AMvictorious-zebra-49010
10/04/2023, 3:17 PMlinux_aarch64-cp-311-cp311
(pydantic does not mark wheels as linux_arm64). the the call to pants package
succeeds. the inside of the docker container appears to have the correct wheelsenough-analyst-54434
10/04/2023, 3:18 PMvictorious-zebra-49010
10/04/2023, 3:21 PMenough-analyst-54434
10/04/2023, 3:22 PMvictorious-zebra-49010
10/04/2023, 3:22 PMenough-analyst-54434
10/04/2023, 3:22 PMenough-analyst-54434
10/04/2023, 3:23 PMenough-analyst-54434
10/04/2023, 3:23 PMvictorious-zebra-49010
10/04/2023, 3:23 PM--platform
?enough-analyst-54434
10/04/2023, 3:24 PMvictorious-zebra-49010
10/04/2023, 3:24 PMenough-analyst-54434
10/04/2023, 3:29 PM--platform
docs: https://pex.readthedocs.io/en/v2.1.147/buildingpex.html#platform but in general I don't overly proscribe to a fault. Now, I'm not sure what docs you read, likely Pants docs. I'm really just the Pex maintainer guy.happy-kitchen-89482
10/04/2023, 7:15 PMhappy-kitchen-89482
10/04/2023, 7:15 PMhappy-kitchen-89482
10/04/2023, 7:16 PMhappy-kitchen-89482
10/04/2023, 7:22 PM