run

package
v0.0.0-...-3c039c4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2025 License: BSD-3-Clause Imports: 27 Imported by: 0

Documentation

Overview

Package run holds all of the internal logic for the execution steps of a SuiteScheduler run.

Package run holds all of the internal logic for the execution steps of a SuiteScheduler run.

Package run holds all of the internal logic for the execution steps of a SuiteScheduler run.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildMultiDUTCTPRequest

func BuildMultiDUTCTPRequest(config *suschpb.SchedulerConfig, branchTrigger string, targetPair *multiDUTTargetPair) (*ctpEvent, error)

BuildMultiDUTCTPRequest generates a single CTP request for a MULTI_DUT config.

func RunDDDCommand

func RunDDDCommand(command DDDCommand) error

RunDDDCommand runs an arbitrary 3D command.

func RunNewBuildCommand

func RunNewBuildCommand(command NewBuildCommand) error

RunNewBuildCommand runs any arbitrary NewBuildCommand Interface.

func RunTimedEventsCommand

func RunTimedEventsCommand(command TimedEventCommand, runTime common.KronTime) error

RunTimedEventsCommand runs any arbitrary TimedEventCommand Interface.

Types

type BuildPackage3d

type BuildPackage3d struct {
	Branch   suschpb.Branch
	Builds   []*kronpb.Build
	Messages []*cloudPubsub.Message
}

BuildPackage3d represents a struct responsible for managing pubsub messages and later building CTP requests for 3D configurations.

type CrOSMultiDUTCommand

type CrOSMultiDUTCommand struct {
	// contains filtered or unexported fields
}

CrOSMultiDUTCommand implements NewBuildCommand.

func (*CrOSMultiDUTCommand) FetchBuilds

func (c *CrOSMultiDUTCommand) FetchBuilds() ([]*kronpb.Build, error)

FetchBuilds gathers builds out of the Release Pub/Sub stream and converts them to kronpb.Builds.

func (*CrOSMultiDUTCommand) FetchTriggeredConfigs

func (c *CrOSMultiDUTCommand) FetchTriggeredConfigs(kronBuilds []*kronpb.Build) (map[*kronpb.Build][]*suschpb.SchedulerConfig, error)

FetchTriggeredConfigs takes in the list of received builds and gathers all configs which track those buildTargets.

func (*CrOSMultiDUTCommand) Name

func (c *CrOSMultiDUTCommand) Name() string

Name returns the custom name of the command. This will be used in logging.

func (*CrOSMultiDUTCommand) ScheduleRequests

func (c *CrOSMultiDUTCommand) ScheduleRequests(kronBuildMap map[*kronpb.Build][]*suschpb.SchedulerConfig) error

ScheduleRequests locates secondary device information, generates CTP Requests, batches them into BuildBucket requests, and Schedules them via the BuildBucket API.

type CrOSNewBuild3dCommand

type CrOSNewBuild3dCommand struct {
	// contains filtered or unexported fields
}

CrOSNewBuild3dCommand implements DDDCommand.

func (*CrOSNewBuild3dCommand) FetchBuilds

func (c *CrOSNewBuild3dCommand) FetchBuilds() error

FetchBuilds retrieves all builds currently sitting in the release team's completed build Pub/Sub queue.

func (*CrOSNewBuild3dCommand) FetchTriggeredConfigs

func (c *CrOSNewBuild3dCommand) FetchTriggeredConfigs() error

FetchTriggeredConfigs returns a map where the keys are release orchestrator bbid values and the values are lists of completed builds. The function ensures that the map only contains entries for release orchestrators that have completed.

func (*CrOSNewBuild3dCommand) Name

func (c *CrOSNewBuild3dCommand) Name() string

Name returns the custom name of the command. This will be used in logging.

func (*CrOSNewBuild3dCommand) ScheduleRequests

func (c *CrOSNewBuild3dCommand) ScheduleRequests() error

ScheduleRequests generates CTP Requests, batches them into BuildBucket requests, and Schedules them via the BuildBucket API.

type CrOSNewBuildCommand

type CrOSNewBuildCommand struct {
	// contains filtered or unexported fields
}

CrOSNewBuildCommand implements NewBuildCommand.

func (*CrOSNewBuildCommand) FetchBuilds

func (c *CrOSNewBuildCommand) FetchBuilds() ([]*kronpb.Build, error)

FetchBuilds retrieves all builds currently sitting in the release team's completed build Pub/Sub queue. We then convert each valid report to a kron build for later use. Publishing to the metrics pipeline is performed here as well.

func (*CrOSNewBuildCommand) FetchTriggeredConfigs

func (c *CrOSNewBuildCommand) FetchTriggeredConfigs(kronBuilds []*kronpb.Build) (map[*kronpb.Build][]*suschpb.SchedulerConfig, error)

FetchTriggeredConfigs takes in a list of kron builds and finds which SuiteScheduler Configs they trigger. This is then organized into a map to be used by the next stage in the pipeline.

func (*CrOSNewBuildCommand) Name

func (c *CrOSNewBuildCommand) Name() string

Name returns the custom name of the command. This will be used in logging.

