Skip to content

Test: Kernel communication upgrade #8024

@rchiodo

Description

@rchiodo

Refs: #7675

Complexity: 4

Create Issue


We've upgraded our internal library we use for communicating with kernels in the Jupyter extension to the latest jupyter lab services API

This version of the npm module looks to be a complete rewrite so we'd like to regression test all forms of communication with jupyter kernels.

Setup steps:

  1. Install some version of python
  2. Make sure you have pip installed
  3. Install Jupyter extension from marketplace (it is updated nightly, so it will have this month's changes in it)
  4. Install insiders Python extension

Test steps: (repeat multiple times)

  1. Create a python environment using either venv or conda. Alternatively you can use an existing environment.
  2. If using conda, try creating environments with different versions of python
  3. Open VS code in a new folder (if using venv, make sure the venv you created is located at the same root)
  4. Create a python file like so:
# %%
print('run cell')
  1. A bunch of code lenses should appear.
  2. Try using all of them
  3. You should be prompted to install ipykernel (if you haven't already)
  4. Try restarting the kernel
  5. Run a cell again, make sure it runs
  6. Run the following cell
import sys
!{sys.executable} -m pip install tqdm
  1. Add another cell like so (through the input box or the python file)
# %%
from tqdm import trange
import time
for i in trange(100):
    time.sleep(0.1)
  1. Make sure you can interrupt running of this cell, by clicking Interrupt at the top of the Interactive-1 editor.
  2. After interrupting make sure the kernel is still usable
  3. Using File | New File ... create a jupyter notebook
  4. Try the interrupt code in the notebook too
  5. Try restarting the kernel in the notebook too.
  6. Opening your settings.json and add this hidden setting:
    "jupyter.disableZMQSupport": true
  1. Rerun the steps above with that setting

Testing remote: (doesn't need to be done multiple times)

  1. On one of the venvs or conda environments you created before, install full jupyter
  2. In a command prompt, switch to your workspace folder
  3. Activate your venv/conda environment
  4. Run jupyter notebook. It should output something like so:
[I 12:12:55.526 NotebookApp] Serving notebooks from local directory: D:\Source\Testing_3
[I 12:12:55.526 NotebookApp] Jupyter Notebook 6.2.0 is running at:
[I 12:12:55.526 NotebookApp] http://localhost:8888/?token=44a6967a96e31890585f51b1d64e50811917ba5d9d555ab3
[I 12:12:55.526 NotebookApp]  or http://127.0.0.1:8888/?token=44a6967a96e31890585f51b1d64e50811917ba5d9d555ab3
[I 12:12:55.527 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 12:12:55.675 NotebookApp]

    To access the notebook, open this file in a browser:
        file:///C:/Users/aku91/AppData/Roaming/jupyter/runtime/nbserver-10188-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=44a6967a96e31890585f51b1d64e50811917ba5d9d555ab3
     or http://127.0.0.1:8888/?token=44a6967a96e31890585f51b1d64e50811917ba5d9d555ab3
  1. Start VS code in the same workspace folder
  2. Run this command:
    image
  3. Pick Existing on the first quick pick
  4. Copy the URL from your terminal into the second quick pick.
  5. Restart VS code
  6. Run the steps above but use the default 'python 3' kernel (debugging doesn't work just yet)
  7. Make sure interrupt and restart tasks work

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions