Table Of Contents
Table Of Contents

SSHCluster

from inet.common.cluster

class SSHCluster(scheduler_hostname, worker_hostnames, nix_shell=None)[source]

Bases: object

Represents an SSH cluster. An SSH cluster is basically a set of network nodes, most often connected to a single LAN, all of which can login into each other using SSH passwordless login. The SSH cluster utilizes all network nodes with automatic and transparent load balancing as if it were a single computer.

There are a couple of pitfalls that can prevent the SSH cluster from working correctly. If you encounter problems with the SSH cluster, make sure the following conditions are met:

  • scheduler and worker node hostnames can be resolved to IP addresses on all nodes

  • all nodes can SSH login into all other nodes (even themselves!) without any user interaction (no password is required)

  • the Python version and all required Python library versions are the same on all nodes

  • no firewall rule prevents the scheduler to connect to the workers

  • simulation projects are compiled both in release and debug versions

Initializes a new SSH cluster object.

Parameters
  • scheduler_hostname (string) – The hostname of the scheduler node.

  • worker_hostnames (list) – The hostnames of the worker nodes.

  • nix_shell (string or None) – A Nix shell name that is used to execute tasks on the SSH cluster for repeatable results.

Methods

run_gethostname

Collects the result of calling socket.gethostname() multiple times on the SSH cluster.

start

Starts the SSH cluster and the dashboard web page.

Attributes

run_gethostname(num_tasks=12)[source]

Collects the result of calling socket.gethostname() multiple times on the SSH cluster. This function is primarily useful to test the correct operation of the SSH cluster. The result should contain a permutation of the hostnames of all worker nodes.

Parameters

num_tasks (int) – The number of times socket.gethostname() is called.

Returns (List):

The hostname of worker nodes where socket.gethostname() was called.

start()[source]

Starts the SSH cluster and the dashboard web page.