Documentation ¶
Overview ¶
Package swarming implements a client for creating skylab-swarming tasks and getting their results.
Index ¶
- Constants
- func LookupDimension(dims []*swarming_api.SwarmingRpcsStringListPair, key string) (string, error)
- func TaskListURLForTags(swarmingService string, tags []string) string
- func TaskURL(swarmingService string, taskID string) string
- type Client
- func (c *Client) BotExists(ctx context.Context, dims []*swarming_api.SwarmingRpcsStringPair) (bool, error)
- func (c *Client) CancelTask(ctx context.Context, taskID string) error
- func (c *Client) CreateTask(ctx context.Context, req *swarming_api.SwarmingRpcsNewTaskRequest) (*swarming_api.SwarmingRpcsTaskRequestMetadata, error)
- func (c *Client) DutNameToBotID(ctx context.Context, host string) (string, error)
- func (c *Client) GetActiveLeaseTasksForBoard(ctx context.Context, board string) ([]*swarming_api.SwarmingRpcsTaskResult, error)
- func (c *Client) GetActiveLeaseTasksForModel(ctx context.Context, model string) ([]*swarming_api.SwarmingRpcsTaskResult, error)
- func (c *Client) GetBotIDs(ctx context.Context, dims []*swarming_api.SwarmingRpcsStringPair) ([]string, error)
- func (c *Client) GetBots(ctx context.Context, dims []*swarming_api.SwarmingRpcsStringPair) ([]*swarming_api.SwarmingRpcsBotInfo, error)
- func (c *Client) GetFlatBotDimensionsForTask(ctx context.Context, taskID string) (map[string]string, error)
- func (c *Client) GetListedBots(ctx context.Context, dims []*swarming_api.SwarmingRpcsStringPair) ([]*ListedHost, error)
- func (c *Client) GetRequests(ctx context.Context, IDs []string) ([]*swarming_api.SwarmingRpcsTaskRequest, error)
- func (c *Client) GetResults(ctx context.Context, IDs []string) ([]*swarming_api.SwarmingRpcsTaskResult, error)
- func (c *Client) GetResultsForTags(ctx context.Context, tags []string) ([]*swarming_api.SwarmingRpcsTaskResult, error)
- func (c *Client) GetTaskOutputs(ctx context.Context, IDs []string) ([]*swarming_api.SwarmingRpcsTaskOutput, error)
- func (c *Client) GetTaskState(ctx context.Context, ID string) (*swarming_api.SwarmingRpcsTaskStates, error)
- func (c *Client) GetTaskURL(taskID string) string
- type ListedHost
Constants ¶
const SkylabPool = "ChromeOSSkylab"
SkylabPool is the swarming pool for all skylab bots.
Variables ¶
This section is empty.
Functions ¶
func LookupDimension ¶
func LookupDimension(dims []*swarming_api.SwarmingRpcsStringListPair, key string) (string, error)
LookupDimension gets a single string value associated with a dimension
func TaskListURLForTags ¶
TaskListURLForTags returns a tasklist URL filtered by the given tags.
Types ¶
type Client ¶
type Client struct { SwarmingService *swarming_api.Service // contains filtered or unexported fields }
Client is a swarming client for creating tasks and waiting for their results.
func (*Client) BotExists ¶
func (c *Client) BotExists(ctx context.Context, dims []*swarming_api.SwarmingRpcsStringPair) (bool, error)
BotExists checks if an bot exists with the given dimensions.
func (*Client) CancelTask ¶
CancelTask cancels a swarming task by taskID, retrying transient errors.
func (*Client) CreateTask ¶
func (c *Client) CreateTask(ctx context.Context, req *swarming_api.SwarmingRpcsNewTaskRequest) (*swarming_api.SwarmingRpcsTaskRequestMetadata, error)
CreateTask creates a swarming task based on the given request, retrying transient errors.
func (*Client) DutNameToBotID ¶
DutNameToBotID gets the bot id associated with a particular dut by its hostname.
func (*Client) GetActiveLeaseTasksForBoard ¶
func (c *Client) GetActiveLeaseTasksForBoard(ctx context.Context, board string) ([]*swarming_api.SwarmingRpcsTaskResult, error)
GetActiveLeaseTasksForBoard gets active leases *specifically* targeted to a board.
func (*Client) GetActiveLeaseTasksForModel ¶
func (c *Client) GetActiveLeaseTasksForModel(ctx context.Context, model string) ([]*swarming_api.SwarmingRpcsTaskResult, error)
GetActiveLeaseTasksForModel gets active leases *specifically* targeted to a model. Leases that apply to a specific hostname are not counted here. TODO(gregorynisbet): Count leases that target specific hostnames as well.
func (*Client) GetBotIDs ¶
func (c *Client) GetBotIDs(ctx context.Context, dims []*swarming_api.SwarmingRpcsStringPair) ([]string, error)
GetBotIDs returns slice of bot IDs by given dimensions.
func (*Client) GetBots ¶
func (c *Client) GetBots(ctx context.Context, dims []*swarming_api.SwarmingRpcsStringPair) ([]*swarming_api.SwarmingRpcsBotInfo, error)
GetBots returns a slice of bots
func (*Client) GetFlatBotDimensionsForTask ¶
func (c *Client) GetFlatBotDimensionsForTask(ctx context.Context, taskID string) (map[string]string, error)
GetFlatBotDimensionsForTask takes a task id and returns the dimensions of the bot that is currently running the task. The output map has exactly one value per dimension. Dimensions where a key k maps to multiple values v1, v2, v3 ... correspond to the pair (k, v1) in the output map. Keys that are present but have no values associated with them get the magical sentinel value "". If the bot does not exist, then an error is returned instead.
func (*Client) GetListedBots ¶
func (c *Client) GetListedBots(ctx context.Context, dims []*swarming_api.SwarmingRpcsStringPair) ([]*ListedHost, error)
GetListedBots returns information about the DUTs managed by bots satisfying particular dimensions.
func (*Client) GetRequests ¶
func (c *Client) GetRequests(ctx context.Context, IDs []string) ([]*swarming_api.SwarmingRpcsTaskRequest, error)
GetRequests gets the task requests for the given task IDs, retrying transient errors.
func (*Client) GetResults ¶
func (c *Client) GetResults(ctx context.Context, IDs []string) ([]*swarming_api.SwarmingRpcsTaskResult, error)
GetResults gets results for the tasks with given IDs, retrying transient errors.
func (*Client) GetResultsForTags ¶
func (c *Client) GetResultsForTags(ctx context.Context, tags []string) ([]*swarming_api.SwarmingRpcsTaskResult, error)
GetResultsForTags gets results for tasks that match all the given tags, retrying transient errors.
func (*Client) GetTaskOutputs ¶
func (c *Client) GetTaskOutputs(ctx context.Context, IDs []string) ([]*swarming_api.SwarmingRpcsTaskOutput, error)
GetTaskOutputs gets the task outputs for the given IDs, retrying transient errors.
func (*Client) GetTaskState ¶
func (c *Client) GetTaskState(ctx context.Context, ID string) (*swarming_api.SwarmingRpcsTaskStates, error)
GetTaskState gets the state of the given task, retrying transient errors.
func (*Client) GetTaskURL ¶
GetTaskURL gets a URL for the task with the given ID.
type ListedHost ¶
type ListedHost struct {
Hostname string
}
ListedHost is a collection of information about the DUT managed by a particular bot.
func (*ListedHost) String ¶
func (l *ListedHost) String() string