SSH Plugin

From user's Wiki!
Jump to: navigation, search

Now is possible to execute tasks in a remote computer using SSH protocol. This is useful for two main purposes:

  • Execute applications that can only be executed in Linux, like FSL
  • Execute long processing tasks that can take several days to be executed like computational fluid dynamics simulation

For users

SSH configuration

Description: Configure SSH nodes and test the connection

Author: Xavi Planes

Usage

To use this feature you need to configure the SSH node. A new preferences dialog that allows to configure the SSH nodes and test the connection.

SSHConfig.PNG

There are three possible methods for user authentication:

  • Public/Private key
  • Interactive
  • Password
SSH configuration

Public key authentication

The most interesting authentication method is public key because there's no user interaction each time a connection is stablished. When the user imports a key file, using the Import button, the private key file will be stored into user home path ".ssh" folder. In windows, the fodler will be: C:\Documents and Settings\xplanes\.ssh. To generate a DSA/RSA key in Windows, you can use [Putty] application.

After the dsa or rsa key has been generated, you can upload the public key to the linux remote machine. [Here] you can find an example.

SSH Plugin provider

Description: SSH plugin provider scans a remote folder for Command Line Plugins using SSH protocol. User can configure the remote SSH node and the rest of the parameters for scanning command line plugins.

Author: Xavi Planes

Usage

PluginProviders.PNG

When a new provider is added, you will see this dialog:

SSH plugin provider configuration

  • Working directory: This is the remote directory where the command line plugins will be executed
  • Temporary directory: Local directory where to store local data
  • Scan folder: Folder where to find remote command line plugins
  • SSH node: SSH node configuration

A command line plugin has a new button "Location" that allows to select the location that will be used for executing it.

Processing widget with location button

This provider uses a cache that stores the modified time for all command line plugins. This allows to avoid scanning the files each time the provider is executed.

When a SSH command line plugin is executed, the following steps are performed:

  • Save all input data to a local folder
  • Create remote use case folder
  • Transfer input data to remote directory
  • Execute command
  • Transfer output remote data to local folder
  • Load output data
  • Clean remote directory
  • Clean local data
SSH use case

Command line plugin execution

SSH Command line plugins are executed using a new ProcessorExecutionQueue called "Remote" that has a limitation of 50 concurrent processors. This allows to execute several remote tasks wihtout limitation.

The command line plugin is executed in background. It means that the task is executed and the thread is monitoring the state during the execution. This allows to update the progress bar and check if the task has been cancelled. This functionality also allows to close the connection, close GIMIAS, the computer and after several days, check the state of the remote task.

For developers

Added SSH functionality that allows to connect to remote machines using SSH protocol and transfer files or execute commands.

SshApi

Two third parties have been added: OpenSSL (precompiled) and libssh (source code).

A new library has been added called SshApi. This is the UML class diagram:

SshApi UML class diagram

It has these main classes:

  • sshConnection: Connects to a remote machine
  • sshNode: Remote machine configuration
  • sshNodeManager: Manages all sshNode objects
  • sshAskPassword: Interface for asking password or confirmation to user. You can add your own implementation to this interface
  • sshDirectory: sshDirectory provides a SSH way of finding the names of the files in a remote system directory
  • sshFile: SSH File transfer. It has two implementations: SCP and SFTP
  • sshExecuteCommand: Execute a single command in a remote machine
  • sshExecuteCommandBackground: SSH command execution in background on Linux remote machines

SSHPlugin

A new plugin called SSHPlugin has been added. This is the UML class diagram:

SshApi UML class diagram

All classes are sublcasses of specific interfaces.

The plugin adds a new preferences dialog that allows to configure the SSH nodes and test the connection.

SSH configuration
  • SSHPluginDataTransfer: The inputs/outputs passed to a remote machine using SSH
  • SSHPluginModuleExecution: Executes a ModuleDescription using SSH
  • SshPluginNodeManager: SSH Node manager that reads and stores configuration in Settings
  • SSHPluginProvider: Loads command line plugins using SSH connection
  • SSHPluginAttachRunningPlugins: Attach remote command line plugins that have been detached previously
  • sshPluginAskPasswordWx: Get password for SSH Connection using wxWidgets

SSHNode configuration

There are three possible methods for user authentication:

  • Public/Private key
  • Interactive
  • Password
SSH configuration

Public key authentication

The most interesting authentication method is public key because there's no user interaction each time a connection is stablished. When the user imports a key file, using the Import button, the private key file will be stored into user home path ".ssh" folder. In windows, the fodler will be: C:\Documents and Settings\xplanes\.ssh. To generate a DSA/RSA key in Windows, you can use [Putty] application.

After the dsa or rsa key has been generated, you can upload the public key to the linux remote machine. [Here] you can find an example.

SSH Plugin provider

Added a new plugin provider that scans a remote folder using SSH protocol. This provider allows to discover remote Command line plugins. User can configure the remote SSH node and the rest of the parameters for scanning command line plugins.

SSH plugin provider configuration

  • Working directory: This is the remote directory where the command line plugins will be executed
  • Temporary directory: Local directory where to store local data
  • Scan folder: Folder where to find remote command line plugins
  • SSH node: SSH node configuration
  • Remote GIMIAS versions: If remote computer has GIMIAS installed and it has been executed, this control will allow you to select the desired GIMIAS version and the fields Scan folder and Working directory will be configured automatically.

Command line plugin execution

A command line plugin has a new button "Location" that allows to select the location that will be used for executing it.

Processing widget with location button

This provider uses a cache that stores the modified time for all command line plugins. This allows to avoid scanning the files each time the provider is executed.

When a SSH command line plugin is executed, the following steps are performed:

  • Save all input data to a local folder
  • Create remote use case folder
  • Transfer input data to remote directory
  • Execute command
  • Transfer output remote data to local folder
  • Load output data
  • Clean remote directory
  • Clean local data
SSH use case

SSH Command line plugins are executed using a new ProcessorExecutionQueue called "Remote" that has a limitation of 50 concurrent processors. This allows to execute several remote tasks wihtout limitation.

The command line plugin is executed in background. It means that the task is executed and the thread is monitoring the state during the execution. This allows to update the progress bar and check if the task has been cancelled. This functionality also allows to close the connection, close GIMIAS, the computer and after several days, check the state of the remote task.

Go back to Users