request

package
v0.0.0-...-9febfc8 Latest Latest
Warning

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

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

Documentation

Overview

Package request provides a library to create swarming requests based on skylab test or task parameters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Args

type Args struct {
	// Cmd specifies the payload command to run for the request.
	Cmd worker.Command
	// TODO(crbug.com/1033291): Rename to Skylab tags.
	SwarmingTags []string
	// SwarmingPool specifies the pool that the test runner build should run
	// in. This is used when checking for bots during requests/
	//
	// Defaults to `ChromeOSSkylab` if not provided
	SwarmingPool string
	// ProvisionableDimensions specifies the provisionable dimensions in raw
	// string form; e.g. {"provisionable-cros-version:foo-cq-R75-1.2.3.4"}
	ProvisionableDimensions []string
	// ProvisionableDimensionExpiration specifies the interval of time
	// during which Swarming will attempt to find a bot matching optional
	// (i.e. provisionable) dimensions. After the expiration time Swarming
	// will only use required dimensions for finding the bot.
	ProvisionableDimensionExpiration time.Duration
	// Dimensions specifies swarming dimensions in raw string form.
	//
	// It is preferable to specify dimensions via the SchedulableLabels
	// argument. This argument should only be used for user-supplied freeform
	// dimensions; e.g. {"label-power:battery"}
	Dimensions []string
	// SchedulableLabels specifies schedulable label requirements that will
	// be translated to dimensions.
	SchedulableLabels *inventory.SchedulableLabels
	// Contain a slice of SchedulableLabels instance, which each of them
	// represents scheduleable label requirements of a secondary devices.
	SecondaryDevicesLabels []*inventory.SchedulableLabels
	Timeout                time.Duration
	Priority               int64
	ParentTaskID           string
	ParentRequestUID       string
	// Parent build's BBID
	ParentBuildID int64
	// Pubsub Topic for status updates on the tests run for the request
	StatusTopic string
	// If CFT is enabled.
	CFTIsEnabled bool
	// Test describes the test to be run.
	TestRunnerRequest *skylab_test_runner.Request
	// Describes the test to be run via CFT workflow.
	CFTTestRunnerRequest *skylab_test_runner.CFTTestRequest
	// Describes the dynamic workflow by which tests will be ran via CFT.
	DynamicTestRunnerRequest *api.CrosTestRunnerDynamicRequest
	// Experiments to pass on to test_runner builders.
	Experiments []string
	// The Gerrit Changes associated with the test_runner invocation.
	GerritChanges []*buildbucket_pb.GerritChange
	// The test results mode associated with the test_runner invocation.
	ResultsConfig *test_platform.Request_Params_ResultsUploadConfig
	// If the current run is an AL run
	IsALRun bool
}

Args defines the set of arguments for creating a request.

func (*Args) NewBBRequest

NewBBRequest returns the Buildbucket request to create the test_runner build with these arguments.

func (*Args) StaticDimensions

func (a *Args) StaticDimensions() ([]*swarming.SwarmingRpcsStringPair, error)

StaticDimensions returns the dimensions required on a Swarming bot that can service this request.

StaticDimensions() do not include dimensions used to optimize task scheduling.

func (*Args) SwarmingNewTaskRequest

func (a *Args) SwarmingNewTaskRequest() (*swarming.SwarmingRpcsNewTaskRequest, error)

SwarmingNewTaskRequest returns the Swarming request to create the Skylab task with these arguments.

type MessagePayload

type MessagePayload struct {
	ParentRequestUID string `json:"parent_request_uid,omitempty"`
}

MessagePayload contains the information for Pubsub subscribers.

Jump to

Keyboard shortcuts

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