question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Syncing local python project files with remote Jupyter server

See original GitHub issue

Feature: Notebook Editor, Interactive Window, Python Editor cells

Description

Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer

Context

VSCode allows users to connect with a running remote Jupyter server (https://code.visualstudio.com/docs/python/jupyter-support#_connect-to-a-remote-jupyter-server). Using the Jupyter API it is able to start a kernel and execute cells of a locally saved notebook remotely.

Use case/problem

If you want to for example call a function from another python file (foo.py) from that notebook (local-notebook.ipynb), the remote kernel can’t access local files. The remote kernel can access other files saved on the remote notebook server. The problem is that local (Python) files are not synced with the remote Jupyter server instance, for the remote Python interpreter (kernel) to access them.

Existing solutions

The standard way of achieving this is through rsync over SSH. However this default requires managing a SSH connection and SSH keys (which large entreprises servers not necessarily allow). There are workarounds (manually uploading files through the notebook UI, and using git), but these inhibit development and iteration speed.

Proposal

Extend the VSCode Python extension to allow users to sync files with a remote running Jupyter notebook server. Under the hood, the Jupyter contents API can be used for this:

Authentication and authorization is handled through the API token that you need anyway to connect.

No SSH, git or manual hassle required.

Additionally, you can execute your local code (by calling it through the notebook) remotely without having to manage a remote Python SSH interpreter, or docker images. All you need is a running jupyter notebook.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:68
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
IanMatthewHuffcommented, May 26, 2020

@brunocous Thanks for the detailed suggestion. I do feel that this would be an interesting suggestion to consider. We’ll discuss it at our triage meeting.

1reaction
rchiodocommented, Jan 5, 2022

@alfredodeza thanks for the upvote. There’s no recommended way to sync files other than for you to put them in the same folder where you started the remote server (that will make the relative paths work correctly).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Syncing local project files with remote Jupyter server : PY-42649
The problem is that local (Python) files are not synced with the remote Jupyter server instance, for the remote Python interpreter (kernel) to...
Read more >
How to Install, Run, and Connect to Jupyter Notebook on a ...
If you installed Jupyter Notebook on a remote server, you will need to connect to the Jupyter Notebook web interface using SSH tunneling....
Read more >
Running Jupyter Notebooks on Remote Servers
I execute the jupyter notebook command with the --no-browser flag to start the Jupyter notebook with launching a browser since the remote server ......
Read more >
Working with Jupyter Notebooks in Visual Studio Code
Jupyter (formerly IPython Notebook) is an open-source project that lets you easily combine Markdown text and executable Python source code on one canvas ......
Read more >
Coding on the Remote Server via pyCharm - Medium
As data enthusiasts, we often need to run codes in remote servers because we need computation power and sufficient memory. As I came...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found