Skip to content

Internals

Tudor Marghidanu edited this page Sep 22, 2020 · 2 revisions

Execution

Every time you run a target job in Werk, the internal scheduler will recursively inspect the job dependencies and create a directed graph. From this graph, we can get a topological ordering, which determines the order in which the jobs will execute.

Werk uses a custom implementation of the topological sort algorithm that returns a parallel execution plan; the algorithm tries to reduce execution time by grouping jobs into stages.

Executors

An executor executes each job; at the moment, there's the Shell implementation for the executor. In the future, I will add more executors for Docker and SSH.

The executor receives the job definition and will execute the commands in order while capturing the output of the command and recording execution times. All this information is compiled into a report which later can be saved and inspected.

Plan

werk plan main
Clone this wiki locally