Documentation
¶
Index ¶
- Constants
- Variables
- func Add(mgr manager.Manager, runtimeConfig config.RuntimeConfig) error
- func GetReadyReplicaCountForRole(pods []*v1.Pod) int32
- func MaxSurge(role *orchestrationv1alpha1.RoleSpec) int32
- func MaxUnavailable(role *orchestrationv1alpha1.RoleSpec) int32
- func RemoveRoleSetCondition(status *orchestrationv1alpha1.RoleSetStatus, ...)
- func SetRoleSetCondition(status *orchestrationv1alpha1.RoleSetStatus, ...)
- type RoleRollingSyncer
- type RoleSetReconciler
- type RollingManager
- type RollingManagerInterleave
- type RollingManagerParallel
- type RollingManagerSequential
- type StatefulRoleSyncer
- func (s *StatefulRoleSyncer) AllReady(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet, ...) (bool, error)
- func (s *StatefulRoleSyncer) CheckCurrentStep(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet, ...) (bool, int32, error)
- func (s *StatefulRoleSyncer) Rollout(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet, ...) error
- func (s *StatefulRoleSyncer) RolloutByStep(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet, ...) error
- func (s *StatefulRoleSyncer) Scale(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet, ...) (bool, error)
- type StatelessRoleSyncer
- func (s *StatelessRoleSyncer) AllReady(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet, ...) (bool, error)
- func (s *StatelessRoleSyncer) CheckCurrentStep(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet, ...) (bool, int32, error)
- func (s *StatelessRoleSyncer) Rollout(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet, ...) error
- func (s *StatelessRoleSyncer) RolloutByStep(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet, ...) error
- func (s *StatelessRoleSyncer) Scale(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet, ...) (bool, error)
Constants ¶
const ( ControllerName = "roleset-controller" RoleSetFinalizer = "orchestration.aibrix.ai/roleset-finalizer" DefaultRequeueAfter = 15 * time.Second DefaultRetryDelay = 1 * time.Second PodBurst = 500 PodOperationInitBatchSize = 16 )
const ( ReadyConditionType = "Ready" ProgressingConditionType = "Progressing" FailureConditionType = "Failure" PodGroupSyncedEventType = "PodGroupSynced" PodSyncedEventType = "PodSynced" FailureEventType = "Failure" )
Variables ¶
var (
ContainerInjectEnv = sets.NewString(constants.RoleTemplateHashEnvKey, constants.StormServiceNameEnvKey, constants.RoleSetNameEnvKey, constants.RoleSetIndexEnvKey, constants.RoleNameEnvKey, constants.RoleReplicaIndexEnvKey)
)
Functions ¶
func Add ¶
func Add(mgr manager.Manager, runtimeConfig config.RuntimeConfig) error
Add creates a new ModelAdapter Controller and adds it to the Manager with default RBAC. The Manager will set fields on the Controller and Start it when the Manager is Started.
func GetReadyReplicaCountForRole ¶
GetReadyReplicaCountForRole returns the number of ready roleSets corresponding to the given replica sets.
func MaxSurge ¶
func MaxSurge(role *orchestrationv1alpha1.RoleSpec) int32
func MaxUnavailable ¶
func MaxUnavailable(role *orchestrationv1alpha1.RoleSpec) int32
func RemoveRoleSetCondition ¶
func RemoveRoleSetCondition(status *orchestrationv1alpha1.RoleSetStatus, condType orchestrationv1alpha1.ConditionType)
RemoveRoleSetCondition removes the roleSet condition with the provided type.
func SetRoleSetCondition ¶
func SetRoleSetCondition(status *orchestrationv1alpha1.RoleSetStatus, condition orchestrationv1alpha1.Condition)
SetRoleSetCondition updates the roleSet to include the provided condition. If the condition that we are about to add already exists and has the same status and reason then we are not going to update.
Types ¶
type RoleRollingSyncer ¶
type RoleRollingSyncer interface { Scale(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet, role *orchestrationv1alpha1.RoleSpec) (bool, error) Rollout(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet, role *orchestrationv1alpha1.RoleSpec) error RolloutByStep(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet, role *orchestrationv1alpha1.RoleSpec, currentStep int32) error AllReady(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet, role *orchestrationv1alpha1.RoleSpec) (bool, error) CheckCurrentStep(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet, role *orchestrationv1alpha1.RoleSpec) (bool, int32, error) }
func GetRoleSyncer ¶
func GetRoleSyncer(cli client.Client, role *orchestrationv1alpha1.RoleSpec) RoleRollingSyncer
type RoleSetReconciler ¶
type RoleSetReconciler struct { client.Client Scheme *runtime.Scheme EventRecorder record.EventRecorder }
RoleSetReconciler reconciles a RoleSet object
type RollingManager ¶
type RollingManager interface {
Next(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet) error
}
type RollingManagerInterleave ¶
type RollingManagerInterleave struct {
// contains filtered or unexported fields
}
func (*RollingManagerInterleave) Next ¶
func (m *RollingManagerInterleave) Next(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet) (err error)
Interleaved rollout: update roles in alternating steps, using (maxSurge + maxUnavailable) as the step size for all roles
type RollingManagerParallel ¶
type RollingManagerParallel struct {
// contains filtered or unexported fields
}
func (*RollingManagerParallel) Next ¶
func (m *RollingManagerParallel) Next(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet) (err error)
type RollingManagerSequential ¶
type RollingManagerSequential struct {
// contains filtered or unexported fields
}
func (*RollingManagerSequential) Next ¶
func (m *RollingManagerSequential) Next(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet) (err error)
type StatefulRoleSyncer ¶
type StatefulRoleSyncer struct {
// contains filtered or unexported fields
}
func (*StatefulRoleSyncer) AllReady ¶
func (s *StatefulRoleSyncer) AllReady(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet, role *orchestrationv1alpha1.RoleSpec) (bool, error)
func (*StatefulRoleSyncer) CheckCurrentStep ¶
func (s *StatefulRoleSyncer) CheckCurrentStep(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet, role *orchestrationv1alpha1.RoleSpec) (bool, int32, error)
func (*StatefulRoleSyncer) Rollout ¶
func (s *StatefulRoleSyncer) Rollout(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet, role *orchestrationv1alpha1.RoleSpec) error
func (*StatefulRoleSyncer) RolloutByStep ¶
func (s *StatefulRoleSyncer) RolloutByStep(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet, role *orchestrationv1alpha1.RoleSpec, currentStep int32) error
func (*StatefulRoleSyncer) Scale ¶
func (s *StatefulRoleSyncer) Scale(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet, role *orchestrationv1alpha1.RoleSpec) (bool, error)
type StatelessRoleSyncer ¶
type StatelessRoleSyncer struct {
// contains filtered or unexported fields
}
func (*StatelessRoleSyncer) AllReady ¶
func (s *StatelessRoleSyncer) AllReady(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet, role *orchestrationv1alpha1.RoleSpec) (bool, error)
func (*StatelessRoleSyncer) CheckCurrentStep ¶
func (s *StatelessRoleSyncer) CheckCurrentStep(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet, role *orchestrationv1alpha1.RoleSpec) (bool, int32, error)
CheckCurrentStep determines which step the current role is in
func (*StatelessRoleSyncer) Rollout ¶
func (s *StatelessRoleSyncer) Rollout(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet, role *orchestrationv1alpha1.RoleSpec) error
func (*StatelessRoleSyncer) RolloutByStep ¶
func (s *StatelessRoleSyncer) RolloutByStep(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet, role *orchestrationv1alpha1.RoleSpec, currentStep int32) error
RolloutByStep performs rollout in steps based on the defined step size
func (*StatelessRoleSyncer) Scale ¶
func (s *StatelessRoleSyncer) Scale(ctx context.Context, roleSet *orchestrationv1alpha1.RoleSet, role *orchestrationv1alpha1.RoleSpec) (bool, error)