An asynchronous deployment and operations platform with the aim to better enable simplicity, faster time to delivery, and consistency.
This project is maintained by oshied
Interfacing with Directord is simple with the library connection manager.
Running orchestration jobs, listing nodes, inspecting jobs and more can all be managed with an easy to use context manager.
# Import the required module.
from directord import DirectordConnect
# Define your job(s). Jobs are an list of dictionaries which defines a set of
# tasks to run against the cluster. To limit node interactions targets can be
# defined. See https://directord.com/orchestrations.html for more on what's
# possible.
jobs = [
{
"jobs": [
{
"RUN": "echo hello world"
}
]
}
]
with DirectordConnect() as d:
# Run orchestrations.
ids = d.orchestrate(
orchestrations=jobs
)
for job_id in ids:
status_boolean, info = d.poll(job_id=job_id)
# List all active nodes
nodes = d.list_nodes()
# List executed jobs
jobs = d.list_jobs()
When polling for jobs there are only three valid statuses.
The return from orchestrate
is an array of UUIDs, which are the ID’s for the
submitted jobs.
DirectorConnect
can be used as a context manager or via object and is built as
a convince method to better help developers and operators streamline their
applications.
Initialize the connection.
*param debug Enable |
Disable debug mode. |
debug
Boolean
socket_path
Socket path used to connect to Directord.socket_path
String
Run an orchestration and return a list of job IDs.
orchestrations
List of dictionary objects used to run orchestrations.orchestrations
List
defined_targets
List of Directord Targets.defined_targets
List
List
Poll for the completion of a given job ID.
job_id
Job UUID.job_id
String
Tuple
Return a list of all active Directord Nodes.
List
Return a dictionary of all current Directord jobs.
Dictionary
Purge all nodes from the pool, all remaining active nodes will recheck-in and be added to the pool.
Boolean
purge all jobs from the return manager.
Boolean