Workers are specialized as follows:
- OpenStack Ansible, consuming that endpoint - we may want to assume Docker here
- Generalized Docker-based commands, using docker-py to wrap
All workers have the following environment variables set:
- CRATON_URL - URL for the Craton API endpoint
- CRATON_TOKEN - time-limited, scoped token (inventory + keys) for working with the Craton service
- CRATON_TASK - the specific task ID being run here to support lookup of the task details
- CRATON_DEVICES - whitespace separated list of device IDs that the worker is responsible for (possibly empty)
Workers coordinate with the Craton service as follows:
.. seqdiag::
seqdiag {
service -> jobboard [label="setup tasks"];
jobboard -> worker [label="run task using env vars"];
worker -> service [label="get task config"];
worker -> service [label="get ansible inventory on devices"];
worker -> device [label="run playbook on devices"];
device -> worker [label="results via callback API"];
worker -> service [label="set variables in inventory"];
worker -> jobboard [label="task completion"];
jobboard -> worker [label="retry"]; # FIXME this needs to use the correct seq diag stuff here
}