-
Notifications
You must be signed in to change notification settings - Fork 84
Allow specifying server prefix and R path #170
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
base: main
Are you sure you want to change the base?
Conversation
|
This seems like a useful addition! Ideally jupyter-server-proxy would be able to support multiple instances of an application like One possible issue about the implementation in this PR is the relationship between jupyter-server-proxy's URL prefix as determined by the dictionary key and the {"foo": setup_rserver(prefix="bar")},
One could try to address this with documentation. Another method is to wrap |
|
Thanks for the suggestions @ryanlovett! I'm happy to add some documentation, or to wrap |
|
@ryanlovett I've added some documentation now. Let me know if you think this is clear, and suffices. I've opted against wrapping |
|
Any thoughts @ryanlovett? Alternatively we could also provide a convenience method to return config for multiple rstudio servers, e.g.: # take a list of dicts and return a dict that can be passed to c.ServerProxy.servers.update
# e.g:
# servers = [{'prefix': 'rstudio1', 'r_path': '/usr/bin/R', 'launcher_title': 'some rstudio'}, {'prefix': 'rstudio1', 'r_path': '/usr/bin/R', 'launcher_title': 'some rstudio'}]
# c.ServerProxy.servers.update(setup_rservers(servers))
def setup_rservers(servers):
return dict([(server['prefix'], setup_rserver(r_path=server['r_path'], prefix=server['prefix'], launcher_title=server['launcher_title'])) for server in servers]) |
Thanks for this neat package!
I would like to use the
setup_rserverfunction from this module to add multiple RStudio servers to a JupyterHub environment. This can in principle be done by manually callingc.ServerProxy.servers.update({...})from within ajupyter-server-proxyfile. However, currentlysetup_rserverdoes not:This PR addresses these issues by adding optional keyword arguments to
setup_rserver, and by usingrserver's--rsession-which-roption when it is available.This makes it possible to add multiple servers from within a
jupyter-serverconfig file like so: