6. dispyadmin

dispyadmin.py is a web server to control all or individual nodes (running dispynode (Server)) with a web browser. Although multiple admin servers can be running, it is recommended that only one instance is used for controling the nodes. Only nodes started with admin_secret option and same secret used with dispyadmin can be controlled. Nodes that have different secret or nodes started without admin_secret option are shown but without details such as available memory, CPUs being used etc.

Below are various options to invoke dispynode program:

  • --save_config <file> saves configuration (i.e., options as given except for save_config) in given file and exits. This can be used to save the configuration on once, and use that file again with --config option to start dispyadmin with that configuration. If file is not given, the configuration is written to stdout.

  • --config <file> reads configuration from given file (e.g., saved with save_config option).

  • -d enables debug messages that show trace of execution.

  • --secret=secret uses given secret to communicate with nodes. Only nodes with matching secret (i.e., nodes started with matching admin_secret option) can be controlled. Note that using this option may be security risk; it may be possible for other users to see this parameter in process list. It is recommended that web browser is used to set this parameter (see below). Alternately, config option can be used to read it from given configuration file instead.

  • -i host or --host=addr directs dispyadmin to use given addr for communication with nodes. addr can be either host name or IP address in IPv4 or IPv6 format. If this option is not given, IP address associated with default host name is used.

  • --http_host host can be used to start the server at given host name or IP address. Default value for this option is localhost, which is safe (so communication between client and server is not transmitted over network) but client must be stated on local host only.

  • --http_port port. port is port number where http server runs. Default value for port is 8181.

  • --info_port port. port is port number where admin server listens for broadcast messages from nodes. Default value for port is dispy.config.ClientPort, which is port number where clients also listen for same information from nodes. If this number is changed, dispynode must also be started with same port number for scheduler_port option; otherwise, admin server may find nodes only with periodic scan (at ping_interval).

  • --node_port port. port is port number where nodes run. Default value for port is dispy.config.NodePort.

  • --poll_interval sec, where sec is intreval in seconds at which nodes are polled to collect latest information, such as jobs completed, availble CPUs, memory, disk space etc. Only nodes that have been already been paired with matching admin secret are polled.

  • --ping_interval sec, where sec is interval in seconds at which new nodes are discovered. dispyadmin broadcasts (UDP) messages at this interval so any nodes that may not have been discovered earlier respond to start pairing (with current admin secret).

  • --ipv4_udp_multicast controls whether to use multicast or broadcast for UDP with IPv4 (to discover nodes). If this option is not given, broadcast is used. If it is given, multicast is used instead. Note that for IPv6 there is no broadcst, so multicast is always used.

  • --keyfile=path is path to file containing private key for SSL communication, same as ‘keyfile’ parameter to ssl.wrap_socket of Python ssl module. This key may be stored in ‘certfile’ itself, in which case this must be None (default). Same file must be used as --keyfile option with dispynode (Server).

  • --certfile=path is path to file containing SSL certificate, same as ‘certfile’ parameter to ssl.wrap_socket of Python ssl module. Same file must be used as --certfile option with dispynode (Server).

Once dispyadmin server has been started, cluster / nodes can be monitored / administered at the http address (default is http://localhost:8181) with a web browser.

6.1. Admin Cluster(s)

The page shows cluster(s), as shown in example below:

_images/admin.png

The nodes shown are all the nodes detected, even if a node is not used by any client (in contrast to Monitor and Manage Cluster which shows only nodes that belong to client that uses httpd module). The information table at the top shows number of nodes found, CPU time of all finished jobs and number of jobs finished. The “Nodes” table shows IP address of each node, number of CPUs available for dispy. For any nodes that have matching “admin secret” details such as available memory, CPU percentage etc. are also shown. If a node’s admin secret is not set or doesn’t match, these details won’t be available.

The table at the bottom of page has following controls:

  • Poll interval is number of seconds at which nodes are polled to get latest details as well as to update the cluster(s) on this page. If “Now” is selected, the interval is not updated, but nodes are polled right away.

  • If a node has not been detected (e.g., UDP packets used to discover nodes are lost or node is in remote network etc.), the node’s host name or IP address can be input (along with port number if necessary) to add that node. Once the node is found at the given address, it will appear in the cluster(s) table above.

  • An admin secret can be set to get details of nodes as well as to control them. If different nodes use different secrets, then those secrets can be set one at a time. Each time a secret is set, it is used to match with nodes; setting a new admin secret (to match with other nodes) doesn’t affect nodes that already matched. “Show” can be selected to show the secret in clear text or not.

  • The nodes in the cluster table are by default shown in no particular order. This can be changed by selecting ordering based on IP address, last time node information has been updated from that node etc.

The 2 controls below apply to selected nodes. The nodes can be selected / deselected with checkbox against each node, or all nodes can be selected / deselected with the checkbox in the table header of nodes.

  • Service times when selected nodes are allowed to execute jobs can be controlled by selecting the control (start / stop / end), the time for that control and set as appropriate. The time must in “HH:MM” format in where “HH” is 24-hour format (in the range 0 to 23) and “MM” is minutes (in the range 0 to 59). Alternately, “Now” can be selected in which case current time at the nodes is chosen. The times must be in increasing order from “Start” to “End”. If “Start” is set, dispynode starts accepting jobs from that time (jobs are not accepted before that time). If “Stop” is set, no new jobs are accepted from that time, but any executing jobs are allowed to execute. If “End” is set, any executing jobs are terminated and no new jobs are executed. The next day node will again accept jobs at the “Start” time (if set).

  • CPUs used by selected nodes can be set by specifying number (integer) of CPUs. If the number is positive, that many CPUs are used by dispy and if the number is negative, that many CPUs are not used by dispy (e.g., if a node has 8 processors and the input number is -2, then dispy will use 6 CPUs). If CPUs are reduced, currently executing jobs are not killed, but no new jobs are accepted until CPUs used are as set. “All” checkbox can be set to use all available processors on each selected node.

In the cluster, each node’s IP address is shown as URL that can be selected to show details about that node.

6.2. Admin Node

At the top menu, “Admin Node” can be selected to show details about selected node.

_images/admin_node.png

Most of the information and controls are same as shown in Admin Cluster(s) page. In addition to these, this page shows / controls number of clients serviced. To control the number of clients to run, set the number to positive number to run that many clients, 0 to accept no additional clients and to -1 to run forever. Once the node finishes selected number of clients, dispynode program terminates, so the node can’t be controlled until dispynode is manually restarted.