Defining the resource pool#

The resource pool can be specified on the command line by simply defining the number of each resource type. For example, resource pool having the default CPU count (as determined by canary) and 4 GPUs, can be generated by

$ canary -c resource_pool:gpus:4 config show resource_pool
resource_pool:
  additional_properties: {}
  resources:
    cpus:
    - id: '0'
      slots: 1
    - id: '1'
      slots: 1
    gpus:
    - id: '0'
      slots: 1
    - id: '1'
      slots: 1
    - id: '2'
      slots: 1
    - id: '3'
      slots: 1

The resource pool can also be defined in the resource_pool section of the configuration file:

resource_pool:
  cpus: 10
  gpus: 4

which will expand to

resource_pool:
  resources:
    cpus:
    - id: "0"
      slots: 1
    - id: "1"
      slots: 1
    ...
    - id: "9"
      slots: 1
    gpus:
    - id: "0"
      slots: 1
    - id: "1"
      slots: 1
    - id: "2"
      slots: 1
    - id: "3"
      slots: 1

To define more complex resource pool specifications, for example if each GPU has 2 available slots, define the resource_pool explicitly:

resource_pool:
  resources:
    gpus:
    - id: "0"
      slots: 2
    - id: "1"
      slots: 2
    - id: "2"
      slots: 2
    - id: "3"
      slots: 2