register_remote_kernel(remote_python='/Users/shawley/exercises/solveit/.venv/bin/python')ipyf_remote_kernel is already a registered kernel
ipyfernel
The remote kernel needs to be speified by the user. The SSH config will typically be called by other routines since the port is usually changing each time.
def register_remote_kernel(
remote_python:str='/path/to/python', # Full path of Python executable to run on remote system.
kernel_name:str='ipyf_remote_kernel', # Any old name will do. This is fine.
display_name:str='Remote Python', # This is just what you'll see when you look at a list.
ssh_host_alias:str='remote_server_sshpyk', # Same alias as was used in writing to ssh config file.
remote_kernel_name:str='python3', # Typical for Jupiter.
language:str='python', # Probably want to leave this unless you want to try R.
verbose:bool=True, # Print extra info.
):
registers which python kernel will be used on remote machine
ipyf_remote_kernel is already a registered kernel
def set_ssh_config(
port:int, # Port number on proxy server (e.g. bore.pub)
user:str='', # Username on remote system.
alias:str='remote_server_sshpyk', # Default alias for `sshpyk`, leave it alone
proxyname:str='bore.pub', # Have tested this with bore
config_path:str='~/.ssh/config', # Shouldn't need to change this.
):
(called by ipf_startup) sets up user’s ssh .config file with info used later
These back-end routines typically don’t need to be called directly by the user; rather they’re called by the user interface routines.
Start up the remote kernel
Execute code on the remote kernel.
Terminates the remote kernel
Connect to existing remote kernel
These are the main routines you’ll typically use:
%%remote and %%localConfigure ssh connection to remote server and start remote server
shutdown remote server
These line or cell magics, invoked via ‘%’ or ‘%%’ respectively, will direct execution of a line or cell to occur on the appropriate system – “remote” or “local”, where local means in the current notebook.
remote exeuction: works as %remote and as %%remote
Hello from 41bcdf3ad182
^ “Chonk” is the name of my home laptop
local execution: works as %local and as %%local
Hello from c54fa983f332
^“c54fa983f332” happens to be the name of the solvent instance currently running.
via Input Transformers. These can make cells set execute remotely by default.
WARNINGS: 1. Solve it is not intended to work with people modifying input transformers So be wary. Nevertheless, this seems to work. 2. If they’re commands that you definitely want to execute locally, maybe run %unset_sticky just to be sure first.
Makes code cells execute remotely, via input transformer
Un-sticks remote execution for code cells
Hello from c54fa983f332