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

Automate remote ssh kernel setup and connection #358

Open
jacksund opened this issue Jan 2, 2022 · 6 comments
Open

Automate remote ssh kernel setup and connection #358

jacksund opened this issue Jan 2, 2022 · 6 comments

Comments

@jacksund
Copy link

jacksund commented Jan 2, 2022

Hello! This is a feature-request, but I hope opening an issue is fine.

EDIT: The original issue has been rewritten for clarity

Current implementation

Users must follow along with the remote kernel tutorial. This involves...

  1. manually signing in to a remote cluster (ssh)
  2. starting a kernel with python -m spyder_kernels.console
  3. starting a separate terminal / file-transfer window to find the connection json file
  4. copying the connection_info json file to local computer
  5. use Spyder's remote kernel dialog to (a) give the file and (b) rewrite ssh info.

Problem

The steps above can be very tedious because it involves multiple terminal and file transfers. In most cases, I'll just stick with ipython on the remote cluster, rather than using Spyder.

Possible Solutions

  1. (partial solution) Have python -m spyder_kernels.console print out the connection json, which can be copied directly into the Spyder dialog. It'd be an alternative to selecting a file here:
    image

  2. From the spyder dialog, pass the SSH connection information to fabric. Then use fabric to run python -m spyder_kernels.console and grab the connection info. Spyder then starts a new console using this connection info and the original SSH connection.

For solution 1 --> Based on the ipython recipe, it might be possible by having spyder call %connect_info as soon as the kernal is started. I know very little about kernels though.

@jacksund
Copy link
Author

jacksund commented Jan 3, 2022

As an update, I wrote a simple class based on fabric to make this process easier for me. The code might be useful if your team decides to implement these features. You can find that code here.

EDIT: switched reference code to an older version that doesn't use a jobqueue

@jacksund jacksund changed the title Feature Request: print connection_info JSON automate remote ssh kernal setup and connection Jan 9, 2022
@ccordoba12
Copy link
Member

This is a very interesting idea and would simplify the process to connect to remote kernels a lot. Thanks for the suggestion!

We'll try to implement it in a future release.

@ccordoba12 ccordoba12 changed the title automate remote ssh kernal setup and connection Automate remote ssh kernel setup and connection Jan 9, 2022
@matifali
Copy link

Any updates?

@ccordoba12
Copy link
Member

ccordoba12 commented Aug 25, 2022

No, sorry. We've been asking for funding to work on this for the last two years but we haven't gotten it yet.

@matifali
Copy link

Now, most IDEs provide a direct and simpler way to connect to a remote server over ssh,

  1. VS code through remote VS code extension

  2. JetBrains through Gateway

  3. Spyder is the only one missing.

@dhirschfeld
Copy link

3. Spyder is the only one missing

https://opencollective.com/spyder

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

No branches or pull requests

4 participants