Zero-Deploy RPyC¶
New in version 3.3.
Requires [plumbum](http://plumbum.readthedocs.org/)
-
class
rpyc.utils.zerodeploy.
DeployedServer
(remote_machine, server_class='rpyc.utils.server.ThreadedServer', extra_setup='', python_executable=None)[source]¶ Sets up a temporary, short-lived RPyC deployment on the given remote machine. It will:
- Create a temporary directory on the remote machine and copy RPyC’s code from the local machine to the remote temporary directory.
- Start an RPyC server on the remote machine, binding to an arbitrary TCP port,
allowing only in-bound connections (
localhost
connections). The server reports the chosen port overstdout
. - An SSH tunnel is created from an arbitrary local port (on the local host), to the remote machine’s chosen port. This tunnel is authenticated and encrypted.
- You get a
DeployedServer
object that can be used to connect to the newly-spawned server. - When the deployment is closed, the SSH tunnel is torn down, the remote server terminates and the temporary directory is deleted.
Parameters: - remote_machine – a plumbum
SshMachine
orParamikoMachine
instance, representing an SSH connection to the desired remote machine - server_class – the server to create (e.g.,
"ThreadedServer"
,"ForkingServer"
) - extra_setup – any extra code to add to the script
-
connect
(service=<class 'rpyc.core.service.VoidService'>, config={})[source]¶ Same as
connect()
, but with thehost
andport
parameters fixed
-
classic_connect
()[source]¶ Same as
classic.connect
, but with thehost
andport
parameters fixed
-
class
rpyc.utils.zerodeploy.
MultiServerDeployment
(remote_machines, server_class='rpyc.utils.server.ThreadedServer')[source]¶ An ‘aggregate’ server deployment to multiple SSH machine. It deploys RPyC to each machine separately, but lets you manage them as a single deployment.