Documentation
¶
Overview ¶
Package site contains site local constants for the skylab tool.
Index ¶
Constants ¶
const ClientTag = "client:mallet"
Client tag used for PARIS tasks scheduling.
const CloudOAuthScope = "https://www.googleapis.com/auth/cloud-platform"
OAuth scope for the whole of cloud platform.
const VersionNumber = "2.1.2"
VersionNumber is the version number for the tool. It follows the Semantic Versioning Specification (http://semver.org) and the format is: "MAJOR.MINOR.0+BUILD_TIME". We can ignore the PATCH part (i.e. it's always 0) to make the maintenance work easier. We can also print out the build time (e.g. 20060102150405) as the METADATA when show version to users.
Variables ¶
var DefaultAuthOptions auth.Options
DefaultAuthOptions is an auth.Options struct prefilled with chrome-infra defaults.
var DefaultPRPCOptions = prpcOptionWithUserAgent(fmt.Sprintf("mallet/%s", VersionNumber))
DefaultPRPCOptions is used for PRPC clients. If it is nil, the default value is used. See prpc.Options for details.
This is provided so it can be overridden for testing.
var Dev = Environment{
LUCIProject: "chromeos",
SwarmingService: "https://chromium-swarm-dev.appspot.com/",
LogDogHost: "luci-logdog-dev.appspot.com",
InventoryService: "cros-lab-inventory-dev.appspot.com",
AdminService: "chromeos-skylab-bot-fleet.appspot.com",
QueenService: "drone-queen-dev.appspot.com",
QueenDroneHostname: "drone-queen-ENVIRONMENT_STAGING",
ServiceAccount: "skylab-admin-task@chromeos-service-accounts-dev.iam.gserviceaccount.com",
UFSService: "staging.ufs.api.cr.dev",
}
Dev is the environment for dev.
var EthernetHookCallbackOptions = func() auth.Options { o := DefaultAuthOptions o.Scopes = append(o.Scopes, CloudOAuthScope) return o }()
EthernetHookCallbackOptions includes OAuth scopes that include, at minimum, the ability to read from Google Storage.
var Prod = Environment{
LUCIProject: "chromeos",
SwarmingService: "https://chromeos-swarming.appspot.com/",
LogDogHost: "luci-logdog.appspot.com",
InventoryService: "cros-lab-inventory.appspot.com",
AdminService: "chromeos-skylab-bot-fleet.appspot.com",
QueenService: "drone-queen-prod.appspot.com",
QueenDroneHostname: "drone-queen-ENVIRONMENT_PROD",
ServiceAccount: "skylab-admin-task@chromeos-service-accounts.iam.gserviceaccount.com",
UFSService: "ufs.api.cr.dev",
}
Prod is the environment for prod.
var UFSPRPCOptions = prpcOptionWithUserAgent("mallet/6.0.0")
UFSPRPCOptions is used for UFS PRPC clients.
Functions ¶
This section is empty.
Types ¶
type BuildbucketBuilderInfo ¶
type BuildbucketBuilderInfo struct { Host string BuilderID *buildbucket_pb.BuilderID }
BuildbucketBuilderInfo contains information for initializing a Buildbucket client that talks to a specific builder.
type CommonFlags ¶
type CommonFlags struct {
Verbose bool
}
CommonFlags contains generic CLI flags that are theoretically common to all commands.
func (*CommonFlags) Register ¶
func (f *CommonFlags) Register(fl *flag.FlagSet)
Register sets up the common flags.
type EnvFlags ¶
type EnvFlags struct {
// contains filtered or unexported fields
}
EnvFlags controls selection of the environment: either prod (default) or dev.
func (EnvFlags) Env ¶
func (f EnvFlags) Env() Environment
Env returns the environment, either dev or prod.
type EnvWrapper ¶
type EnvWrapper struct {
// contains filtered or unexported fields
}
EnvWrapper wraps Environment to satisfy the worker.Environment interface and swarming.Environment interface.
func (EnvWrapper) GenerateLogPrefix ¶
func (e EnvWrapper) GenerateLogPrefix() string
GenerateLogPrefix implements worker.Environment.
func (EnvWrapper) LUCIProject ¶
func (e EnvWrapper) LUCIProject() string
LUCIProject implements worker.Environment.
func (EnvWrapper) LogDogHost ¶
func (e EnvWrapper) LogDogHost() string
LogDogHost implements worker.Environment.
type Environment ¶
type Environment struct { LUCIProject string SwarmingService string LogDogHost string InventoryService string AdminService string QueenService string // QueenDroneHostname is only used by queen-push-duts. QueenDroneHostname string ServiceAccount string // Buildbucket-specific values. CTPBuilderInfo BuildbucketBuilderInfo DUTLeaserBuilderInfo BuildbucketBuilderInfo // UFS-specific values UFSService string }
Environment contains environment specific values.
func (Environment) Wrapped ¶
func (e Environment) Wrapped() EnvWrapper
Wrapped returns the environment wrapped in a helper type to satisfy the worker.Environment interface and swarming.Environment interface.