Allow specifying server prefix and R path#170
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]) |
|
A happy new year and a small ping about this PR to @ryanlovett :) |
|
Still waiting for feedback on this PR. Anything I can do to help this get merged? |
|
Sorry for the delay @dometto ! |
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: