Task groups

Task groups can be used to control the transcoders that a specific job should use, or to control the number of concurrent jobs running by job type. It may be expanded in the future to include not only jobs and transcoders, but also other types of tasks and resources.

  • A task group identifies a set of jobs and the resources available to those jobs.
  • Jobs are identified by a criteria on the group.
  • A job can belong to multiple groups, but only a single group for each type of resource. If a job satisfies the criteria on multiple groups, then the job belongs to the group with the highest priority.
  • A transcoder can belong to any number of groups.
  • A job will only use resources from the group(s) that it belongs to.

Creating a task group

Task groups are referred to by name. Each group should specify a job criteria and a number of transcoders, and a priority if needed.

PUT /task-group/imports
Content-Type: application/xml

<TaskGroupDocument xmlns="http://xml.vidispine.com/schema/vidispine">
  <job>
    <type>PLACEHOLDER_IMPORT</type>
  </job>
  <transcoder>
    <id>VX-1</id>
  </transcoder>
  <transcoder>
    <id>VX-2</id>
  </transcoder>
  <priority>MEDIUM</priority>
</TaskGroupDocument>

Task group criteria

Task groups can have multiple criteria. A job must then satisfy them all to be considered being part of that group. The selections in a criteria form a logical OR.

For example, to restrict jobs that are either imports or exports, and from the admin or bulk-import user, to transcoder VX-1:

<TaskGroupDocument xmlns="http://xml.vidispine.com/schema/vidispine">
  <job>
    <type>PLACEHOLDER_IMPORT</type>
    <type>EXPORT</type>
  </job>
  <job>
    <user>admin</user>
    <user>bulk-import</user>
  </job>
  <transcoder>
    <id>VX-1</id>
  </transcoder>
</TaskGroupDocument>

This is evaluated as:

(type:PLACEHOLDER_IMPORT OR type:EXPORT)
AND
(user:admin OR user:bulk-import)

Job criteria

Jobs can be matched on:

  • Priority - To include jobs with a certain priority.
  • Type - To include jobs of a certain type.
  • User - To include jobs created by a specific user.
  • Group - To include jobs created by a user in a specific group.
  • Data - To include jobs with certain data.

Task group priority

A job will use resources from the task group with the highest priority and a matching criteria. If two task groups have the same priority then the groups are ordered by name in alphabetical order, and the first one is picked.

Task group concurrency limit

New in version 5.2.2.

By setting the maxConcurrency setting in a task group it’s possible to control the maximum number of concurrent jobs for any matching job. If a job matches multiple task groups, the one with the highest priority and the lowest maxConcurrency value will be effective.

For example, to specifically limit the amount of concurrent jobs of type EXPORT, the following task group can be created:

PUT /task-group/export-job-limit
Content-Type: application/xml

<TaskGroupDocument xmlns="http://xml.vidispine.com/schema/vidispine">
  <job>
    <type>EXPORT</type>
  </job>
  <priority>MEDIUM</priority>
  <maxConcurrency>3</maxConcurrency>
</TaskGroupDocument>

Other means to control the maximum number of concurrent jobs includes using job pools and the concurrentJobs configuration property.

Job problems

If a job cannot run because the transcoders available to it are offline, then a transcoder offline problem will be created. The problem will contain the name of the group and the job id(s).

This allows you to see which group/transcoder(s) a job is blocked on. For example:

GET /job/problem
<JobProblemListDocument xmlns="http://xml.vidispine.com/schema/vidispine">
  <problem>
    <id>35113</id>
    <type>TranscoderOffline</type>
    <job>VX-115770</job>
    <data>
      <key>taskGroup</key>
      <value>imports</value>
    </data>
  </problem>
</JobProblemListDocument>