func (*CrOSNewBuildCommand) ScheduleRequests

func (c *CrOSNewBuildCommand) ScheduleRequests(kronBuildMap map[*kronpb.Build][]*suschpb.SchedulerConfig) error

ScheduleRequests generates CTP Requests, batches them into BuildBucket requests, and Schedules them via the BuildBucket API.

type CrOSTimedEventCommand

type CrOSTimedEventCommand struct {
	// contains filtered or unexported fields
}

CrOSTimedEventCommand is a TimedEventCommand which fetches all configs which are are triggered at the current day:hour, fetches all relevant build images, and then schedules their subsequent CTP requests via BuildBucket.

func (*CrOSTimedEventCommand) FetchBuilds

func (c *CrOSTimedEventCommand) FetchBuilds(requiredBuildsMap map[builds.RequiredBuild][]*suschpb.SchedulerConfig) (map[*kronpb.Build][]*suschpb.SchedulerConfig, error)

FetchBuilds gathers all builds needed from long term storage.

func (*CrOSTimedEventCommand) FetchTriggeredConfigs

func (c *CrOSTimedEventCommand) FetchTriggeredConfigs(executionTime common.KronTime) (map[builds.RequiredBuild][]*suschpb.SchedulerConfig, error)

FetchTriggeredConfigs gathers all CrOS TIMED_EVENT configs which are triggered at the passed in execution time.

func (*CrOSTimedEventCommand) Name

func (c *CrOSTimedEventCommand) Name() string

func (*CrOSTimedEventCommand) ScheduleRequests

func (c *CrOSTimedEventCommand) ScheduleRequests(kronBuildMap map[*kronpb.Build][]*suschpb.SchedulerConfig) error

ScheduleRequests generates CTP Requests, batches them into BuildBucket requests, and Schedules them via the BuildBucket API.

type DDDCommand

type DDDCommand interface {
	Name() string
	FetchTriggeredConfigs() error
	FetchBuilds() error
	ScheduleRequests() error
}

DDDCommand defines the schema that any 3D type command will need to follow.

func InitCrOSNewBuild3dCommand

func InitCrOSNewBuild3dCommand(authOpts *authcli.Flags, isProd, dryRun, isTest bool, labConfigs *configparser.LabConfigs, suiteSchedulerConfigs *configparser.SuiteSchedulerConfigs, projectID string) DDDCommand

InitCrOSNewBuild3dCommand generates and returns a CrOS NEW_BUILD_3D client which implements the DDDCommand interface. This client does not handle firmware, Android, nor multi-DUT configs.

type NewBuildCommand

type NewBuildCommand interface {
	Name() string
	FetchBuilds() ([]*kronpb.Build, error)
	FetchTriggeredConfigs([]*kronpb.Build) (map[*kronpb.Build][]*suschpb.SchedulerConfig, error)
	ScheduleRequests(map[*kronpb.Build][]*suschpb.SchedulerConfig) error
}

NewBuildCommand defines the schema that any NEW_BUILD type command will need to follow. The functions were designed such that the returned values feed into the next function.

func InitCrOSMultiDUTCommand

func InitCrOSMultiDUTCommand(authOpts *authcli.Flags, isProd, dryRun, isTest bool, labConfigs *configparser.LabConfigs, suiteSchedulerConfigs *configparser.SuiteSchedulerConfigs, projectID string) NewBuildCommand

InitCrOSMultiDUTCommand generates and returns a CrOS MULTI_DUT client which implements the NewBuildCommand interface. This client will only handle MULTI_DUT configs.

func InitCrOSNewBuildCommand

func InitCrOSNewBuildCommand(authOpts *authcli.Flags, isProd, dryRun, isTest bool, labConfigs *configparser.LabConfigs, suiteSchedulerConfigs *configparser.SuiteSchedulerConfigs, projectID string) NewBuildCommand

InitCrOSNewBuildCommand generates and returns a CrOS NEW_BUILD client which implements the NewBuildCommand interface. This client does not handle firmware, Android, nor multi-DUT configs.

type TimedEventCommand

type TimedEventCommand interface {
	Name() string
	FetchTriggeredConfigs(common.KronTime) (map[builds.RequiredBuild][]*suschpb.SchedulerConfig, error)
	FetchBuilds(map[builds.RequiredBuild][]*suschpb.SchedulerConfig) (map[*kronpb.Build][]*suschpb.SchedulerConfig, error)
	ScheduleRequests(map[*kronpb.Build][]*suschpb.SchedulerConfig) error
}

TimedEventCommand defines the schema that any TIME_EVENTS type command will need to follow. The functions were designed such that the returned values feed into the next function.

func InitCrOSTimedEventCommand

func InitCrOSTimedEventCommand(authOpts *authcli.Flags, isProd, dryRun, isTest bool, labConfigs *configparser.LabConfigs, suiteSchedulerConfigs *configparser.SuiteSchedulerConfigs, projectID string) TimedEventCommand

InitCrOSTimedEventCommand generates and returns a CrOS TIMED_EVENT client which implements the TimedEventCommand interface. This client does not handle firmware, Android, nor multi-DUT configs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL