Is the Docker `cache_to` scope working correctly h...
# development
w
Is the Docker
cache_to
scope working correctly here? Pretty sure I want them all labeled the same
1
b
What are you setting the option to? (I’d guess that this is entirely docker behaviour, not pants, but we should confirm…)
w
Copy code
docker_image(
    name="gcc-arm-none-eabi",
    cache_from=[{"type": "gha", "scope": "gcc-arm-none-eabi-gha"}],
    cache_to={"type": "gha", "mode": "max", "scope": "gcc-arm-none-eabi-gha"},
)
Note: Haven't yet debugged pants - just checking if anyone knows offhand.
example-docker
has this too - but 🤷 I'm going to try building multiple images too - to see if the caches wipe each other out, or if they use different names
This feels like weird behaviour given the docs https://docs.docker.com/build/cache/backends/gha/#scope
Like, I mean, they have a SHA attached - but just hard to read what belongs to what - is what I mean
Yeah, we really don't do much with this eh
Copy code
"/usr/bin/docker", "buildx", "build", "--cache-from=type=gha,scope=gcc-arm-none-eabi-gha", "--cache-to=type=gha,mode=max,scope=gcc-arm-none-eabi-gha"
b
okay, so sounds like it's just docker behaviour, nothing from pants?
w
Yeah, that's what I'm seeing after digging into the code of docker and buildkit a bit and running a bunch of images at once. I guess the reasoning is that - so long as the SHA is correct, having something generically named "buildkit-blob" might be a good idea, because so long as it's a cache hit - it shouldn't matter who uses it downstream. Definitely makes it trickier to figure out who generated the cache though 🤷
Guessing the index must just be a manifest file or something - need to pull one down
b
Makes sense... and there may not be any other "useful" identifier, e.g. if those are blobs of layers that can be shared between images, the only identifier they have might be their content => i.e. a hash. Maybe?
w
That's my guess - there must be a ticket or override somewhere to modify the prefix of those, at least in debugging. I think if I can pull down an index file from the cache, it'd be quick to figure it out. This, if I had to wildly guess - which I hope I won't have to, if I can figure out how to download that file.
gh
client lets me list and delete, but not grab 😆