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

Feature: Cache Location #130

Open
hakasapl opened this issue Mar 7, 2021 · 2 comments
Open

Feature: Cache Location #130

hakasapl opened this issue Mar 7, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@hakasapl
Copy link

hakasapl commented Mar 7, 2021

This is a feature request.

I'm running gator on a clustered installation served using JupyterHub. After looking over the code I've learned how gator caches packages - using the /tmp folder on the system and writing to everyone. Traditionally, this folder is not clustered - it is specific to the server. It would be great to have an option to set the "cache" location, in my case that would be a shared network location. That way when a cache gets updated it gets updated across the cluster.

I could work on a PR for this - although I'm not sure where you'd want the configuration option for this to live?

@fcollonval fcollonval added the enhancement New feature or request label Mar 8, 2021
@fcollonval
Copy link
Member

Thanks for reaching out @hakasapl

I could work on a PR for this - although I'm not sure where you'd want the configuration option for this to live?

The line that need to be parametrized is:

https://github.com/mamba-org/gator/blob/master/mamba_gator/handlers.py#L368

The ideal approach

In Jupyter ecosystem, it is recommended to use Configurable object for server settings. You can look at an example
in jupyterlab-github.

Basically, once you have define the configurable and loaded it (see that line), you can add an option when starting the server; e.g. with the github extension

jupyter lab --GitHubConfig.access_token='< YOUR_ACCESS_TOKEN >'

or set it in a configuration file https://jupyter-server.readthedocs.io/en/stable/users/configuration.html

The quick approach

You can try reading a environment variable as the cache file. And if it does not exist fall back to the default.

You can even combine the two by defining a default for function for the settings - see for example: https://github.com/krassowski/jupyterlab-lsp/blob/master/python_packages/jupyter_lsp/jupyter_lsp/manager.py#L81

@hakasapl
Copy link
Author

hakasapl commented Mar 8, 2021

Thanks for this info, I would also prefer the ideal approach (or maybe both?). Let me do some more research on this and hopefully, I can get something going.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants