So, a week ago I asked whether pex files are built...
# general
a
So, a week ago I asked whether pex files are built in two steps (one with requirements, which change rarely, and one with the code), since I knew I saw something about that. It turns out this was a pants v1 feature (thanks @worried-pager-41972 for figuring that out). My question is, wouldn't this be something that should be in the current pants? So, for tests, we think we figured it out, circleci caching is hard. But, for packaging, you have to start from scratch every time.
c
In this blog post https://blog.pantsbuild.org/optimizing-python-docker-deploys-using-pants/ @bitter-ability-32190 talks about leveraging two PEXs using the options
include_sources
and
include_requirements
. Perhaps that is close to what you’re looking for @ancient-france-42909?
(look for “Multi-stage build leveraging 2 PEXs”)
a
Oh, we discovered the venv bit at built time ourselves 🙂 But, that sounds like what we're looking for, I didn't think of combining these two, though, heh
I'm also glad to see at least the example has bigger PEX files than we do, I assumed we're quite special (read bad at deps) at 1.7GB docker images.
b
We can all thank Facebook for
torch
😛
a
Yeah, we have tensorflow sprinkled all over our docker images because someone needed to import an
Enum
from a package that depended on that.
b
Juicy
a
Amazingly, we're actually working towards fixing this, but still, I get sad every time I look at how long it takes to pull one of these images without cache, heh
Anyway, thank you, @curved-television-6568, we'll test this but it looks like exactly what we want, albeit in a roundabout way
👍 1
I assume this pex will also have a corresponding cache entry as well?
c
yep, it should all be nicely cached.
a
If we manage to get the pants resolving transitive deps time down from the 3+ minutes it is sometimes, that'd be great, but from my past conversations, that's probably a matter of using lockfiles
Which will take quite a bit of work, since we use parametrised interpreter constraints, which breaks it
👀 1
Yeah, that's a question for another, soberer, time 😄
😬 1