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)"
Options for SSH connections to Tron nodes. When tron runs a job or service on a node, it will add some jitter (random delay) to the run, which can be configured with the options below.
ssh_options: agent: false known_hosts_file: /etc/ssh/known_hosts identities: - /home/batch/.ssh/id_dsa-nopasswd connect_timeout: 30 idle_connection_timeout: 3600 jitter_min_load: 4 jitter_max_delay: 20 jitter_load_factor: 1
Email settings for sending failure notices.
notification_options: smtp_host: localhost notification_addr: firstname.lastname@example.org
command_context: PYTHON: /usr/bin/python TMPDIR: /tmp
See a list of Built-In Command Context Variables.
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"
state_persistence: store_type: sql name: local_sqlite connection_details: "sqlite:///dest_state.db" buffer_size: 1 # No buffer
Note: this is an experimental feature
Action runner configuration allows you to run Job actions through a script which records it’s pid. This provides support for a max_runtime option on jobs, and allows you to stop or kill the action from tronctl.
action_runner: runner_type: "subprocess" remote_status_path: "/tmp/tron" remote_exec_path: "/usr/local/bin"
List of nodes. Each node has the following options:
nodes: - name: node1 hostname: 'batch1' - hostname: 'batch2' # name is 'batch2'
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
Most tron logs are named by using pythons __file__ which uses the modules name. There are a couple special cases: