SSH plugin for GEMSEO
Install the latest version with pip install gemseo-ssh.
See pip for more information.
The same version of GEMSEO must be installed on the remote and local machines, but not the GEMSEO-SSH plugin, which is only required on the local machine.
This GEMSEO SSH plugin allows to delegate the execution of a discipline or any sub-process to a (such as an MDA or MDOScenario, or MDOChain) to a remote machine via SSH.
It allows you to distribute MDO workflows across multiple machines and multiple systems (Linux, Windows, MacOS).
It can be combined with GEMSEO's job scheduler interface to send
disciplines to a remote to a remote HPC and add them to the job
scheduler queue.
See the gemseo.wrap_discipline_in_job_scheduler method.
The SSH connection is handled with paramiko.
The settings for the SSH connections are passed as optional arguments
via the constructor of SSHDisciplineWrapper directly to paramiko's SSH client.
Please refer to
paramiko's SSHClient doc
for details on the
connection options.
For example, we can submit a discipline to a remote host like this:
from gemseo import create_discipline
from gemseo_ssh import wrap_discipline_with_ssh
from numpy import array
analytic_disc = create_discipline("AnalyticDiscipline", expressions={"y":"2*x+1"})
remote_discipline = wrap_discipline_with_ssh(
discipline=analytic_disc,
hostname="remote_hostname",
local_workdir_path= ".",
remote_workdir_path="~/test_ssh",
pkey="C:\\Users\\my_user_name\\.ssh\\id_rsa",
)
data = remote_discipline.execute({"x": array([1.0])})A more complex process, like a MDA, can also be sent to a remote host:
from gemseo import create_discipline
from gemseo import create_mda
from gemseo_ssh import wrap_discipline_with_ssh
disciplines = create_discipline(["SobieskiPropulsion", "SobieskiAerodynamics",
"SobieskiMission", "SobieskiStructure"])
mda = create_mda("MDAChain", disciplines)
remote_discipline = wrap_discipline_with_ssh(
discipline=mda,
hostname="remote_hostname",
local_workdir_path = ".",
remote_workdir_path="~/test_ssh",
username="my_username",
password="my_password",
)
# Note that the default_inputs of the SSH discipline are the same
# as the default_inputs of the original discipline
couplings = remote_discipline.execute()Please use the gitlab issue tracker to submit bugs or questions.
See the contributing section of GEMSEO.
- Jean-Christophe Giret
- François Gallard
- Nicolas Roussoully
- Antoine Dechaume