ripe-magazine-21370
04/02/2025, 10:43 PMpants generate-dependency and then pants package ... running on an X86 CPU machine, and then expecting the Pytorch/cuda dependencies to work in my docker image. How can we handle these issues?
Second question, probably more generic: is Pantsbuild a suitable system for shipping python microservices + js/ts/react frontend code? The goal is to run on kubernetesbrief-engine-92399
04/02/2025, 10:54 PMbrief-engine-92399
04/02/2025, 10:57 PMtorch+cpu you'll get the nvidia python libs that come with pytorch when generating a dependency. Just make sure you have a base image that contains libcuda and co.ripe-magazine-21370
04/02/2025, 10:58 PMripe-magazine-21370
04/02/2025, 10:58 PMbrief-engine-92399
04/02/2025, 10:59 PMsys_platform=linux in some cases, e.g., flashinferripe-magazine-21370
04/02/2025, 11:00 PMripe-magazine-21370
04/02/2025, 11:00 PMripe-magazine-21370
04/02/2025, 11:01 PMbrief-engine-92399
04/02/2025, 11:01 PMgorgeous-winter-99296
04/03/2025, 7:59 AM--with-cpu will force the CPU resolve, --with-gpu forces GPU, etc. For container builds we just set resolve="gpu" on the pex binaries. For the docker part specifically you also want to look at Pex's complete_platforms.json, to ensure the pex build happens exactly for the container you're using. It almost always works anyways if you're building on a similar platform, but when it doesn't it's a pain to fix.
The second question I have less info on, but we do build a bunch of "utility" containers that are managed by our core go backend. So they aren't services in the traditional sense, but it's worked nicely to bring some of our tools closer to the ML repositories. We did briefly try to move our frontend from the Bazel monorepo to the Pantsbuild repo, but it wasn't worth the cost/effort for us compared to piggybacking on our main frontend team. If we didn't have that I think we could have made it work, it's definitely better than we have with Bazel. Just... lots of differing idiosyncracies.ripe-magazine-21370
04/03/2025, 2:23 PMgorgeous-winter-99296
04/03/2025, 2:35 PMripe-magazine-21370
04/03/2025, 3:47 PMbrief-engine-92399
04/03/2025, 5:12 PMripe-magazine-21370
04/03/2025, 5:46 PMgorgeous-winter-99296
04/03/2025, 6:37 PM