#Cannot retrieve path from cache
1 messages · Page 1 of 1 (latest)
You can mount it and rm -rf everything inside
How are you trying to wipe it?
I solved the problem by remounting the cache in the Function where I needed the File instead of passing the Container that created the file and using container.file().
I do not think I should have had to do that, though.
Cannot retrieve path from cache
@solemn sinew IIUC you're attempting to pass a file around from a mounted cache, correct?
Yes, but it should also be possible to access the file from the container, as I was doing before I added a cache. Caching should not have broken the existing code.
yeah, I see what you mean. Cache volumes are a tricky one since they don't really become part of the snapshotted operations within the DAG. That's why they have this custom behavior of not being able to retrieve things from it via the core APIs.
Can't recall if there's a particular issue about this but definitely something we should try to support somehow to avoid breaking pipelines like this.
@solemn sinew if you have the time mind creating an issue?
thx. Appreciate it
Now I'm trying to prevent the cached file from getting garbage collected. I have a container with
.with_mounted_cache("/build", dag.cache_volume('build'))
.with_entrypoint(["java", "-jar", f"/build/libs/{consts.MONOLITH_JAR}"])
but once the cache gets garbage collected it can't find the jar any more.
Is there a way you could provide a simple repro?
I need to see what you're doing so when the garbage collection cleans the cache volume your pipeline fails. In generally the rule of thumb is that there needs to be a correlation between the steps that populate your cache volume with the steps that use it so if your inputs change, everything should still be consistent