{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://sluice-docs.pages.dev/schemas/namespace.schema.json",
  "$ref": "#/$defs/NamespaceFile",
  "$defs": {
    "Defaults": {
      "properties": {
        "executor": {
          "$ref": "#/$defs/Executor",
          "description": "Default executor."
        },
        "env": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object",
          "description": "Default environment. Flow and task env override by key."
        },
        "retry": {
          "$ref": "#/$defs/Retry",
          "description": "Default retry policy."
        },
        "timeout": {
          "$ref": "#/$defs/Duration",
          "description": "Default task timeout."
        }
      },
      "additionalProperties": false,
      "type": "object"
    },
    "Duration": {
      "type": "string",
      "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$",
      "description": "Duration such as 30s, 10m or 2h."
    },
    "Executor": {
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "process",
            "docker",
            "kubernetes"
          ],
          "description": "Executor type. Resolution order: task, flow, namespace.yaml, instance default."
        },
        "pool": {
          "type": "string",
          "maxLength": 63,
          "pattern": "^[a-z0-9-]+$",
          "description": "Pool of the instances that run the task. Default default."
        },
        "image": {
          "type": "string",
          "description": "docker and kubernetes: container image. Required for these types."
        },
        "inject_runner": {
          "type": "boolean",
          "description": "docker and kubernetes: copy the runner into the container. Default true. False needs sluice on the image PATH."
        },
        "pull": {
          "type": "string",
          "enum": [
            "always",
            "if_not_present",
            "never"
          ],
          "description": "docker: image pull policy. Default if_not_present."
        },
        "network": {
          "type": "string",
          "description": "docker: network name."
        },
        "resources": {
          "$ref": "#/$defs/Resources",
          "description": "docker and kubernetes: requests and limits. Docker uses limits."
        },
        "kubernetes": {
          "$ref": "#/$defs/Kubernetes",
          "description": "kubernetes: pod settings."
        }
      },
      "additionalProperties": false,
      "type": "object"
    },
    "Kubernetes": {
      "properties": {
        "service_account": {
          "type": "string",
          "description": "Service account of the pod."
        },
        "node_selector": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object",
          "description": "Node selector of the pod."
        },
        "tolerations": {
          "items": {
            "$ref": "#/$defs/Toleration"
          },
          "type": "array",
          "description": "Tolerations of the pod."
        },
        "image_pull_secrets": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "description": "Names of image pull secrets."
        },
        "labels": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object",
          "description": "Extra pod labels."
        },
        "annotations": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object",
          "description": "Extra pod annotations."
        }
      },
      "additionalProperties": false,
      "type": "object"
    },
    "NamespaceFile": {
      "properties": {
        "description": {
          "type": "string",
          "maxLength": 2000,
          "description": "Namespace description."
        },
        "defaults": {
          "$ref": "#/$defs/Defaults",
          "description": "Defaults for all flows of the namespace."
        }
      },
      "additionalProperties": false,
      "type": "object"
    },
    "ResourceList": {
      "properties": {
        "cpu": {
          "type": "string",
          "pattern": "^[0-9]+(\\.[0-9]+)?m?$",
          "description": "CPU quantity, for example 500m or 2."
        },
        "memory": {
          "type": "string",
          "pattern": "^[0-9]+(Ki|Mi|Gi|Ti|K|M|G|T)?$",
          "description": "Memory quantity, for example 512Mi."
        }
      },
      "additionalProperties": false,
      "type": "object"
    },
    "Resources": {
      "properties": {
        "requests": {
          "$ref": "#/$defs/ResourceList",
          "description": "Resource requests."
        },
        "limits": {
          "$ref": "#/$defs/ResourceList",
          "description": "Resource limits."
        }
      },
      "additionalProperties": false,
      "type": "object"
    },
    "Retry": {
      "properties": {
        "max_attempts": {
          "type": "integer",
          "maximum": 20,
          "minimum": 1,
          "description": "Attempts including the first. From 1 to 20. Default 1.",
          "default": 1
        },
        "backoff": {
          "type": "string",
          "enum": [
            "fixed",
            "exponential"
          ],
          "description": "Delay growth between attempts. Default fixed."
        },
        "initial": {
          "$ref": "#/$defs/Duration",
          "description": "First delay. Default 10s."
        },
        "max": {
          "$ref": "#/$defs/Duration",
          "description": "Maximum delay. Default 10m."
        }
      },
      "additionalProperties": false,
      "type": "object"
    },
    "Toleration": {
      "properties": {
        "key": {
          "type": "string",
          "description": "Taint key."
        },
        "operator": {
          "type": "string",
          "enum": [
            "Exists",
            "Equal"
          ],
          "description": "Exists or Equal."
        },
        "value": {
          "type": "string",
          "description": "Taint value."
        },
        "effect": {
          "type": "string",
          "enum": [
            "NoSchedule",
            "PreferNoSchedule",
            "NoExecute"
          ],
          "description": "Taint effect."
        },
        "toleration_seconds": {
          "type": "integer",
          "description": "Seconds to tolerate a NoExecute taint."
        }
      },
      "additionalProperties": false,
      "type": "object"
    }
  },
  "title": "Sluice namespace.yaml"
}
