Skip to content

Commit

Permalink
Enable task sizer for Firecracker CPU (#7487)
Browse files Browse the repository at this point in the history
  • Loading branch information
bduffany authored Sep 18, 2024
1 parent 42637d2 commit 3ba0238
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions enterprise/server/tasksize/tasksize.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,6 @@ func (s *taskSizer) Get(ctx context.Context, task *repb.ExecutionTask) *scpb.Tas
if props.DisableMeasuredTaskSize {
return nil
}
// Don't use measured task sizes for Firecracker tasks for now, since task
// sizes are used as hard limits on allowed resources.
if props.WorkloadIsolationType == string(platform.FirecrackerContainerType) {
return nil
}
statusLabel := "hit"
defer func() {
groupID, _ := s.groupKey(ctx)
Expand All @@ -167,10 +162,19 @@ func (s *taskSizer) Get(ctx context.Context, task *repb.ExecutionTask) *scpb.Tas
// executor run this task once to estimate the size.
return nil
}
return applyMinimums(task, &scpb.TaskSize{
size := applyMinimums(task, &scpb.TaskSize{
EstimatedMemoryBytes: recordedSize.EstimatedMemoryBytes,
EstimatedMilliCpu: recordedSize.EstimatedMilliCpu,
})
// Don't size memory automatically for Firecracker VMs, since if we size it
// incorrectly, it can cause OOM errors.
// TODO(https://github.com/buildbuddy-io/buildbuddy-internal/issues/3824):
// use these sizes for determining how many VMs to schedule concurrently,
// but not for the upper limit on VM size.
if props.WorkloadIsolationType == string(platform.FirecrackerContainerType) {
size.EstimatedMemoryBytes = 0
}
return size
}

func (s *taskSizer) Predict(ctx context.Context, task *repb.ExecutionTask) *scpb.TaskSize {
Expand Down

0 comments on commit 3ba0238

Please sign in to comment.