Note
The configuration system has changed significantly since version 0.2.10. All existing configurations should still work, but new configurations should follow the new conventions.
The Tron configuration file uses YAML syntax. The recommended configuration style requires only strings, decimal values, lists, and dictionaries: the subset of YAML that can be losslessly transformed into JSON. (In fact, your configuration can be entirely JSON, since YAML is mostly a strict superset of JSON.)
Past versions of Tron used additional YAML-specific features such as tags, anchors, and aliases. These features still work in version 0.3, but are now deprecated.
ssh_options:
agent: true
notification_options:
smtp_host: localhost
notification_addr: <your email address>
nodes:
- name: local
hostname: 'localhost'
jobs:
- name: "getting_node_info"
node: local
schedule: "interval 10 mins"
actions:
- name: "uname"
command: "uname -a"
- name: "cpu_info"
command: "cat /proc/cpuinfo"
requires: [uname]
command attribute values may contain command context variables that are inserted at runtime. The command context is populated both by Tron (see Built-In Command Context Variables) and by the config file (see Command Context). For example:
jobs:
- name: "command_context_demo"
node: local
schedule: "1st monday in june"
actions:
- name: "print_run_id"
# prints 'command_context_demo.1' on the first run,
# 'command_context_demo.2' on the second, etc.
command: "echo %(runid)"
These options affect how Tron connects to the nodes.
Example:
ssh_options:
agent: false
identities:
- /home/batch/.ssh/id_dsa-nopasswd
Email settings for sending failure notices.
Example:
notification_options:
smtp_host: localhost
notification_addr: batch+errors@example.com
Example:
time_zone: US/Pacific
Example:
command_context:
PYTHON: /usr/bin/python
TMPDIR: /tmp
See a list of Built-In Command Context Variables.
Example:
output_stream_dir: "/home/tronuser/output/"
Configure how trond should persist its state to disk. By default a shelve store is used and saved to ./tron_state in the working directory.
shelve - uses the shelve module and saves to a local file
sql - uses sqlalchemy to save to a database (tested with version 0.7).
mongo - uses pymongo to save to a mongodb (tested with version 2.2).
yaml - uses yaml and saves to a local file (this is not recommend and is provided to be backwards compatible with previous versions of Tron).
You will need the appropriate python module for the option you choose.
Ignored by shelve and yaml stores.
A connection string (see sqlalchemy engine configuration) when using an sql store.
An HTTP query string when using mongo. Valid keys are: hostname, port, username, password. Example: "hostname=localhost&port=5555"
Example:
state_persistence:
store_type: sql
name: local_sqlite
connection_details: "sqlite:///dest_state.db"
buffer_size: 1 # No buffer
Example:
nodes:
- name: node1
hostname: 'batch1'
- hostname: 'batch2' # name is 'batch2'
Example:
node_pools:
- name: pool
nodes: [node1, batch1]
- nodes: [batch1, node1] # name is 'batch1_node1'
As of v0.3.3 Logging is no longer configured in the tron configuration file.
Tron uses Python’s standard logging and by default uses a rotating log file handler that rotates files each day. The default log directory is /var/log/tron/tron.log.
To configure logging pass -l <logging.conf> to trond. You can modify the default logging.conf by copying it from tron/logging.conf. See http://docs.python.org/howto/logging.html#configuring-logging