From 9a57931442fec82aa06d3cc9d6dd935440576bb8 Mon Sep 17 00:00:00 2001 From: Brandon Duffany Date: Thu, 14 Nov 2024 16:36:46 -0500 Subject: [PATCH] Deprecate ambiguous task_size fields --- proto/scheduler.proto | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/proto/scheduler.proto b/proto/scheduler.proto index 726810c4562d..32b42da053ed 100644 --- a/proto/scheduler.proto +++ b/proto/scheduler.proto @@ -118,12 +118,24 @@ message TaskSize { // Next ID: 9 message SchedulingMetadata { - // Task size used for scheduling purposes, when the scheduler is deciding - // which executors (if any) may execute a task, and also when an executor is - // deciding which task to dequeue. Executors may see a different value of this - // field than what the scheduler sees, depending on measured_task_size or - // predicted_task_size. See documentation of those fields for more info. - TaskSize task_size = 1; + // DEPRECATED. This field has two different meanings: + // 1. The execution server sets this to the task size "estimate" which only + // incorporates the default task size and user-requested size, and not any + // historical information or model predictions. This estimate is now split + // into two separate fields: default_task_size and requested_size. + // 2. Just before scheduling, the scheduler sets this to the "final" task size + // that should be used by the executor, which incorporates the measured + // size or model-predicated size as applicable. This is replaced by + // EnqueueTaskReservationRequest.task_size. + TaskSize task_size = 1 [deprecated = true]; + + // A default task size based on some hard-coded parameters. For example, + // non-test actions may be given some default task size, test actions + // declaring TEST_SIZE=large in their environment variables may be given a + // predefined number of resources, etc. Certain other rules may apply; e.g. VM + // isolation may require additional resources. If no better estimate is + // available, this is the size that is used. + TaskSize default_task_size = 13; // Task size measured from a previous task execution of a similar task, if // such data is available. @@ -206,7 +218,13 @@ message ReEnqueueTaskResponse { message EnqueueTaskReservationRequest { string task_id = 1; - TaskSize task_size = 2; + + // The size of the task that determines how many resources the executor should + // allocate for this task. + // + // DEPRECATED: use scheduling_metadata.scheduled_size instead. + TaskSize task_size = 2 [deprecated = true]; + SchedulingMetadata scheduling_metadata = 3; // If set, enqueue the task reservation on the given executor instance if it