Console Mode

Suggest edits
Documentation > Developers

Contents

OpenMOLE GUI implements all the OpenMOLE features. However you may be interested in using OpenMOLE in interactive console mode. To do so, use the -c argument in your console : ./openmole -c
The only difference between the script in the console mode and the ones from the editor concerns the way you launch the execution, you cancel it and you follow the execution progress. An console workflow is launched like this:
val ex = exploration -< (model on env) start

Using the ex and the env variables you can follow the progress of the execution by using the commands: print(ex) and print(env). To cancel the execution you should use: ex.cancel.

Authentications 🔗

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")

It mentions 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 your execution environment. OpenMOLE searches the matching ssh keys using an exact match on login and machine-name between the environment and the stored keys.

Run script 🔗

In console mode, you have to copy-paste your whole workflow to run it. The only difference between the script in the console mode and the ones from the editor concerns the way you launch the execution, you cancel it and you follow the execution progress. A console workflow is launched like this:
val ex = exploration -< (model on env) start
Note that you need to invoke the start on your workflow, in contrary to Editor mode.


Using the ex and the env variables you can follow the progress of the execution by using the commands: print(ex) and print(env).


To cancel the execution you should use: ex.cancel.