17 Build Job Constraints

The build job constraints can define requirements to the hardware or software of the used build host. The constraints can be defined per package or for repositories.

The build constraints for a package is part of of the package sources. An _constraints source file can contain following values. The format of the file is XML and gets validated on submission.

The build constraints for entire project or specific repositories is part of the project config. It contains for each constraint a line

Constraint: <SELECTOR> <STRING>

The selector is a collon seperated list.

NOTE: If no build host is offering the constraints, the package will stay in scheduled state and never get dispatched.

17.1 hostlabel

The hostlabel is any string which can be assigned to build hosts when starting the bs_worker process. It can be used to run on specific hosts, which may be used for running benchmarks in a reproducible way. This constraints does also support to be defined as a negative definition via the exclude=true attribute. However, the hostlabel is always specific to one OBS instance. You should avoid it as much as possible, since building with this constraint in another instance is usually not possible. Use any of the other constraints if possible.

Example for _constraints file:

<constraints exclude="false">
  <hostlabel>benchmark_runner</hostlabel>
</constraints> 

Example for project configuration:

Constraint: hostlabel benchmark_runner

17.2 sandbox

Defines the sandbox which is used for the build job. Sandboxes are chroot, xen or kvm environments. There is also the virtual secure sandbox, which allows building on xen or kvm. This constraints does also support to be defined as a negative definition via the exclude=true attribute.

Example for _constraints file:

<constraints exclude="true">
  <sandbox>secure</sandbox>
</constraints> 

Example for project configuration:

Constraint: sandbox secure

17.3 linux

The linux kernel specific part.

17.3.1 version

To require a specific linux kernel version.

Example for _constraints file:

<constraints>
  <linux><version>
    <min>3.0</min>
    <max>4.0</max>
  </version></linux>
</constraints> 

Example for project configuration:

Constraint: linux:version:min 3.0
Constraint: linux:version:max 4.0

17.3.1.1 min

Minimal kernel version.

17.3.1.2 max

Maximal kernel version.

17.3.2 flavor

A specific kernel flavor like default or smp (from kernel packages kernel-default or kernel-smp).

Example for _constraints file:

<constraints>
  <linux>
    <flavor>default</flavor>
  </linux>
</constraints> 

Example for project configuration:

Constraint: linux:flavor default

17.4 hardware

To require hardware or build instance features.

17.4.1 cpu

To require a specific linux kernel version.

17.4.1.1 flag

CPU features which are provided by the hardware. On linux they can be found in /proc/cpuinfo. The flag element may be used multiple times to require multiple cpu features.

Example for _constraints file:

<constraints>
  <hardware><cpu>
    <flag>mmx</flag>
    <flag>sse2</flag>
  </cpu></hardware>
</constraints> 

Example for project configuration:

Constraint: hardware:cpu:flag mmx
Constraint: hardware:cpu:flag sse2

17.4.2 processors

To require a minimal number of processors for the build job.

Example for _constraints file:

<constraints>
  <hardware>
    <processors>4</processors>
  </hardware>
</constraints> 

Example for project configuration:

Constraint: hardware:processors 4

17.4.3 disk

Hard disk specific.

17.4.3.1 size

To require a minimal size of the disk.

Example for _constraints file:

<constraints>
  <hardware>
    <disk>
      <size unit="G">4</size>
    </disk>
  </hardware>
</constraints> 

Example for project configuration:

Constraint: hardware:disk:size unit="G" 4

17.4.4 memory

Memory specific.

17.4.4.1 size

To require a minimal memory size including swap space.

Example for _constraints file:

<constraints>
  <hardware>
    <memory>
      <size unit="M">1400</size>
    </memory>
  </hardware>
</constraints> 

Example for project configuration:

Constraint: hardware:memory:size unit="M" 1400

17.4.5 physicalmemory

Memory specific.

17.4.5.1 size

To require a minimal memory size. Swap space is not taken into account here.

Example for _constraints file:

<constraints>
  <hardware>
    <physicalmemory>
      <size unit="M">1400</size>
    </physicalmemory>
  </hardware>
</constraints> 

Example for project configuration:

Constraint: hardware:physicalmemory:size unit="M" 1400

17.5 Constraint Handling

The constraint handling depends on what is met by the restrictions. The handling starts when there is no worker to fulfill the constraints.

17.5.1 More than half of the workers satisfy the constraints

The job will just stay in state scheduled and no further notification is set.

17.5.2 Less than half of the workers satisfy the constraints

The job will stay in state scheduled and the dispatch details are set to tell the user that this job can take a long time to be built. This will be shown in the WebUI on mouse over and the scheduled state will be highlighted as well.

waiting for 4 compliant workers (4 down)

The (4 down) means that 4 of the 4 compliant workers are down and that someone should have a look.

17.5.3 No workers satisfy the constraints

If no worker can handle the constraints defined by the package or project the build job fails. There is also a hint in the build log what has failed.

package build was not possible:

no compliant workers (constraints mismatch hint: hardware:processors sandbox)

Please adapt your constraints.

Print this page