Skip to content

Know how: add a new tree and worker to the Timetable

Dan Mushkevych edited this page Mar 6, 2018 · 2 revisions

New tree&set of workers can be added to the Synergy Scheduler in next steps:

  1. Define a Worker in the context.py. Let us call it PROCESS_ALPHA

    process_context = {
    ...
    PROCESS_ALPHA: _process_context_entry(
        process_name=PROCESS_ALPHA,
        classname='workers.process_alpha_module.ProcessAlphaModule.start',
        token=TOKEN_ALPHA,
        time_qualifier=QUALIFIER_DAILY,
        state_machine_name=STATE_MACHINE_CONTINUOUS,
        blocking_type=BLOCKING_NORMAL,
        trigger_frequency='every 60',
        present_on_boxes=['dev.*']),
    ...
    }
  2. Define constants in constants.py:

    PROCESS_ALPHA = 'ProcessAlpha'
    TOKEN_ALPHA = 'alpha'
    TREE_ALPHA = 'tree_alpha'
  3. Declare a governing tree. Let us call it TREE_ALPHA and assume that it will enclose PROCESS_ALPHA only.
    Should TREE_ALPHA has any dependencies on other trees, list them by tree name in dependent_on field:

    timetable_context = {
    ...
    TREE_ALPHA: _timetable_context_entry(
        tree_name=TREE_ALPHA,
        enclosed_processes=[PROCESS_ALPHA],
        dependent_on=[],
        mx_name=TOKEN_APHA,
        mx_page=MX_PAGE_TRAFFIC)
    ...
    }
  4. Start the Scheduler, as advised in Go to