#Comprehending cache and pruning

1 messages · Page 1 of 1 (latest)

hollow oriole
#

So I've got a service, let's call it serviceA. It needs a db, db. The db has to receive migrations (run within a different container containerB) then serviceA can start, finally (before serviceA (a.k.a. temporal server) can be used for doing servicy things) we have to run a final setup step on the db (using containerB again). Then we are able to start (and deliver) serviceC (a.k.a temporal ui).

  1. start db (with CacheVolume)
  2. exec migrations with containerB
  3. start serviceA
  4. exec namespace creation with containerB
  5. start serviceC (with binding to serviceA

This all seems to work fine when starting from absolute scratch. If, after seeing it all work, I clear the dagger cache and restart then it goes completely haywire; the migrations never run in containerB. However, if I clear the dagger cache, stop dagger, and do docker system prune -af and then restart the stack it works fine.

So I'm inferring that the the CacheVolume is cleared when clearing the dagger cache, but it seems that the other stuff which is cached (like the execution of the function that execs the migrations, e.g. the equivalent of a docker image layer) does not get cleared. Does that seem right?

Claude tells me that I should mount the CacheVolume in containerB so that when the cache is cleared the migration function will run again, that seems like a hallucination to me. Is that the right way to manage clearing "layers"?

slate grove
# hollow oriole So I've got a service, let's call it `serviceA`. It needs a db, `db`. The db has...

hey @hollow oriole catching up with help threads and just noticed this unanswered one.

So I'm inferring that the the CacheVolume is cleared when clearing the dagger cache, but it seems that the other stuff which is cached (like the execution of the function that execs the migrations, e.g. the equivalent of a docker image layer) does not get cleared. Does that seem right?

seems strange that calling local-cache prune doesn't invalidate the migrate step. It shouldn't do that so if you could help us by providing a simple repro of this case that'd be much appreciated.

#

assuing that local-cache prune is what you're using to clear the cache

#

Claude tells me that I should mount the CacheVolume in containerB so that when the cache is cleared the migration function will run again, that seems like a hallucination to me. Is that the right way to manage clearing "layers"?

yes, this is incorrect