Proposal: Revamp task executor interface #63
Labels
area/api
Related to public APIs, including CRD design, configuration, etc
component/execution
Issues or PRs related exclusively to the Execution component (Job, JobConfig)
kind/proposal
Proposal for new ideas or features
Milestone
Motivation
The task executor interface has so far been implemented in a generic manner, allowing other task executor implementations to be created. However, not much work has been put into designing and deciding what should constitute a Task from Furiko's point of view.
To focus more on the scheduling aspect, we can and should delegate task execution to other downstream executors when possible. At the same time, not all kinds of "tasks" are suitable to be written using the
PodTemplateSpec
API.Proposal
In view of the above, I propose that we should expand the definition of a "task" to potentially include, but not limited to, the following examples:
Task
object, for example.A task should minimally support the following semantics:
API Design
Example of JobConfig API to be updated:
pod
Supported by the Pod task executor.
workflow
Supported by Argo Workflows'
Workflow
API.The following example is taken from https://github.com/argoproj/argo-workflows/blob/0b2f2d1f23bead3bc0ab34049192d06594b575ba/examples/template-defaults.yaml.
http
Should be implemented by a custom HTTP executor extension service. These executors will pick up
HTTPRequest
tasks and reconcile them, followed by triggering the HTTP request within the cluster.The API schema could follow HAR (HTTP Archive Request) format: https://en.wikipedia.org/wiki/HAR_(file_format)
Additional notes:
true
,false
, orundefined
/null
. Another way is to use truthy/falsy values, this same problem may be solved intext/template
as well.This is probably a very hard problem to solve.. so we may choose not to implement it at all. Or another way is to simply specify a very strict requirement for what endpoints are supported, and fail fast and reliably if they do not conform to the "correct" kind of endpoint.
customResource
Supports creating custom resources, similar to Argo's ResourceTemplate.
Additional notes:
http
above, we need a way to determine the task's current state. This could be specified in thecustomResource
specification itself but it may be quite clunky.Design Considerations
Embedding Types
There are some issues with embedding third-party types, even including Kubernetes' core types.
v1alpha1
, which basically means they are free to break backwards compatibility guarantees at any time.One solution is to require users to define these third-party API types as YAML string literals, but validate the payload at runtime. If we support substitution of values (which can only happen at execution time), then there may not be a way to validate the JobConfig at save-time.
Example of
workflow
following thecustomResource
executor:Since we know beforehand how to interpret a Workflow's status, the user only really has to specify the
manifest
.Another solution without needing to use a string is to use
type: object
in the CRD definition withoutproperties
, which prevents any schema validation. We could consider doing this for the PodTemplateSpec field currently as well.Curse of Generality
In some cases, the above proposed design may be too flexible and could open the floor to a whole slew of additional requirements and problems in the future.
The alternative approach is to provide a small surface of well-defined and well-supported executors, which could also be interfaces themselves. One example is to repurpose a Pod into a generic interface for another underlying workload using Virtual Kubelet.
The text was updated successfully, but these errors were encountered: