Keybase Filesystem Backing Store for ‘memoise’ Caching
Keybase https://keybase.io provides 250GB free, encrypted storage making it suitable for creating a cross-system backing store for ‘memoise’ caches. Tools are provided to use Keybase with ‘memoise’.
The following functions are implemented:
cache_fs2
: Alternative to memoise::cache_filesystem()cache_kb_self
: Convenience function to cache to your own public or private Keybase foldercache_kb
: Keybase backed cache for cross-system cachingplatform
: Execution platform
install.packages("kbmemoise", repos = c("https://cinc.rud.is", "https://cloud.r-project.org/"))
# or
remotes::install_git("https://git.rud.is/hrbrmstr/kbmemoise.git")
# or
remotes::install_git("https://git.sr.ht/~hrbrmstr/kbmemoise")
# or
remotes::install_gitlab("hrbrmstr/kbmemoise")
# or
remotes::install_bitbucket("hrbrmstr/kbmemoise")
# or
remotes::install_github("hrbrmstr/kbmemoise")
NOTE: To use the ‘remotes’ install options you will need to have the {remotes} package installed.
library(kbmemoise)
# current version
packageVersion("kbmemoise")
## [1] '0.1.0'
kbc <- cache_kb_self(".cache")
kbc$location()
## [1] "/Volumes/Keybase/private/hrbrmstr/.cache"
mrunif <- memoise::memoise(runif, cache = kbc)
mrunif(10) # First run, saves cache
## [1] 0.5687944 0.5739892 0.4309080 0.1959454 0.7240059 0.4751237 0.4049415 0.6617540 0.7025730 0.9428181
mrunif(10) # Loads cache, results should be identical
## [1] 0.5687944 0.5739892 0.4309080 0.1959454 0.7240059 0.4751237 0.4049415 0.6617540 0.7025730 0.9428181
kbc$keys()
## [1] "abb4b2ca91214fd892622aa50f4f5dc98d1453ae577cd916e60e02ebda8bbe7d75ff93d1fdd81967edced64de89833361e7f150cfae4898acb70b1aac932e791"
kbc$size()
## [1] 291
kbc$reset()
kbc$size()
## [1] 0
Lang | # Files | (%) | LoC | (%) | Blank lines | (%) | # Lines | (%) |
---|---|---|---|---|---|---|---|---|
R | 5 | 0.83 | 97 | 0.85 | 33 | 0.58 | 91 | 0.72 |
Rmd | 1 | 0.17 | 17 | 0.15 | 24 | 0.42 | 36 | 0.28 |
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.