Environment variables for node operation

A Bash component has optional properties for users to input. These properties will be available in the configuration scripts as the environment variables:

  • COMPONENT_VERSION: to input a version number (e.g., 1.0).
  • PROTOCOL: to input a protocol (e.g., tcp).
  • PORT: to input a port (e.g., 27017).

Users can define additional environment variables using the env property.

Fig. Bash component properties

The env property is a map of string values. In this example, we add an entry in the map with key FOO and value bar:

Fig. Bash component properties

Then we can access the variable in the configuration script as:

# Hello bar
echo "Hello $FOO"

In addition, the operation configure and stop of the script component have the following environment variables by default:

  • NODE: set to the node name of the component (e.g., Bash_1).
  • HOST: set to the name of the compute node, which the component is hosted on (e.g., Compute_1).
  • ip_address: set to the runtime IP address of the compute node, which hosts this component.