Documentation ¶
Overview ¶
Package swmbot provides interaction with the Swarming bot running the Skylab worker process. This includes information about the Swarming bot as well as any Swarming bot local state.
Index ¶
- func InventoryClient(ctx context.Context, b *Info) (fleet.InventoryClient, error)
- func InventoryV2Client(ctx context.Context, b *Info) (invV2.InventoryClient, error)
- func Marshal(lds *LocalDUTState) ([]byte, error)
- func SetupContext(ctx context.Context, namespace string) context.Context
- func UFSClient(ctx context.Context, b *Info) (ufsAPI.FleetClient, error)
- func Unmarshal(data []byte, lds *LocalDUTState) error
- func WithSystemAccount(ctx context.Context) (context.Context, error)
- func WithTaskAccount(ctx context.Context) (context.Context, error)
- type Info
- type LocalDUTState
- type ProvisionableAttributes
- type ProvisionableLabels
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InventoryClient ¶
InventoryClient returns an InventoryClient for the current Swarming bot task. The context should use an explicit service account using WithTaskAccount or WithSystemAccount; otherwise the default service account is used.
func InventoryV2Client ¶
InventoryV2Client returns an InventoryClient for the current Swarming bot task. The context should use an explicit service account using WithTaskAccount or WithSystemAccount; otherwise the default service account is used.
func Marshal ¶
func Marshal(lds *LocalDUTState) ([]byte, error)
Marshal returns the encoding of the LocalDUTState.
func SetupContext ¶
SetupContext set up the outgoing context for API calls.
func UFSClient ¶
UFSClient returns a FleetClient to communicate with UFS service. The context should use an explicit service account using WithTaskAccount or WithSystemAccount; otherwise the default service account is used.
func Unmarshal ¶
func Unmarshal(data []byte, lds *LocalDUTState) error
Unmarshal decodes LocalDUTState from the encoded data.
func WithSystemAccount ¶
WithSystemAccount returns acontext to using the Swarming bot system service account.
Types ¶
type Info ¶
type Info struct { AdminService string AutotestPath string BotDUTID string InventoryService string UFSService string LuciferBinDir string ParserPath string SwarmingService string LabpackDir string IsSchedulingUnit bool Task Task }
Info contains information about the current Swarming bot.
func GetInfo ¶
func GetInfo() *Info
GetInfo returns the Info for the current Swarming bot, built from environment variables.
Per-bot variables:
ADMIN_SERVICE: Admin service host, e.g. foo.appspot.com. INVENTORY_SERVICE: Inventory V2 service host, e.g. foo.appspot.com. AUTOTEST_DIR: Path to the autotest checkout on server. LUCIFER_TOOLS_DIR: Path to the lucifer installation. PARSER_PATH: Path to the autotest_status_parser installation. FLEET_RESOURCE_NAME: The name to locate a fleet resource, for now we use swarming dut_id dimension for this purpose. SWARMING_SERVICE: Swarming service host, e.g. https://foo.appspot.com. FLEET_MULTIDUTS_FLAG: Indicates if the bot is hosting a Scheduling Unit.
Per-task variables:
SWARMING_TASK_ID: task id of the swarming task being serviced.
func (*Info) LuciferConfig ¶
LuciferConfig returns the lucifer.Config for the Swarming bot.
func (*Info) ResultsDir ¶
ResultsDir returns the path to the results directory used by the bot task.
func (*Info) TaskRunURL ¶
TaskRunURL returns the URL for the current Swarming task execution.
type LocalDUTState ¶
type LocalDUTState struct { HostState dutstate.State `json:"-"` ProvisionableLabels ProvisionableLabels `json:"provisionable_labels"` ProvisionableAttributes ProvisionableAttributes `json:"provisionable_attributes"` }
LocalDUTState contains persistent DUT information that is cached on the Skylab drone.
type ProvisionableAttributes ¶
ProvisionableAttributes stores provisionable attributes for a DUT.
type ProvisionableLabels ¶
ProvisionableLabels stores provisionable labels for a DUT.
type Task ¶
type Task struct {
RunID string
}
Task describes the bot's current task.
func (*Task) GsURL ¶
GsURL returns the URL for the Google Storage location of the logs offloaded from this task.
func (*Task) StainlessURL ¶
StainlessURL returns the URL to the stainless logs browser for logs offloaded from this task.
Directories ¶
Path | Synopsis |
---|---|
Package harness manages the setup and teardown of various Swarming bot resources for running lab tasks, like results directories and host info.
|
Package harness manages the setup and teardown of various Swarming bot resources for running lab tasks, like results directories and host info. |
hostinfo
Package hostinfo implements the parts of harness management pertaining to Autotest hostinfo.
|
Package hostinfo implements the parts of harness management pertaining to Autotest hostinfo. |
localdutinfo
Package localdutinfo implements opening and closing a DUT's local dut info stored on local disk(e.g.
|
Package localdutinfo implements opening and closing a DUT's local dut info stored on local disk(e.g. |
resultsdir
Package resultsdir implements Autotest results directory creation and sealing.
|
Package resultsdir implements Autotest results directory creation and sealing. |
ufsdutinfo
Package ufsdutinfo implement loading Skylab DUT inventory(UFS) info for the worker.
|
Package ufsdutinfo implement loading Skylab DUT inventory(UFS) info for the worker. |