Constraint

A constraint is a way to limit where a task may run. Currently we only support two main types of constraint, os and arch. Eventually user-definable and other constraints will be available. Constraints may be grouped together to combine multiple constraints together.

Example Constraint

{
  "type": "os",
  "value": "windows"
}

Valid OS constraints

Below is a list of currently supported operating systems

OS
windows
linux
darwin
freebsd

Valid Arch constraints

Arch
amd64
386
armv6
armv7
arm64

Example Task With Constraints

This task would only be run on a 64-Bit Windows machine.

{
  "input": {
    "dataset": 2
  },
  "taskDefinition": {
    "constraints": [
      [
        {
          "type": "os",
          "value": "windows"
        },
        {
          "type": "arch",
          "value": "amd64"
        }
      ]
    ],
    "runner": {
      "type": "docker-json-runner",
      "manifest": {
        "*": {
          "image": "computes/fibonacci-sum-split:latest"
        }
      }
    },
    "result": {
      "action": "set",
      "destination": {
        "dataset": { "/": "<dataset-hash-here>" },
        "path": "split/results"
      }
    }
  },
  "status": {
    "/": "<status-hash-here>"
  }
}