Intro

What is DeliveryBoy

DeliveryBoy is a lightweight and transparent intermediary for executing a Python callable – a function or method – in a new Python process such that a developer using this intermediary does not have to care about how the object and modules are passed.

The new Python process is started by a transport command yielding a wide range of applications, e.g.:

  • Execution as a different user via sudo.
  • Execution on a remote host via ssh.
  • Execution on a HPC cluster via bsub (in case of LSF).

The base assumptions for this implementation are:

  • On the target host a compatible version of Python is installed.
  • On the target host the Python environment contains the deliveryboy package.
  • The Python environment on the source and target hosts are identical (aka. same modules installed).
  • Only the callable, module names for modules in the (virtual) environment and modules from outside the environment need to be transported.

@startuml
hide footbox
title __Example:__ Sequence for usage with ``ssh``

box "'Local Host'" #LightBlue
    control "Your script" as script
    boundary "DeliveryBoy" as db1
end box

box "'Remote Host'" #LightGray
    boundary "DeliveryBoy" as db2
end box

-> script: call
activate script
script -> script: call decorator
activate script

script -> db1
activate db1
db1 -> db1: pickle
activate db1
deactivate db1
db1 -> db2: call through transport
activate db2
db2 -> db2: unpickle
activate db2
deactivate db2
db2 -> db2: load modules
activate db2
deactivate db2
db2 -> db2: call decorated
activate db2
deactivate db2
db2 -> db2: pickle
activate db2
deactivate db2

db2 -> db1: return
deactivate db2

db1 -> db1: unpickle
activate db1
deactivate db1
db1 -> script: return
deactivate db1

deactivate script
<- script: exit
deactivate script
@enduml

Acknowledgement

This project was inspired by:

Indices and tables