Soyuz/JobDispatchTimeEstimation

Not logged in - Log In / Register

Revision 8 as of 2010-03-14 07:49:21

Clear message

Dispatch time estimation for build farm jobs

Introduction

Due to technical limitations (the art of writing psychic software is not very well established yet :-) job dispatch times are estimations only.

For the purpose of this description a 'platform' is considered to be the combination of a

Build farm jobs can either target a specific platform (e.g. binary builds) or be platform-independent (e.g. "generate a source package from a recipe" builds). The former can only make use of build machines (or "builders" in Soyuz parlance) of the given platform while platform-independent jobs may run on any available builder.

Jobs with an unspecified virtualization setting will be dispatched to virtual builders only.

Builders can -- roughly speaking -- either be idle or building. For any job running on a particular builder its estimated duration and its start time are available allowing us to estimate the job's remaining execution time.

By the way, did I already mention that job dispatch times are an estimation only?

Problem definition

Given:

Wanted: the estimated dispatch time for a specific job (the job of interest (aka JOI)) in the pending queue.

Solution overview

There are two questions we need to answer in order to come up with a dispatch time estimation for the job of interest (JOI):

  1. how long will the jobs ahead of the JOI (in the pending queue) take to run? This is the predecessor lead time (PLT).

  2. how long will it take until the job at the head of the pending queue is dispatched to a builder? This is the time to next builder (TNB).

The dispatch time estimation for the JOI is then calculated as follows: now() + PLT + TNB

Time to next builder

The time to next builder (TNB) is estimated for the head job which is the job at the head of the pending queue.

Given the head job's platform (processor: P, virtualization setting: V) The TNB is taken to be the minimum remaining job execution time across all builders providing (P,V).

Example: the head job's platform is (i386,true) and we have the following builders:

builder

estimated duration

job start time

Africa

10 minutes

-2 minutes

Americas

12 minutes

-4 minutes

Antarctica

8 minutes

-2 minutes

Australia

22 minutes

-8 minutes

The resulting TNB would be 6 minutes since the Antarctica builder is estimated to finish its job in that time.

Sometimes jobs overdraw their estimated duration i.e. they run longer than estimated. In such cases we assume that the corresponding builder will finish in 2 minutes. This is somewhat of a .. *cough* .. educated guess but has worked reasonably well in the past.

Predecessor lead time

Overview

The predecessor set is comprised by jobs that fulfil the following criteria: they are

The predecessor lead time for the JOI is estimated as follows:

  1. sum up the estimated duration of the jobs in the predecessor set. This results in a lead time total (LTT).

  2. divide the LTT by the smaller of these two values: the size of the

    1. predecessor set

    2. pool of builders available to run the JOI