Skip to content

Commit

Permalink
add pre-emptible config
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-lombardi committed Nov 4, 2024
1 parent 5b156a7 commit b763ca3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/scheduler/pool_external.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,10 @@ func (wpc *ExternalWorkerPoolController) getWorkerEnvironment(workerId, machineI
Name: "NETWORK_PREFIX",
Value: machineId,
},
{
Name: "PREEMPTABLE",
Value: strconv.FormatBool(wpc.workerPool.Preemptable),
},
}

remoteConfig, err := providers.GetRemoteConfig(wpc.config, wpc.tailscale)
Expand Down
4 changes: 4 additions & 0 deletions pkg/scheduler/pool_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,10 @@ func (wpc *LocalKubernetesWorkerPoolController) getWorkerEnvironment(workerId st
},
},
},
{
Name: "PREEMPTABLE",
Value: strconv.FormatBool(wpc.workerPool.Preemptable),
},
}

if wpc.config.Worker.UseGatewayServiceHostname {
Expand Down
1 change: 1 addition & 0 deletions pkg/scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ func (s *Scheduler) StartProcessingRequests() {
log.Printf("Unable to schedule request for container<%s>: %v\n", request.ContainerId, err)
s.addRequestToBacklog(request)
}

return
}
}
Expand Down
1 change: 1 addition & 0 deletions pkg/types/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ type WorkerPoolConfig struct {
DefaultMachineCost float64 `key:"defaultMachineCost" json:"default_machine_cost"`
RequiresPoolSelector bool `key:"requiresPoolSelector" json:"requires_pool_selector"`
Priority int32 `key:"priority" json:"priority"`
Preemptable bool `key:"preemptable" json:"preemptable"`
}

type WorkerPoolJobSpecConfig struct {
Expand Down

0 comments on commit b763ca3

Please sign in to comment.