Add provider worker code

Runners now get created and cleaned up in scale sets.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2025-04-24 23:29:40 +00:00
parent 436fd7746f
commit 004ad1f124
23 changed files with 837 additions and 147 deletions

View file

@ -86,17 +86,6 @@ type Pool struct {
Priority uint `gorm:"index:idx_pool_priority"`
}
type ScaleSetEvent struct {
gorm.Model
EventType params.EventType
EventLevel params.EventLevel
Message string `gorm:"type:text"`
ScaleSetID uint `gorm:"index:idx_scale_set_event"`
ScaleSet ScaleSet `gorm:"foreignKey:ScaleSetID"`
}
// ScaleSet represents a github scale set. Scale sets are almost identical to pools with a few
// notable exceptions:
// - Labels are no longer relevant
@ -146,11 +135,7 @@ type ScaleSet struct {
EnterpriseID *uuid.UUID `gorm:"index"`
Enterprise Enterprise `gorm:"foreignKey:EnterpriseID"`
Status string
StatusReason string `gorm:"type:text"`
Instances []Instance `gorm:"foreignKey:ScaleSetFkID"`
Events []ScaleSetEvent `gorm:"foreignKey:ScaleSetID;constraint:OnDelete:CASCADE,OnUpdate:CASCADE;"`
Instances []Instance `gorm:"foreignKey:ScaleSetFkID"`
}
type RepositoryEvent struct {