Skip to content

Commit

Permalink
feat: customization for batch jobs. Closes #259 (#300)
Browse files Browse the repository at this point in the history
Signed-off-by: David Seapy <dseapy@gmail.com>
  • Loading branch information
dseapy committed Nov 1, 2022
1 parent d16015f commit cc44875
Show file tree
Hide file tree
Showing 19 changed files with 3,167 additions and 27,192 deletions.
70 changes: 70 additions & 0 deletions api/json-schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -18161,6 +18161,72 @@
},
"type": "object"
},
"io.numaproj.numaflow.v1alpha1.JobTemplate": {
"properties": {
"affinity": {
"$ref": "#/definitions/io.k8s.api.core.v1.Affinity",
"description": "The pod's scheduling constraints More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/"
},
"backoffLimit": {
"description": "Specifies the number of retries before marking this job failed. More info: https://kubernetes.io/docs/concepts/workloads/controllers/job/#pod-backoff-failure-policy Numaflow defaults to 20",
"format": "int32",
"type": "integer"
},
"containerTemplate": {
"$ref": "#/definitions/io.numaproj.numaflow.v1alpha1.ContainerTemplate"
},
"imagePullSecrets": {
"description": "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod",
"items": {
"$ref": "#/definitions/io.k8s.api.core.v1.LocalObjectReference"
},
"type": "array",
"x-kubernetes-patch-merge-key": "name",
"x-kubernetes-patch-strategy": "merge"
},
"metadata": {
"$ref": "#/definitions/io.numaproj.numaflow.v1alpha1.Metadata",
"description": "Metadata sets the pods's metadata, i.e. annotations and labels"
},
"nodeSelector": {
"additionalProperties": {
"type": "string"
},
"description": "NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/",
"type": "object"
},
"priority": {
"description": "The priority value. Various system components use this field to find the priority of the Redis pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority. More info: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/",
"format": "int32",
"type": "integer"
},
"priorityClassName": {
"description": "If specified, indicates the Redis pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default. More info: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/",
"type": "string"
},
"securityContext": {
"$ref": "#/definitions/io.k8s.api.core.v1.PodSecurityContext",
"description": "SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field."
},
"serviceAccountName": {
"description": "ServiceAccountName applied to the pod",
"type": "string"
},
"tolerations": {
"description": "If specified, the pod's tolerations.",
"items": {
"$ref": "#/definitions/io.k8s.api.core.v1.Toleration"
},
"type": "array"
},
"ttlSecondsAfterFinished": {
"description": "ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes. Numaflow defaults to 30",
"format": "int32",
"type": "integer"
}
},
"type": "object"
},
"io.numaproj.numaflow.v1alpha1.KafkaSink": {
"properties": {
"brokers": {
Expand Down Expand Up @@ -18709,6 +18775,10 @@
"daemon": {
"$ref": "#/definitions/io.numaproj.numaflow.v1alpha1.DaemonTemplate",
"description": "DaemonTemplate is used to customize the Daemon Deployment"
},
"job": {
"$ref": "#/definitions/io.numaproj.numaflow.v1alpha1.JobTemplate",
"description": "JobTemplate is used to customize Jobs"
}
},
"type": "object"
Expand Down
70 changes: 70 additions & 0 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -18156,6 +18156,72 @@
}
}
},
"io.numaproj.numaflow.v1alpha1.JobTemplate": {
"type": "object",
"properties": {
"affinity": {
"description": "The pod's scheduling constraints More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/",
"$ref": "#/definitions/io.k8s.api.core.v1.Affinity"
},
"backoffLimit": {
"description": "Specifies the number of retries before marking this job failed. More info: https://kubernetes.io/docs/concepts/workloads/controllers/job/#pod-backoff-failure-policy Numaflow defaults to 20",
"type": "integer",
"format": "int32"
},
"containerTemplate": {
"$ref": "#/definitions/io.numaproj.numaflow.v1alpha1.ContainerTemplate"
},
"imagePullSecrets": {
"description": "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod",
"type": "array",
"items": {
"$ref": "#/definitions/io.k8s.api.core.v1.LocalObjectReference"
},
"x-kubernetes-patch-merge-key": "name",
"x-kubernetes-patch-strategy": "merge"
},
"metadata": {
"description": "Metadata sets the pods's metadata, i.e. annotations and labels",
"$ref": "#/definitions/io.numaproj.numaflow.v1alpha1.Metadata"
},
"nodeSelector": {
"description": "NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"priority": {
"description": "The priority value. Various system components use this field to find the priority of the Redis pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority. More info: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/",
"type": "integer",
"format": "int32"
},
"priorityClassName": {
"description": "If specified, indicates the Redis pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default. More info: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/",
"type": "string"
},
"securityContext": {
"description": "SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.",
"$ref": "#/definitions/io.k8s.api.core.v1.PodSecurityContext"
},
"serviceAccountName": {
"description": "ServiceAccountName applied to the pod",
"type": "string"
},
"tolerations": {
"description": "If specified, the pod's tolerations.",
"type": "array",
"items": {
"$ref": "#/definitions/io.k8s.api.core.v1.Toleration"
}
},
"ttlSecondsAfterFinished": {
"description": "ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes. Numaflow defaults to 30",
"type": "integer",
"format": "int32"
}
}
},
"io.numaproj.numaflow.v1alpha1.KafkaSink": {
"type": "object",
"required": [
Expand Down Expand Up @@ -18696,6 +18762,10 @@
"daemon": {
"description": "DaemonTemplate is used to customize the Daemon Deployment",
"$ref": "#/definitions/io.numaproj.numaflow.v1alpha1.DaemonTemplate"
},
"job": {
"description": "JobTemplate is used to customize Jobs",
"$ref": "#/definitions/io.numaproj.numaflow.v1alpha1.JobTemplate"
}
}
},
Expand Down

0 comments on commit cc44875

Please sign in to comment.