Documentation ¶
Overview ¶
Package site contains site local constants for the skylab tool.
Index ¶
Constants ¶
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{ ClientID: "446450136466-2hr92jrq8e6i4tnsa56b52vacp7t3936.apps.googleusercontent.com", ClientSecret: "uBfbay2KCy9t4QveJ-dOqHtp", SecretsDir: SecretsDir(), Scopes: []string{auth.OAuthScopeEmail, gitiles.OAuthScope}, }
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: "skylab-staging-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 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 ¶
func SecretsDir ¶
func SecretsDir() string
SecretsDir returns an absolute path to a directory (in $HOME) to keep secret files in (e.g. OAuth refresh tokens) or an empty string if $HOME can't be determined (happens in some degenerate cases, it just disables auth token cache).
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 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.