Service Level Agreement (SLA) Plugin
Introduction
When users apply jobs to volcano, they may need adding some particular constraints to job, for example, longest Pending time aiming to prevent job from starving. And these constraints can be regarded as Service Level Agreement (SLA) which are agreed between volcano and user. So sla plugin is provided to receive and realize SLA settings for both individual job and whole cluster.
Solution
-
In sla plugin, arguments
sla-waiting-timeis provided to realize job resource reservation:sla-waiting-timeis maximum time one job should stayPendingorinqueuestatus and not be allocated. Whensla-waiting-timeis over,slaplugin sets the job to beinqueueinenqueueaction immediately. Thenslaplugin locks idle resources pre-allocated to pods of this job inallocateaction, even if the job has not beenReadyyet. In this way,slaplugin realizes large job election and resource reservation, thus replaceselect&reserveaction in v1.1.0. -
Arguments
sla-waiting-timecan be set for one job, and for all jobs in cluster.-
For one job, user can set them in job annotations in following format:
apiVersion: batch.volcano.sh/v1alpha1 kind: Job metadata: annotations: sla-waiting-time: 1h2m3s -
For all jobs, user can set
sla-waiting-timefield inslaplugin arguments viavolcano-scheduler-configmapin following format:actions: "enqueue, allocate, backfill" tiers: - plugins: - name: priority - name: gang - name: sla arguments: sla-waiting-time: 1h2m3s
-
-
slaplugin return 3 callback functions:JobEnqueueableFn,JobPipelinedFn, andJobOrderFn:-
JobEnqueueableFnreturnsPermitwhen job waiting time inPendingstatus is longer thansla-waiting-time, and job will go throughenqueueaction and beinqueueinstantly, regardless of other plugins returningRejectorAbstainto reject this job from beinginqueue. -
JobPipelinedFnreturnsPermitwhen job waiting time ininqueuestatus is longer thansla-waiting-time, and job will bePipelinedstatus instantly, regardless of other plugins returningRejectorAbstainto reject this job from beingPipelined. In this wayallocateaction reserves resources for pods of the job even if the job is not Ready yet. -
JobOrderFnadjusts the order of this job in waiting queues ofenqueue&allocateaction. The more close tosla-waiting-timethat job waiting time is, the higher scored of this job inJobOrderFnofslaplugin, so that job would have larger probability to be front int priority queue, which means that it can touch more idle resources and have higher priority to beinqueueand allocated.
-
-
the execution flow chart of
slaplugin is shown as below:
Feature Interaction
- By now we only need 1 argument
sla-waiting-time, so I add it into annotations for simplicity and invocation, but whenslaplugin is extended with more arguments, a better way to invoke this plugin may be job plugin likesvcandssh.