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

Plan for moving Jupyter Hub support to a separate extension #14202

Closed
2 of 6 tasks
DonJayamanne opened this issue Aug 28, 2023 · 3 comments
Closed
2 of 6 tasks

Plan for moving Jupyter Hub support to a separate extension #14202

DonJayamanne opened this issue Aug 28, 2023 · 3 comments

Comments

@DonJayamanne
Copy link
Contributor

DonJayamanne commented Aug 28, 2023

Refs: #13973, #13894

(please do not use Web, this will not work in vscode.dev)
Complexity: 5

Authors: @DonJayamanne

Create Issue


Note

This test plan is only used to verify the following hypothesis:

  • We can connect to the latest version of Jupyter Hub
  • 3rd party extension can use the Jupyter API to contribute Jupyter Servers
  • We can move Jupyter Hub into a separate extension

Pre-Requisites

Install and launch Jupyter Hub

https://jupyterhub.readthedocs.io/en/1.2.0/installation-guide-hard.html

  1. Create a new folder
  2. Create a file named jupyterhub_config.py and paste the below contents into that file
    1. Custom config to make auth easier, else you need use your login creds, which I guess you don't want to use.
# Configuration file for jupyterhub.

c = get_config()  #noqa
c.JupyterHub.authenticator_class = 'jupyterhub.auth.DummyAuthenticator'
c.DummyAuthenticator.password = "pwd" # Feel free to change the default password
c.Spawner.args = ['--NotebookApp.allow_origin=*']
from jupyterhub.spawner import SimpleLocalProcessSpawner
c.JupyterHub.spawner_class = SimpleLocalProcessSpawner
  1. Create a virtual env in this folder using Python extension
  2. Install Jupyterhub using the CLI python -m pip install jupyterlab jupyterhub
  3. Install the npm package configurable-http-proxy globally via the cli npm i -g configurable-http-proxy
  4. Now start Jupyter Hub using the cli jupyterhub (ensuring the cwd in the terminal is the same folder in step 1 and your virtual env is in the same folder under .venv)
  5. In the browser navigate to Jupyter Hub login page, genrally http://localhost:8000
  6. Enter any user name and password as pwd
  7. You will be take to Jupyter Lab page
    This will take a few seconds, as Jupyter Hub will start a Jupyter Lab server on your machine
  8. Verify you have Jupyter Lab running

Steps to test

  1. Go into VS Code, open a notebook
  2. From the kernel picker select Existing JupyterHub Server...
  3. Enter the Jupyter Hub Url http://localhost:8000 (that shouldbe all)
  4. Verify you are prompted for your user name and password (remember password is pwd)
    Note: Remember to use the same user name (else it will not work, these are things to be ironed out later)
  5. Verify you now get a list of Kernels in the kernel picker
  6. Verify you can select a kernel and run code against this kernel
@Yoyokrazy Yoyokrazy added this to the August 2023 milestone Aug 28, 2023
@ghost ghost assigned rebornix and Yoyokrazy Aug 29, 2023
@rebornix
Copy link
Member

It's working great, my custom config is

c.JupyterHub.authenticator_class = "dummy"
c.DummyAuthenticator.password = "pwd" # Feel free to change the default password
c.Spawner.args = ['--NotebookApp.allow_origin=*']
c.Spawner.default_url = '/lab'
from jupyterhub.spawner import SimpleLocalProcessSpawner
c.JupyterHub.spawner_class = SimpleLocalProcessSpawner

I got error "username/password not correct" at the first time but turns out that I'm using wrong url 127.0.0.1:8081 other than 127.0.0.1:8000. After trying that in the browser, I figured this out as in the browser it's a 5xx error. It would be great if the error message we present is more accurate but I guess it's a corner case as usually users already have jupyter hub running successfully.

@joyceerhl
Copy link
Contributor

I hit this on Windows

preexec_fn is not supported on Windows platforms
    Traceback (most recent call last):
    NoneType: None

I uninstalled WSL earlier today for another TPI, trying Dev Box now

@joyceerhl
Copy link
Contributor

As far as I can tell, this does not work on Windows, but it worked in a codespace

@joyceerhl joyceerhl removed their assignment Aug 30, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants