You are here

Blockmon Controller

The Blockmon distributed architecture consists of an overlay made up of Blockmon nodes, which are coordinated by the Blockmon Controller (BC).

The BC is implemented in Python and the communication between the BC and the nodes, as well as the communication between the BC and the outside world takes place by means of JSON-RPC.  Furthermore, the BC stores information about nodes and running templates on an internal SQLite database.

The code of the BC, together with instruction on how to run it, are released open source on github at: Blockmon Controller.

The following figure outlines the overall architecture of the Blockmon controller and its interaction with the other components, either external or the Blockmon nodes.

 

 

Interaction between the Blockmon Controller and the external components

This interaction allows the external components to store template definitions on the BC, to invoke template instances and execute applications distributed across Blockmon nodes. Additionally, the BC makes available functions that allow the other components to retrieve information from the nodes about the available topologies and blocks, as well as the status of a variable of a running application. The BC stores all information about blocks, nodes and templates in a database.

The supported APIs that the BC makes available to accomplish those tasks are the following:

  • put_template(templatedef xml): Uploads the XML for a template de inition to the BC.
  • get_templates(): Returns a list of templates definitions (i.e., XML iles) already defined at the BC.
  • remove_template(templatedef ID): Removes the template definition with the given ID from the list of de ined at the BC.
  • expand_template(templateinstance xml): Expands a given template instance file based on a previously-uploaded (i.e., through put_template) template definition. Note that the template instance file contains information about which template definition is relevant.
  • invoke_template(templateinstance xml): Invokes (i.e., installs) an application on the overlay based on a previously-uploaded (i.e., through put_template) template definition and a given template instance file. Note that the template instance file contains information about which template definition is relevant.
  • stop_template(template ID): Stops an application on the overlay based on a previously-uploaded (i.e., through put_template) template definition and a given template ID.
  • get_supported_blocks(): Returns a list of the blocks currently installed on the overlay.
  • get_supported_topologies(): Returns a list with descriptions of the topologies currently supported by Blockmon.
  • get_variable(dist comp ID, comp ID, block ID, var ID): Returns the value of a variable belonging to a block in a composition.
  • save_datafile(filename,datafile): Uploads the data file needed to run a given template instance to the BC.

All the above functions return 0 upon success or -1 upon failure.

 

Interaction between the Blockmon Controller and the Blockmon nodes: Node Membership Management and Capabilities Discovery

This interaction allows the Blockmon node to join the Blockmon network and show its availability to run distributed applications. During this process, the node sends information such as hardware and software specs to inform the BC of its capability. Further, the BC will make this information available, where permitted, to advanced users again via a JSON-RPC call. The BC stores information about nodes into a database.

The supported APIs that the BC makes available to accomplish those tasks are the following:

  • register(IP address, listening_port): accepts a request to join the overlay sent by the node with the given IP address and listening_port.
  • unregister(node ID): accepts a request to unregister from the overlay sent by the node with the given ID.
  • keepalive(node ID, status_information): accepts a keepalive message sent by the node with the given ID and updates statistics about its status.

Upon success of the register function, the BC sends back to the node an ID to identify it within the overlay. The ID is an integer number, computed as an hash of the IP address and listening_port of the node. Upon success of the keepalive and register functions, a success code 0 is returned. All the above functions return -1 upon failure.

 

Interaction between the Blockmon Controller and the Blockmon nodes: Running composi tions and Installing data file

This interaction allows the BC to control compositions that are running on a given Blockmon node. This includes the ability of the BC to send data files to the node if the composition needs it and reading or overwriting the value of a given variable.

The supported APIs that the Blockmon nodes make available to accomplish those tasks are the following:

  • start_composition(composition xml, datafiles): accepts a request to start a composition and stores the data files needed to run the composition.
  • update_composition(composition xml): updates an already running composition.
  • stop_composition(composition ID): accepts a request to stop the running composition with the given ID.
  • read_variables(composition ID, variables list): reads the value of given variables.
  • write_variables(composition ID, variables list): overwrites the value of given variables.
  • get_composition_ids(): returns the IDs of all compositions currently running.
  • get_running_compositions(composition IDs): returns the composition XML for the given IDs.

All the above functions return -1 upon failure.

 

Blockmon Controller as mPlane-compliant component

Blockmon Controller is able to communicate with other mPlane components, thanks to the interface that makes it mPlane compliant. Please refer to the following GitHub repository for the latest version of the interface:

git clone https://github.com/fp7mplane/components.git COMPONENTS_DIR

 Once Blockmon Controller is properly installed, get the latest version of the mPlane protocol RI at the following GitHub repository: 

 git clone https://github.com/fp7mplane/protocol-ri PROTOCOL_RI_DIR

 The following instructions assume you are in the [COMPONENTS_DIR] folder

  1. Set the parameters in the file blockmon-controller/blockmonController.conf (e.g., path to certificates, supervisor address, client port and address, and roles)
  2. Set the environment variable MPLANE_RI to point to [PROTOCOL_RI_DIR]
    $ export MPLANE_RI=[PROTOCOL_RI_DIR]
  3. Set the following parameters in the file blockmon-controller/blockmonController.py to connect to the Blockmon controller
    _controller_port = Blockmon Controller port 
    _controller_address = Blockmon Controller address
  4. Run Blockmon Controller
    $ python3 blockmonController.py --config blockmonController.conf