#Cannot retrieve path from cache

1 messages · Page 1 of 1 (latest)

solemn sinew
#

I'm getting "cannot retrieve path from cache"

jolly coyote
jolly coyote
solemn sinew
#

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.

solemn sinew
#

Cannot retrieve path from cache

jolly coyote
#

@solemn sinew IIUC you're attempting to pass a file around from a mounted cache, correct?

solemn sinew
#

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.

jolly coyote
# solemn sinew Yes, but it should also be possible to access the file from the container, as I ...

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?

solemn sinew
jolly coyote
solemn sinew
#

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.

jolly coyote