-
Notifications
You must be signed in to change notification settings - Fork 0
Cookbook
Let's say that you are trying to access a node that is inside a private network for which you need to SSH into a gateway first. You can achieve this by nesting two SSH accessors:
node:
- name: protected-node
host: protected1.mydomain.com
access:
- class: robob.access.ssh
username: username-for-protected-node
password/key: secret
- class: robob.access.ssh
host: gateway.mydomain.com
username: username-for-gateway
password/key: secretStreamlets expose some metrics in the global scope. If you want to specialize them in a specific stream you can use the alias keyword to rename the metrics:
metrics:
- name: node1.load
title: CPU Load of node 1
- name: node2.load
title: CPU Load of node 2
stream:
- app: myapp
node: node1
streamlets:
- streamlet: uptime
alias:
load: node1.load
- app: myapp
node: node2
streamlets:
- streamlet: uptime
alias:
load: node2.load In roBob is possible to load other configuration files, therefore it's possible to separate your configuration into different re-usable files. For example:
You can keep the application generic configuration in application.yaml:
environments:
myapp.env:
LD_LIBRARY_PATH: "/lib:/usr/lib:/usr/local/lib:/opt/special/lib"
parsers:
- name: myapp.parser
class: robob.parser.regex
match:
- "^.*?Bandwidth: (?P<bandwidth>[0-9\.]+).*$"
apps:
- name: myapp
binary: /path/to/binary
env: myapp.env
parser: myapp.parserAnd you can use it in your main.yaml:
load:
- application.yaml
...
streams:
- app: myappSome applications might need a more complicate configuration file instead of command-line arguments. To satisfy their needs you can instruct robob to create a file before it runs the application using the files property in the application:
For example:
apps:
- name: myapp
binary: /path/to/binary
args: [ "--config", "${app.files.config.path}" ]
files:
- name: config
path: "/tmp/config.json"
contents: |
{
"config-1": "${value}",
"ip": "${nodes.node1.address}"
}The file contents, just like any property in the specs file can have macros that will be replaced at runtime. If no path argument is specified, robob will create a temporary file name for your file and store it under the ${app.files.xxxx.path} property. Optionally, you can specify an extension through suffix if your application is sensitive to it:
apps:
- name: myapp
binary: /path/to/binary
args: [ "--config", "${app.files.config.path}" ]
files:
- name: config
suffix: ".json"
contents: |
{
"config-1": "${value}",
"ip": "${nodes.node1.address}"
}