Skip to content
nicholas harteau edited this page Nov 27, 2010 · 8 revisions

Pogo Internals

job states

host states

  1. deadlocked - can't be run due to other host failures

  2. failed - has run, but failed

  3. finished - ran successfully

  4. halted - ??

  5. offline - manually marked offline

  6. ready - ready to run, waiting for a worker

  7. running - worker is currently connected

  8. skipped - manually skipped

  9. unreachable - could not be reached

  10. waiting - waiting for host meta-information

new jobs

1. find the apps and envs for all hosts

option 1:

Pogo::Engine::Job->start(targets) is called with targets supplied with the job

Pogo::Engine::Job::expand_targets produces a flattened list of targets

Pogo::Engine::Job::fetch_target_meta(@hosts, $cont)

$plugin->new() is called for each plugin in the namespace config

  • if $plugin is a singleton it should flush cache on new();

$plugin->fetch_meta(@hosts, $cont, $errc)

  • $cont->() gets a hashref of hosts resolved so far. plugins may implement batching/parallelism as necessary

  • probably write a new state into the job log every so often

  • $cont->() checks whether or not it's the last host of the last plugin to check in and move on

2. add hosts to the job

back in ->start(), we have a hash of hostname=>meta that we know is complete because of the continuation

what do we need to do here?

3. compute slots

given the information in our %targets hash we should be able to compute and write slots to storage, this doesn't need to be asyncronous

4. start running tasks

Job::fetch_all_slots() should really be Job::fetch_runnable_hosts(), and we should call it once at the end of start(); after that it should be called on each host completion.