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

Support Jupyverse as a single-user server #4520

Merged
merged 8 commits into from
Aug 30, 2023

Conversation

davidbrochart
Copy link
Contributor

With jupyter-server/jupyverse#335, this will allow to use Jupyverse as a single-user server.

@davidbrochart
Copy link
Contributor Author

@minrk How do you feel about this PR?
Jupyverse being an official Jupyter server, I think JupyterHub should support it, just like jupyter-server. With this PR, jupyverse is picked up as the single-user server when it is installed. If it's not installed, everything should work as before.

Copy link
Member

@minrk minrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's sensible to support it, but the PR needs to be updated, since it currently changes the default server to jupyverse.

The defaults and priority should be kept as they are, but adding a new value for JUPYTERHUB_SINGLEUSER_APP=jupyverse so it's opt-in seems AOK.

Make sure to add a test matrix entry with this env so it's exercised.

jupyterhub/singleuser/__init__.py Outdated Show resolved Hide resolved
@minrk minrk added the new new features label Aug 1, 2023
@davidbrochart davidbrochart force-pushed the jupyverse branch 2 times, most recently from 003e8e5 to 6b3d4a0 Compare August 2, 2023 10:27
@davidbrochart davidbrochart force-pushed the jupyverse branch 2 times, most recently from 70ed684 to 649cb9d Compare August 3, 2023 13:17
@davidbrochart
Copy link
Contributor Author

I skipped some tests that I see as jupyter-server specific.
What do you think about merging this PR (once I release jupyverse), and I'll re-enable the tests in the future? I think it's already a good start, the skipped tests are mostly related to server extensions that are managed differently in jupyverse.

Copy link
Member

@minrk minrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! There are two tests that are currently skipped that I think should be fixed instead of skipped. Once those pass, I think this should be fine to land.

@@ -167,6 +173,10 @@ async def test_disable_user_config(request, app, tmpdir, full_spawn):
)
assert r.status_code == 200

if IS_JUPYVERSE:
# the remaining is jupyter-server specific
return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than returning, this should verify that no jupyverse config files are loaded from $HOME.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think this is jupyter-server specific. Jupyverse uses the Asphalt application framework where configuration files are passed explicitly, so there is no notion of looking up directories for configuration files.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, then I'd just update the comment to say that jupyverse never loads any configuration from the home directory, and the skip can move to the top of the test, since there's nothing to check for jupyverse.

@@ -63,6 +65,8 @@ async def test_singleuser_auth(
await user.spawn(server_name)
await app.proxy.add_user(user, server_name)
spawner = user.spawners[server_name]
if IS_JUPYVERSE:
spawner.default_url = "/lab"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if this is missing? Is it because the default url for jupyverse is not /tree?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, just like JupyterLab has no /tree endpoint.

@@ -202,6 +212,9 @@ def assert_not_in_home(path, name):
async def test_notebook_dir(
request, app, tmpdir, user, full_spawn, extension, notebook_dir
):
if IS_JUPYVERSE:
pytest.skip("jupyter-server specific test")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is not jupyter-server specific, it's verifying if the root directory config is respected. The mechanism of the test (specifically the use of the test extension utility) may need different handling, but the API calls to the contents API should produce the same results.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jupyverse has no root directory config (yet), what do you think about re-enabling this test if/when there is support for it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@minrk what do you think about merging this?

@@ -176,6 +182,13 @@ jobs:
if [ "${{ matrix.jupyter_server }}" != "" ]; then
pip install "jupyter_server==${{ matrix.jupyter_server }}"
fi
if [ "${{ matrix.jupyverse }}" != "" ]; then
pip install "git+https://github.com/davidbrochart/jupyverse.git@jupyterhub#egg=fps_auth_jupyterhub&subdirectory=plugins/auth_jupyterhub"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this PR's been merged? Can we depend on 0.2.1 now? If so, 👍 to merge with the updated install command.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this PR's been merged?

Ah no, you're right. I'll make a jupyverse release and update the install command.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@minrk it should be good to go now.

@minrk minrk merged commit 63d2229 into jupyterhub:main Aug 30, 2023
18 checks passed
@minrk
Copy link
Member

minrk commented Aug 30, 2023

Thanks!

@davidbrochart davidbrochart deleted the jupyverse branch August 30, 2023 09:05
@davidbrochart
Copy link
Contributor Author

Thanks, do you plan to release soon?

@minrk
Copy link
Member

minrk commented Aug 30, 2023

Not immediately, we have some things to finish first. Hopefully before too long, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants