Documentation
¶
Index ¶
- func DebugRecruitStep(ctx context.Context, db *sql.DB, qm *QuotaManager, creator WorkerCreator, ...) error
- func RecruiterCycle(ctx context.Context, db *sql.DB, qm *QuotaManager, creator WorkerCreator, ...) error
- func StartRecruiterLoop(ctx context.Context, db *sql.DB, qm *QuotaManager, creator WorkerCreator, ...)
- type FlavorDetail
- type QuotaManager
- func (qm *QuotaManager) CanLaunch(region, provider string, cpu int32, memGB float64) bool
- func (qm *QuotaManager) RegisterDelete(region, provider string, cpu int32, memGB float32)
- func (qm *QuotaManager) RegisterInstanceLimit(region, provider string)
- func (qm *QuotaManager) RegisterLaunch(region, provider string, cpu int32, memGB float32)
- type Recruiter
- type RecruiterKey
- type RecruiterState
- type RecyclableWorker
- type RegionInfo
- type RegionalQuota
- type RegionalUsage
- type WorkerCreator
- type WorkflowCounter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DebugRecruitStep ¶
func DebugRecruitStep( ctx context.Context, db *sql.DB, qm *QuotaManager, creator WorkerCreator, stepID int32, ) error
func RecruiterCycle ¶
func RecruiterCycle( ctx context.Context, db *sql.DB, qm *QuotaManager, creator WorkerCreator, recruiterTimers map[RecruiterKey]RecruiterState, workflowCounterMemory map[int32]WorkflowCounter, now time.Time, ) error
func StartRecruiterLoop ¶
func StartRecruiterLoop( ctx context.Context, db *sql.DB, qm *QuotaManager, creator WorkerCreator, recruiterInterval int, )
StartRecruitmentLoop runs the recruitment loop every interval duration
Types ¶
type FlavorDetail ¶
type QuotaManager ¶
type QuotaManager struct {
Quotas map[string]RegionalQuota // keyed by region/provider
Usage sync.Map // key = region/provider string, value = RegionalUsage
}
func NewQuotaManager ¶
func NewQuotaManager(cfg *config.Config) *QuotaManager
NewQuotaManager builds a QuotaManager from the loaded configuration.
func (*QuotaManager) CanLaunch ¶
func (qm *QuotaManager) CanLaunch(region, provider string, cpu int32, memGB float64) bool
func (*QuotaManager) RegisterDelete ¶
func (qm *QuotaManager) RegisterDelete(region, provider string, cpu int32, memGB float32)
func (*QuotaManager) RegisterInstanceLimit ¶ added in v0.7.2
func (qm *QuotaManager) RegisterInstanceLimit(region, provider string)
RegisterInstanceLimit is called when a deployment fails with an instance-count error (e.g. PublicIPCountLimitReached). It learns the limit from the current usage so future deploys are blocked before hitting the Azure API.
func (*QuotaManager) RegisterLaunch ¶
func (qm *QuotaManager) RegisterLaunch(region, provider string, cpu int32, memGB float32)
type Recruiter ¶
type Recruiter struct {
StepID int32
Rank int
TimeoutSeconds int
Protofilter string
WorkerConcurrency *int
WorkerPrefetch *int
CpuPerTask *int
MemoryPerTask *float32
DiskPerTask *float32
ConcurrencyMax *int
ConcurrencyMin *int
PrefetchPercent *int
MaximumWorkers *int
CurrentWorkers int
Rounds int
PendingTasks int
ActiveTaskrate int
TargetTaskrate int
PotentialTaskrate int
WorkflowID int32
TimeoutPassed bool // <- new field
LastTrigger time.Time
RemainingUntilTimeout time.Duration
}
type RecruiterKey ¶
type RecruiterState ¶
type RecyclableWorker ¶
type RegionInfo ¶
type RegionalQuota ¶
type RegionalUsage ¶
type WorkerCreator ¶
type WorkflowCounter ¶
Click to show internal directories.
Click to hide internal directories.