sidora-tools / sidora.cli

A CLI for terminal based data extraction and summary for the MPI-SHH Department of Archaeogenetics PANDORA Database
Other
0 stars 0 forks source link

Cache management #15

Closed nevrome closed 4 years ago

nevrome commented 4 years ago

The current default for caching downloaded Pandora tables is to store them in a directory /tmp/sidora.cli_table_cache and considering the data there as valid for 24 hours. This is inconvenient for development (as cached versions might be outdated) and might cause problems on the cluster, where all users are sharing this cache (e.g. one user deletes the cache while another one tries to load it into memory). The /tmp dir can also not be accessed from the cluster nodes.

Options:

TCLamnidis commented 4 years ago

Users could have their own cache placed automatically within their users directories with something like this:

> library(R.utils)
> file.path("/projects1/users/",System$getUsername(),"/.sidora.cli.cache", fsep="")
[1] "/projects1/users/lamnidis/.sidora.cli.cache"

Then forcing an update of the cache would not break down anyone else's jobs

jfy133 commented 4 years ago

I would rarely use sidora on the cluster, rather using it as look up on my laptop, so I don't like that idea.

jfy133 commented 4 years ago

What about a temporary hidden file in a user's home directory? The files are still small iirc and it would be more portable. ~/.sidora?

nevrome commented 4 years ago

When we talked about it @TCLamnidis pointed out that the home directories (~) are apparently very small and he personally has reached the size limit. But honestly: We're talking about less then 10mb atm. I agree with @jfy133 that this should fit in!

image

jfy133 commented 4 years ago

This might also be useful in the future if we allow further customisations, maybe if for the report function you can supply your own 'template'? Those could go there too. That's just random idea, no idea if implementable/reasonable

nevrome commented 4 years ago

The default caching dir is now ~/.sidora and a new option --empty_cache allows to quickly empty the cache. I therefore consider the issue closed.