Hello! I'm currently upgrading from Pants 2.15 to ...
# general
h
Hello! I'm currently upgrading from Pants 2.15 to the newest release 2.18. I thought that the Add cache-to and cache-from options pull request was merged on Sep 18, but I can't seem to find those changes in the source code of src/python/pants/backend/docker/goals/package_image.py of the main branch nor the source code of the release_2.18.0 so running
pants publish
Copy code
docker_image(
    name="with-local-cache-backend",
    cache_to={
        "type": "registry",
        "mode": "max",
        "ref": "[REDACTED]",
    },
    cache_from={
        "type": "registry",
        "ref": "[REDACTED]",
    },
)
Is throwing
Copy code
InvalidTargetException: src/BUILD:1: Unrecognized field `cache_to={'type': 'registry', 'mode': 'max', 'ref': '[REDACTED]'}` in target [REDACTED]. Valid fields for the target type `docker_image`: ['build_network', 'build_platform', 'context_root', 'dependencies', 'description', 'extra_build_args', 'extra_build_hosts', 'image_labels', 'image_tags', 'instructions', 'output_path', 'pull', 'registries', 'repository', 'restartable', 'secrets', 'skip_push', 'source', 'squash', 'ssh', 'tags', 'target_stage'].
So I'm wondering if I'm missing something or the code isn't there anymore for some reason! Thanks for taking the time to look into this!
c
It is on
main
still.. but not part of
2.18
release series, as that was cut before that PR was merged. https://github.com/pantsbuild/pants/blob/5cb1a91e32030a87c7aff1a6ea9a646c5470597f/src/python/pants/backend/docker/target_types.py#L325-L382
It’ll be part of the
2.19.0
release.
h
Perfect thanks for the clarification! Can't wait to see this improve our pipeline building speed 😁
πŸ‘ 1
p
FYI, I have been trying it and the 2.19.0a0 release did not actually work for me and I needed to build from source for get a fix from 2 days ago
πŸ‘€ 1
πŸ‘ 1
c
yes, that fix will be in the next release candidate.