Delegation to an SSH server


The SSHEnvironment makes it possible to delegate tasks to a remote multi-core server through an SSH connection. In order to do that you should be able to connect to server with ssh using either a key/password authentication or a private key based authentication.

First you should provide your authentication details to access the server (this will be persisted by OpenMOLE so this operation only needs to be done once and for all).

OpenMOLE offers several ways to authenticate to a remote machine through SSH: login/password and private key. The following instructions explain how to setup SSH authentications.

If you are using the script editor you should configure them directly in the authentication panel.

In console mode, you can define an authentication using a pair of login / password with the following command:
SSHAuthentication += LoginPassword("login", encrypted, "machine-name")

Or to authenticate with a private key:
SSHAuthentication += PrivateKey("/path/to/the/private/key", "login", encrypted, "machine-name")

Both calls mention the encrypted function. This function will prompt for the password/passphrase of the private key right after the call to the builder of the Environment using this SSHAuthentication.

The last part of the SSHAuthentication: "machine-name" should match exactly the address of the machine in you execution environment. OpenMOLE search the matching ssh keys using an exact match on login and machine-name between the environment and the stored keys.

In case you encounter troubles at setting up an SSH connection in OpenMOLE, you should check the corresponding troubleshooting section.

Once the SSHAuthentication is defined, all that is left is to define the SSHEnvironment:
val env =
  SSHEnvironment(
    "login",
    "machine.domain",
    10 // The number of cores you want to use on the remote server
  )

You also can set options by providing additional parameters to the environment (..., option = value, ...): :
  • port: the number of the port used by the ssh server, by default it is set to 22,
  • openMOLEMemory: the memory of attributed to the OpenMOLE runtime on the execution node, if you run external tasks you can reduce the memory for the OpenMOLE runtime to 256 mega in order to have more memory for you program on the execution node, for instance openMOLEMemory = 256,
  • threads: the number of threads for concurrent execution of tasks on the worker node, for instance threads = 4,
  • workDirectory