7.8. RackHD Workflow Engine

This tutorial explains how to use RackHD on-taskgraph as a stand alone service, known as the RackHD Workflow Engine.

7.8.1. Prerequisites

The Workflow Engine requires mongodb, rabbitmq, and ipmitool to be installed as follows

sudo apt-get install mongodb
sudo apt-get install rabbitmq-server
sudo apt-get install ipmitool

7.8.2. Set up Workflow Engine Service

  1. Clone the on-taskgraph repository

    git clone https://github.com/RackHD/on-taskgraph
    cd on-taskgraph
    
  2. Install the Workflow Engine dependencies

    npm install
    
  3. Copy the Workflow Engine config.json file to the /opt/monorail directory.

  1. Edit the config.json file, and change the value of the taskGraphEndpoint address to the IP address of your system.

  2. Start the Workflow Engine Service by using this command:

    node index.js
    
  3. Display the complete Workflow Engine API by pasting the following URL into a web browser:

    http://<your IP address>:9030/docs/
    
  4. The Workflow Engine requires DHCP, TFTP, and static file servers. You can install the RackHD on-dhcp-proxy, on-tftp, and on-http services respectively, as explained in their associated README files.

  1. Alternatively, you can use third party versions of DHCP and TFTP as described in TFTP and DHCP Service Setup
  1. You can also setup a third party static file server as described in Static File Service Setup
  1. Configure your compute node to PXE boot, and reboot the node. The Workflow Engine should discover the node and catalog it in its database.

7.8.3. Posting a OS Install Workflow

You will need to get the discovered node’s identifier from the Workflow Engine’s database as follows:

mongo pxe
db.nodes.find().pretty()
ctrl-d

The output will look like:

{
    "name" : "52:54:be:ef:c6:85",
    "identifiers" : [
        "52:54:be:ef:c6:85"
    ],
    "type" : "compute",
    "autoDiscover" : false,
    "relations" : [ ],
    "tags" : [ ],
    "createdAt" : ISODate("2017-11-06T21:42:11.406Z"),
    "updatedAt" : ISODate("2017-11-06T21:42:11.406Z"),
    "_id" : ObjectId("5a00d7336eb470a806c2b341")
}

In this example, the node identifier is 5a00d7336eb470a806c2b341

Use the following command to run an OS installation workflow install using Workflow Engine,

curl -X POST -d @payload.json http://<ip>:<port>/api/2.0/workflows --header "Content-Type: application/json"

where, payload.json is located in the current directory level, and payload looks like the example below.

{
    "name": "Graph.InstallCoreOS",
    "options": {
        "defaults": {
            "graphOptions": {
                "target": "5a00d7336eb470a806c2b341"
            }
            "version": "899.17.0",
            "repo": "http://172.31.128.1:9030/coreos"
        }
    }
}