{
  "$id": "https://firefox-ci-tc.services.mozilla.com/schemas/worker-manager/v1/config-google.json#",
  "$schema": "https://firefox-ci-tc.services.mozilla.com/schemas/common/metaschema.json#",
  "additionalProperties": false,
  "description": "'The config section of a workertype is using a provider with implementation google must match this.\nMuch of these fields are documented [here](https://cloud.google.com/compute/docs/reference/rest/v1/instanceTemplates)'\n",
  "properties": {
    "launchConfigs": {
      "description": "An array of possible variations of workers for this pool. Allows to vary across regions/zones/machineType/etc\nEach choice must include at least the required properties but can also include anything in\nthe request body of [the instance creation](https://cloud.google.com/compute/docs/reference/rest/beta/instances/insert)\napi method from gcloud. That said, worker-manager sets `instanceName` and `serviceAccounts` directly and you\ncannot override these. It also fills in some basic labels, will generate a default description, and sets the `taskcluster`\nmetadata key directly. You are free to set other metadata items though. A subset of these fields we require you to set such as `machineType`.\n",
      "items": {
        "additionalProperties": true,
        "properties": {
          "capacityPerInstance": {
            "description": "Deprecated - please use `workerManager.capacityPerInstance` instead",
            "minimum": 1,
            "title": "Capacity Per Instance (Deprecated)",
            "type": "integer"
          },
          "disks": {
            "description": "Defined in detail in the google doc above.",
            "title": "Disks",
            "type": "array",
            "uniqueItems": false
          },
          "machineType": {
            "description": "Full or partial URL of the machine type resource to use. Defined in detail in the google doc above",
            "title": "Machine Type",
            "type": "string"
          },
          "networkInterfaces": {
            "description": "Defined in detail in the google doc above.",
            "title": "Network Interfaces",
            "type": "array",
            "uniqueItems": false
          },
          "region": {
            "description": "The gcloud region this worker should be spawned in",
            "title": "Region",
            "type": "string"
          },
          "scheduling": {
            "additionalProperties": true,
            "description": "Defined in detail in the google doc above. Worker manager harcodes values for `automaticRestart` but\nyou can set all other fields.\n",
            "title": "Scheduling",
            "type": "object"
          },
          "workerConfig": {
            "additionalProperties": true,
            "description": "This value is supplied unchanged as the `workerConfig` property of the `taskcluster` instance metadata attribute.\nThe expectation is that the worker will merge this information with configuration from other sources,\nand this is precisely what [worker-runner](https://docs.taskcluster.net/docs/reference/workers/worker-runner) does.\nThis property must not be used for secret configuration, as it is visible both in the worker pool configuration and in the worker instance's metadata.\nInstead, put secret configuration in the [secrets service](https://docs.taskcluster.net/docs/reference/workers/worker-runner).\n",
            "title": "Worker Config",
            "type": "object"
          },
          "workerManager": {
            "additionalProperties": false,
            "description": "Worker Manager's own configuration settings per launch configuration.\nThe other properties of the launch configuration section are passed directly through to\nGCP APIs, whereas this section is interpreted directly by Worker Manager.",
            "properties": {
              "capacityPerInstance": {
                "description": "The number of tasks a single worker of this type can run at any given time.",
                "minimum": 1,
                "title": "Capacity Per Instance",
                "type": "integer"
              },
              "initialWeight": {
                "description": "The initial weight of the launch configuration at the provisionining time.\nLaunch configurations with higher weight will be more likely to be selected.\nIf not specified, the default weight is `1`.\nSpecifying a weight of `0` will prevent the launch configuration from being selected.\nWhena all launch configurations have same weight, they will be selected in a round-robin fashion.",
                "maximum": 1,
                "minimum": 0,
                "title": "Initial Weight",
                "type": "number"
              },
              "launchConfigId": {
                "description": "The ID of the launch configuration. Must be unique forever within the worker pool.\nAny change to the launch configuration (except `workerManager` fields) must use a new ID\nto ensure proper tracking of configuration metrics.\nIf not provided, worker-manager will generate a unique ID.\nMust be between 1 and 38 characters long and contain only alphanumeric\ncharacters, dashes, and underscores.\n",
                "maxLength": 38,
                "minLength": 1,
                "pattern": "^([a-zA-Z0-9-_]*)$",
                "title": "Launch Configuration ID",
                "type": "string"
              },
              "maxCapacity": {
                "description": "The maximum capacity of workers of this type (launch configuration)\nthat can be running at any given time.\nThis value is independent from worker pool's `maxCapacity`, which\ncontrols total number of workers for the whole pool.\nEffective max capacity for the launch config would be\n`min(workerPool.maxCapacity, launchConfigMaxCapacity)`.",
                "minimum": 0,
                "title": "Max Capacity",
                "type": "integer"
              }
            },
            "title": "Worker Manager Config",
            "type": "object"
          },
          "zone": {
            "description": "The gcloud az this worker should be spawned in. This az must be included because many resources (such as\nmachine types and disk types) are az-specific.\n",
            "title": "Availability Zone",
            "type": "string"
          }
        },
        "required": [
          "workerConfig",
          "region",
          "zone",
          "machineType",
          "disks",
          "networkInterfaces",
          "scheduling"
        ],
        "type": "object"
      },
      "title": "Choices",
      "type": "array",
      "uniqueItems": true
    },
    "lifecycle": {
      "$ref": "worker-lifecycle.json#"
    },
    "maxCapacity": {
      "description": "The maximum amount of capacity that worker-manager should make\navailable at any given time for the entire workerpool.\n",
      "minimum": 0,
      "title": "Maximum Capacity",
      "type": "integer"
    },
    "minCapacity": {
      "description": "The minimum amount of capacity that worker-manager should make\navailable at any given time for the entire workerpool.\n",
      "minimum": 0,
      "title": "Minimum Capacity",
      "type": "integer"
    },
    "scalingRatio": {
      "description": "The scaling ratio is a ratio of worker capacity to pending tasks - a ratio\nof 1.0 means that 1 capacity will be added for each pending task\n",
      "maximum": 1,
      "minimum": 0,
      "title": "Scaling Ratio",
      "type": "number"
    }
  },
  "required": [
    "minCapacity",
    "maxCapacity",
    "launchConfigs"
  ],
  "title": "Google Provider Config",
  "type": "object"
}