refined-cat-61929
04/12/2024, 2:08 PMpex related difficulties. First, on packaging our pex file to the docker image (for a different platform than I'm building with), and pushing it to Google Cloud, when it attempt to run I get failed to load /workspace/protean-bin.pex: exec format error. Searching around, I see that I need to either make it executable in my Dockerfile or add a shebang statement at the top. I've done both, but to no effect.
Perhaps related, but when running the executable on my machine, it does run but errors out immediately saying it can't find google.cloud.sql, but the cloud_sql_python_connector is not there. I'm unsure why it isn't being pulled in to the pex file, Pants should understand that dependency by looking at the source code.refined-cat-61929
04/12/2024, 2:30 PMpex_binary rule. I'll see if that helps.refined-cat-61929
04/12/2024, 4:28 PMrefined-cat-61929
04/13/2024, 6:23 PMrefined-cat-61929
04/13/2024, 6:25 PMpex_binary is because the way I was setting the platform was incorrect. I tried many different ways to do this with Pants, but eventually just put --platform=linux/amd64 in my FROM statement in the Dockerfile.happy-kitchen-89482
04/14/2024, 2:33 AMpex_binary, and you need the entire transitive closure of requirements to be available as wheels for platform B, since A can't built sdists into wheels for Bhappy-kitchen-89482
04/14/2024, 2:34 AMhappy-kitchen-89482
04/14/2024, 2:34 AMrefined-cat-61929
04/15/2024, 4:25 AMcomplete_platform wasn't enough, you have to set the platform too, somewhere. But, evidently, not in the pex_binary build rule, since it is deprecated there. These seem to do two different things, complete_platform makes sure the pex file is built with the right wheels, but doesn't change the Dockerfile compatibility itself (makes sense, pex_binary doesn't know anything about the Dockerfile).refined-cat-61929
04/15/2024, 4:26 AMhappy-kitchen-89482
04/15/2024, 3:46 PMhappy-kitchen-89482
04/15/2024, 3:46 PMrefined-cat-61929
04/15/2024, 6:03 PM