I'm trying to set up multiple resolves where the o...
# general
I'm trying to set up multiple resolves where the only "real" difference is the set of
each uses (because pytorch has CUDA and non-CUDA libs which are differentiated only by the index url). But it appears that
is a global property and can't be set per-resolve. Is there a way to do this? (see https://pantsbuild.slack.com/archives/C046T6T9U/p1664233267501069 for some more context if necessary)
@bitter-ability-32190 you seemed to have an idea for how to do this on that previous thread...
Isn't error -9 sigkill?
doh! Sorry @bitter-ability-32190 referenced the wrong previous discussion. Will update the post here and tag the right person.
oh! you are the right person @bitter-ability-32190 but the relevant prior discussion is this one: https://pantsbuild.slack.com/archives/C046T6T9U/p1664233267501069
I think maybe I could do it by specifying the requirements by URL instead of
but that seems brittle.
Nothing (environment marker, extras) distinguishes those wheels other than the index they’re fetched from?
At least that's how I understand it. Here's the docs: https://pytorch.org/get-started/locally/
There's a little interactive matrix where you select install methods (e.g. pip), versions of things, etc. and it spits out a
pip install
command to run. As far as I can tell the only thing that changes is the
. Weird way to do things IMHO...
@happy-kitchen-89482 @bitter-ability-32190 if y'all had any advice here it'd be much appreciated.
I've got nothing off the top of my head 😕 Might require some changes to Pants.
Except I think the extra index url might be for lockfile generation. Then on the consumption side you just have each lockfile? PEX lockfiles store the url I think
Yes, the full URLs are in the lockfile. Pants build the lockfiles for us via
and that gets re-run all the time as we add dependencies. And that goal uses the one-true
to populate the lockfiles even if you have mutliple resolves. I'm open to generating our own lockfiles manually somehow but unclear on how to do that. The pants lockfiles do not look like the output of
pip freeze
I guess one thing you can do is change python-repos.indexes via env var when you generate each lockfile
So your “manual lockfile generation” is just “run Pants with a different setting for that option”
via flag or env var
Oh! I forgot we can manipulate those options via flags/vars. That works nicely. Indeed we have a
(https://pydoit.org/) wrapper around Pants so it can coordinate things like building containers that contain code build from multiple different languages, etc. so we could easily add it there and "hide the ugly" from users. We probably don't even need multiple resolves then as the normal day-to-day use-case is the CPU version and then we do a single build for production with GPU enabled. Thanks!!