Documentation
¶
Index ¶
- Constants
- func BotForDUT(id string, state string, dims string) *swarmingv2.BotInfo
- func CheckAccess(c context.Context, _ string, _ proto.Message) (context.Context, error)
- func CreateAuditTask(ctx context.Context, dutName, pool, taskname, actions string, ...) (string, error)
- func CreateRepairTask(ctx context.Context, dutName string, expectedState string, pools []string, ...) (string, error)
- func ExtractDutToPush(ctx context.Context, b *swarmingv2.BotInfo, dims strpair.Map, ...) (dut string)
- func GetPoolCfg(ctx context.Context, poolName string) *config.Swarming_PoolCfg
- func InstallHandlers(r *router.Router, mwBase router.MiddlewareChain)
- func IsLabstationOS(ctx context.Context, botID string, dims strpair.Map) (err error)
- func RouteTask(ctx context.Context, p RouteTaskParams, randFloat float64) (heuristics.TaskType, error)
- type RouteTaskParams
- type ServerImpl
- func (is *ServerImpl) DeleteSatlabStableVersion(ctx context.Context, req *fleet.DeleteSatlabStableVersionRequest) (_ *fleet.DeleteSatlabStableVersionResponse, err error)
- func (is *ServerImpl) DumpStableVersionToDatastore(ctx context.Context, in *fleet.DumpStableVersionToDatastoreRequest) (*fleet.DumpStableVersionToDatastoreResponse, error)
- func (is *ServerImpl) GetRecoveryVersion(ctx context.Context, req *fleet.GetRecoveryVersionRequest) (resp *fleet.GetRecoveryVersionResponse, err error)
- func (is *ServerImpl) GetStableVersion(ctx context.Context, req *fleet.GetStableVersionRequest) (resp *fleet.GetStableVersionResponse, err error)
- func (is *ServerImpl) SetSatlabStableVersion(ctx context.Context, req *fleet.SetSatlabStableVersionRequest) (_ *fleet.SetSatlabStableVersionResponse, err error)
- type StableVersionGitClientFactory
- type SwarmingFactory
- type TrackerServerImpl
- func (tsi *TrackerServerImpl) PushBotsForAdminAuditTasks(ctx context.Context, req *fleet.PushBotsForAdminAuditTasksRequest) (res *fleet.PushBotsForAdminAuditTasksResponse, err error)
- func (tsi *TrackerServerImpl) PushBotsForAdminTasks(ctx context.Context, req *fleet.PushBotsForAdminTasksRequest) (res *fleet.PushBotsForAdminTasksResponse, err error)
- func (tsi *TrackerServerImpl) PushRepairJobsForLabstations(ctx context.Context, req *fleet.PushRepairJobsForLabstationsRequest) (res *fleet.PushRepairJobsForLabstationsResponse, err error)
- func (tsi *TrackerServerImpl) ReportBots(ctx context.Context, req *fleet.ReportBotsRequest) (res *fleet.ReportBotsResponse, err error)
Constants ¶
const SupportedClientMajorVersionNumber = 2
SupportedClientMajorVersionNumber indicates the minimum major client version
Variables ¶
This section is empty.
Functions ¶
func BotForDUT ¶
func BotForDUT(id string, state string, dims string) *swarmingv2.BotInfo
BotForDUT returns BotInfos for DUTs with the given dut id.
state is the bot's state dimension. dims is a convenient way to specify other bot dimensions. "a:x,y;b:z" will set the dimensions of the bot to ["a": ["x", "y"], "b":
["z"]]
func CheckAccess ¶
CheckAccess verifies that the request is from an authorized user.
Servers should use checkAccess as a Prelude while handling requests to uniformly check access across the API.
func CreateAuditTask ¶
func CreateAuditTask(ctx context.Context, dutName, pool, taskname, actions string, randFloat float64) (string, error)
CreateAuditTask kicks off an audit job.
func CreateRepairTask ¶
func CreateRepairTask(ctx context.Context, dutName string, expectedState string, pools []string, randFloat float64, poolCfg *config.Swarming_PoolCfg) (string, error)
CreateRepairTask kicks off a repair job.
This function will either schedule a legacy repair task or a PARIS repair task. Note that the ufs client can be nil.
func ExtractDutToPush ¶
func ExtractDutToPush(ctx context.Context, b *swarmingv2.BotInfo, dims strpair.Map, skipHostMap map[string]bool) (dut string)
ExtractDutToPush returns the dut name to push for repair or audit
func GetPoolCfg ¶
func GetPoolCfg(ctx context.Context, poolName string) *config.Swarming_PoolCfg
GetPoolCfg finds a PoolCfg for a given swarming pool if available, otherwise returns nil.
func InstallHandlers ¶
func InstallHandlers(r *router.Router, mwBase router.MiddlewareChain)
InstallHandlers installs the handlers implemented by the frontend package.
func IsLabstationOS ¶
func RouteTask ¶
func RouteTask(ctx context.Context, p RouteTaskParams, randFloat float64) (heuristics.TaskType, error)
RouteTask routes a task for a given bot.
The possible return values are: - "legacy" (for legacy, which is the default) - "" (indicates an error, should be treated as equivalent to "legacy" by callers) - "paris" (for PARIS, which is new) - "latest" (indicates the latest version of paris)
Types ¶
type RouteTaskParams ¶
type RouteTaskParams struct {
// contains filtered or unexported fields
}
RouteTaskParams are the parameters needed to route a task between legacy and paris and between the paris prod version and paris prod canary.
RouteTaskParams deliberately excludes the context and randFloat, the entropy required.
type ServerImpl ¶
type ServerImpl struct { // StableVersionGitClientFactory StableVersionGitClientFactory StableVersionGitClientFactory }
ServerImpl implements the fleet.InventoryServer interface.
func (*ServerImpl) DeleteSatlabStableVersion ¶
func (is *ServerImpl) DeleteSatlabStableVersion(ctx context.Context, req *fleet.DeleteSatlabStableVersionRequest) (_ *fleet.DeleteSatlabStableVersionResponse, err error)
DeleteSatlabStableVersion deletes a satlab stable version entry.
func (*ServerImpl) DumpStableVersionToDatastore ¶
func (is *ServerImpl) DumpStableVersionToDatastore(ctx context.Context, in *fleet.DumpStableVersionToDatastoreRequest) (*fleet.DumpStableVersionToDatastoreResponse, error)
DumpStableVersionToDatastore takes stable version info from the git repo where it lives and dumps it to datastore
func (*ServerImpl) GetRecoveryVersion ¶
func (is *ServerImpl) GetRecoveryVersion(ctx context.Context, req *fleet.GetRecoveryVersionRequest) (resp *fleet.GetRecoveryVersionResponse, err error)
GetRecoveryVersion implements the method from fleet.InventoryServer interface
func (*ServerImpl) GetStableVersion ¶
func (is *ServerImpl) GetStableVersion(ctx context.Context, req *fleet.GetStableVersionRequest) (resp *fleet.GetStableVersionResponse, err error)
GetStableVersion implements the method from fleet.InventoryServer interface
func (*ServerImpl) SetSatlabStableVersion ¶
func (is *ServerImpl) SetSatlabStableVersion(ctx context.Context, req *fleet.SetSatlabStableVersionRequest) (_ *fleet.SetSatlabStableVersionResponse, err error)
SetSatlabStableVersion replaces a satlab stable version with a new entry.
type StableVersionGitClientFactory ¶
type StableVersionGitClientFactory func(c context.Context) (git.ClientInterface, error)
StableVersionGitClientFactory is a constructor for a git client pointed at the source of truth for the stable version information
type SwarmingFactory ¶
SwarmingFactory is a constructor for a SwarmingClient.
type TrackerServerImpl ¶
type TrackerServerImpl struct { // SwarmingFactory is an optional factory function for creating clients. // // If SwarmingFactory is nil, clients.NewSwarmingClient is used. SwarmingFactory SwarmingFactory MetricsClient metrics.Metrics }
TrackerServerImpl implements the fleet.TrackerServer interface.
func (*TrackerServerImpl) PushBotsForAdminAuditTasks ¶
func (tsi *TrackerServerImpl) PushBotsForAdminAuditTasks(ctx context.Context, req *fleet.PushBotsForAdminAuditTasksRequest) (res *fleet.PushBotsForAdminAuditTasksResponse, err error)
PushBotsForAdminAuditTasks implements the fleet.Tracker.pushBotsForAdminTasks() method.
func (*TrackerServerImpl) PushBotsForAdminTasks ¶
func (tsi *TrackerServerImpl) PushBotsForAdminTasks(ctx context.Context, req *fleet.PushBotsForAdminTasksRequest) (res *fleet.PushBotsForAdminTasksResponse, err error)
PushBotsForAdminTasks implements the fleet.Tracker.pushBotsForAdminTasks() method.
func (*TrackerServerImpl) PushRepairJobsForLabstations ¶
func (tsi *TrackerServerImpl) PushRepairJobsForLabstations(ctx context.Context, req *fleet.PushRepairJobsForLabstationsRequest) (res *fleet.PushRepairJobsForLabstationsResponse, err error)
PushRepairJobsForLabstations implements the fleet.Tracker.pushLabstationsForRepair() method.
func (*TrackerServerImpl) ReportBots ¶
func (tsi *TrackerServerImpl) ReportBots(ctx context.Context, req *fleet.ReportBotsRequest) (res *fleet.ReportBotsResponse, err error)
ReportBots reports metrics of swarming bots.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
datastore
|
|
stableversion
Package stableversion provides functions to store stableversion info in datastore
|
Package stableversion provides functions to store stableversion info in datastore |
Package swarming contains utilities for skylab swarming tasks.
|
Package swarming contains utilities for skylab swarming tasks. |