Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new PINS_CACHE_PATH env var, plus documentation #748

Merged
merged 3 commits into from
Jun 7, 2023

Conversation

juliasilge
Copy link
Member

Closes #747

With these changes, we can now use an environment variable to specify where the cache goes:

withr::local_envvar(list("PINS_CACHE_PATH" = "~/Desktop"))
server <- pins:::rsc_server(auth = "envvar")
pins::board_cache_path(paste0("connect-", rlang::hash(server$url)))
#> ~/Desktop/connect-31a399613ac85efda77ffe6ff20c105a

Created on 2023-06-02 with reprex v2.0.2

This also finally fixes #611 by documenting how the env variables work, with some advice on a read-only filesystem like AWS Lambda.

R/board.R Outdated Show resolved Hide resolved
R/board.R Outdated Show resolved Hide resolved
@machow
Copy link
Collaborator

machow commented Jun 7, 2023

I just double checked in pins-python, and apparently it uses PINS_CACHE_DIR as an optional env var for overriding the cache directory. (I don't think this is documented, and probably exists for unit tests..). May be useful to change here or there to match env vars?

https://github.com/rstudio/pins-python/blob/7ded06943c6ea3236e5da4443a3869073d66aeb1/pins/config.py#L8

@juliasilge
Copy link
Member Author

Thanks to both!

@machow I changed the env var here so it matches what pins for Python has. 👍

@juliasilge juliasilge merged commit ec05d3e into main Jun 7, 2023
@juliasilge juliasilge deleted the pins-cache-path branch June 7, 2023 22:03
@github-actions
Copy link

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assignment of non-standard cache folder .onLoad fails in loadNamespace on read-only filesystem (AWS lambda)
3 participants