Documentation
¶
Overview ¶
Package config implements the control low of how Paris works with different devices or purposes(plans).
Index ¶
- Constants
- Variables
- type Action
- func (*Action) Descriptor() ([]byte, []int)deprecated
- func (x *Action) GetAllowFailAfterRecovery() bool
- func (x *Action) GetConditions() []string
- func (x *Action) GetDependencies() []string
- func (x *Action) GetDocs() []string
- func (x *Action) GetExecExtraArgs() []string
- func (x *Action) GetExecName() string
- func (x *Action) GetExecTimeout() *durationpb.Duration
- func (x *Action) GetMetricsConfig() *MetricsConfig
- func (x *Action) GetRecoveryActions() []string
- func (x *Action) GetRunControl() RunControl
- func (*Action) ProtoMessage()
- func (x *Action) ProtoReflect() protoreflect.Message
- func (x *Action) Reset()
- func (x *Action) String() string
- type Configuration
- func AndroidDeployConfig() *Configuration
- func AndroidRepairConfig() *Configuration
- func ConfigDryRun() *Configuration
- func CrosAuditRPMConfig() *Configuration
- func CrosAuditStorageConfig() *Configuration
- func CrosAuditUSBConfig() *Configuration
- func CrosDeployConfig() *Configuration
- func CrosDevBoardConfig() *Configuration
- func CrosRepairConfig() *Configuration
- func CrosRepairWithDeepRepairConfig() *Configuration
- func CrosVMSuccessConfig() *Configuration
- func DeepRepairConfig() *Configuration
- func DownloadImageToServoUSBDrive(gsImagePath, imageName string) *Configuration
- func EnableSerialConsoleConfig() *Configuration
- func FixBatteryCutOffConfig() *Configuration
- func LabstationDeployConfig() *Configuration
- func LabstationRepairConfig() *Configuration
- func Load(ctx context.Context, r io.Reader, execsExit ExecsExist) (*Configuration, error)
- func MHRepairConfig() *Configuration
- func ProvisionBtpeerConfig(imagePath string) *Configuration
- func RecoverCBIFromInventoryConfig() *Configuration
- func ReserveDutConfig() *Configuration
- func RestoreHWIDFromInventoryConfig() *Configuration
- func SetFwTargets(ecTarget, apTarget string) *Configuration
- func Validate(ctx context.Context, c *Configuration, execsExist ExecsExist) (*Configuration, error)
- func (*Configuration) Descriptor() ([]byte, []int)deprecated
- func (x *Configuration) GetPlanNames() []string
- func (x *Configuration) GetPlans() map[string]*Plan
- func (*Configuration) ProtoMessage()
- func (x *Configuration) ProtoReflect() protoreflect.Message
- func (x *Configuration) Reset()
- func (x *Configuration) String() string
- type ExecsExist
- type MetricsConfig
- func (*MetricsConfig) Descriptor() ([]byte, []int)deprecated
- func (x *MetricsConfig) GetCustomKind() string
- func (x *MetricsConfig) GetUploadPolicy() MetricsConfig_UploadPolicy
- func (*MetricsConfig) ProtoMessage()
- func (x *MetricsConfig) ProtoReflect() protoreflect.Message
- func (x *MetricsConfig) Reset()
- func (x *MetricsConfig) String() string
- type MetricsConfig_UploadPolicy
- func (MetricsConfig_UploadPolicy) Descriptor() protoreflect.EnumDescriptor
- func (x MetricsConfig_UploadPolicy) Enum() *MetricsConfig_UploadPolicy
- func (MetricsConfig_UploadPolicy) EnumDescriptor() ([]byte, []int)deprecated
- func (x MetricsConfig_UploadPolicy) Number() protoreflect.EnumNumber
- func (x MetricsConfig_UploadPolicy) String() string
- func (MetricsConfig_UploadPolicy) Type() protoreflect.EnumType
- type Plan
- func (*Plan) Descriptor() ([]byte, []int)deprecated
- func (x *Plan) GetActions() map[string]*Action
- func (x *Plan) GetAllowFail() bool
- func (x *Plan) GetCriticalActions() []string
- func (*Plan) ProtoMessage()
- func (x *Plan) ProtoReflect() protoreflect.Message
- func (x *Plan) Reset()
- func (x *Plan) String() string
- type RunControl
Constants ¶
const ( PlanAndroid = "android" PlanCrOS = "cros" PlanCrOSBase = "cros_base" PlanCrOSDeploy = "cros_deploy" PlanCrOSAudit = "cros_audit" PlanCrOSDeepRepair = "cros_deep_repair" PlanServo = "servo" PlanServoDeepRepair = "servo_deep_repair" PlanServoFwUpdate = "servo_fw_update" PlanChameleon = "chameleon" PlanBluetoothPeer = "bluetooth_peer" PlanWifiRouter = "wifi_router" PlanHMR = "human_motion_robot" PlanDolos = "dolos" PlanAMT = "amt_manager" // That is final plan which will run always if present in configuration. // The goal is execution final step to clean up stages if something left // over in the devices. PlanClosing = "close" )
List of known plans.
Note that plans are named by the type of device that they refer to. There is exactly one plan per type of device.
Variables ¶
var ( MetricsConfig_UploadPolicy_name = map[int32]string{ 0: "DEFAULT_UPLOAD_POLICY", 1: "SKIP_ALL", 2: "UPLOAD_ON_ERROR", } MetricsConfig_UploadPolicy_value = map[string]int32{ "DEFAULT_UPLOAD_POLICY": 0, "SKIP_ALL": 1, "UPLOAD_ON_ERROR": 2, } )
Enum value maps for MetricsConfig_UploadPolicy.
var ( RunControl_name = map[int32]string{ 0: "RERUN_AFTER_RECOVERY", 1: "ALWAYS_RUN", 2: "RUN_ONCE", } RunControl_value = map[string]int32{ "RERUN_AFTER_RECOVERY": 0, "ALWAYS_RUN": 1, "RUN_ONCE": 2, } )
Enum value maps for RunControl.
var File_go_chromium_org_infra_cros_recovery_config_planpb_metric_config_proto protoreflect.FileDescriptor
var File_go_chromium_org_infra_cros_recovery_config_planpb_plan_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct { // List of actions to determine if this action is applicable for the resource. // If any condition fails then this action will be skipped. Conditions []string `protobuf:"bytes,1,rep,name=conditions,proto3" json:"conditions,omitempty"` // List of actions that must pass before executing this action's exec // function. Dependencies []string `protobuf:"bytes,2,rep,name=dependencies,proto3" json:"dependencies,omitempty"` // Name of the exec function to use. // The name of the action will be used if not provided. ExecName string `protobuf:"bytes,3,opt,name=exec_name,json=execName,proto3" json:"exec_name,omitempty"` // Allowed time to execute exec function. // If not specified, defaults to 60 seconds. // The default may change in the future. ExecTimeout *durationpb.Duration `protobuf:"bytes,4,opt,name=exec_timeout,json=execTimeout,proto3" json:"exec_timeout,omitempty"` // Extra arguments provided to the exec function. // What arguments are allowed depends on the exec function. ExecExtraArgs []string `protobuf:"bytes,5,rep,name=exec_extra_args,json=execExtraArgs,proto3" json:"exec_extra_args,omitempty"` // List of actions used to recover this action if exec function fails. RecoveryActions []string `protobuf:"bytes,6,rep,name=recovery_actions,json=recoveryActions,proto3" json:"recovery_actions,omitempty"` // If set to true, then the action is treated as if it passed even if it // and all its recovery actions failed. AllowFailAfterRecovery bool `` /* 132-byte string literal not displayed */ // Controls how and when the action can be rerun throughout the plan. RunControl RunControl `` /* 126-byte string literal not displayed */ // Documentation to describe detail of the action. Docs []string `protobuf:"bytes,9,rep,name=docs,proto3" json:"docs,omitempty"` // The metrics config specifies how we handle metrics created by this action. MetricsConfig *MetricsConfig `protobuf:"bytes,10,opt,name=metrics_config,json=metricsConfig,proto3" json:"metrics_config,omitempty"` // contains filtered or unexported fields }
Action describes how to run the action, including its dependencies, conditions, and other attributes.
func (*Action) Descriptor
deprecated
func (*Action) GetAllowFailAfterRecovery ¶
func (*Action) GetConditions ¶
func (*Action) GetDependencies ¶
func (*Action) GetExecExtraArgs ¶
func (*Action) GetExecName ¶
func (*Action) GetExecTimeout ¶
func (x *Action) GetExecTimeout() *durationpb.Duration
func (*Action) GetMetricsConfig ¶
func (x *Action) GetMetricsConfig() *MetricsConfig
func (*Action) GetRecoveryActions ¶
func (*Action) GetRunControl ¶
func (x *Action) GetRunControl() RunControl
func (*Action) ProtoMessage ¶
func (*Action) ProtoMessage()
func (*Action) ProtoReflect ¶
func (x *Action) ProtoReflect() protoreflect.Message
type Configuration ¶
type Configuration struct { // Map of plans provided by configuration. Plans map[string]*Plan `` /* 137-byte string literal not displayed */ // List of plan names in order to execute. PlanNames []string `protobuf:"bytes,2,rep,name=plan_names,json=planNames,proto3" json:"plan_names,omitempty"` // contains filtered or unexported fields }
Configuration provides the plans to be used by the recovery engine.
func AndroidDeployConfig ¶
func AndroidDeployConfig() *Configuration
AndroidDeployConfig provides config for android deployment task.
func AndroidRepairConfig ¶
func AndroidRepairConfig() *Configuration
AndroidRepairConfig provides config for repair android task.
func ConfigDryRun ¶
func ConfigDryRun() *Configuration
ConfigDryRun is an empty config used for a dry run.
This config intentionally does nothing.
func CrosAuditRPMConfig ¶
func CrosAuditRPMConfig() *Configuration
CrosAuditRPMConfig audits the RPM information for ChromeOS DUTs only.
func CrosAuditStorageConfig ¶
func CrosAuditStorageConfig() *Configuration
CrosAuditStorageConfig audits the internal storage for a ChromeOS DUT.
func CrosAuditUSBConfig ¶
func CrosAuditUSBConfig() *Configuration
CrosAuditUSBConfig audits the USB drive for a servo associated with a ChromeOS DUT.
func CrosDeployConfig ¶
func CrosDeployConfig() *Configuration
CrosDeployConfig provides config for deploy cros setup in the lab task.
func CrosDevBoardConfig ¶
func CrosDevBoardConfig() *Configuration
CrosDevBoardConfig uses for DevBoards devices.
func CrosRepairConfig ¶
func CrosRepairConfig() *Configuration
CrosRepairConfig provides config for repair cros setup in the lab task.
func CrosRepairWithDeepRepairConfig ¶
func CrosRepairWithDeepRepairConfig() *Configuration
CrosRepairWithDeepRepairConfig provides config for combination of deep repair + normal repair.
func CrosVMSuccessConfig ¶
func CrosVMSuccessConfig() *Configuration
func DeepRepairConfig ¶
func DeepRepairConfig() *Configuration
DeepRepairConfig creates configuration to perform deep repair. Configuration is not critical and do not update the state of the DUT.
func DownloadImageToServoUSBDrive ¶
func DownloadImageToServoUSBDrive(gsImagePath, imageName string) *Configuration
DownloadImageToServoUSBDrive creates configuration to download image to USB-drive connected to the servo.
func EnableSerialConsoleConfig ¶
func EnableSerialConsoleConfig() *Configuration
EnableSerialConsoleConfig creates a custom configuration to flash serial firmware to DUT.
func FixBatteryCutOffConfig ¶
func FixBatteryCutOffConfig() *Configuration
FixBatteryCutOffConfig creates a custom configuration to recover by battery cut-off
func LabstationDeployConfig ¶
func LabstationDeployConfig() *Configuration
LabstationDeployConfig provides config for deploy labstation task.
func LabstationRepairConfig ¶
func LabstationRepairConfig() *Configuration
LabstationRepairConfig provides config for repair labstation task.
func Load ¶
func Load(ctx context.Context, r io.Reader, execsExit ExecsExist) (*Configuration, error)
Load performs loading the configuration source with data validation.
func MHRepairConfig ¶
func MHRepairConfig() *Configuration
MHRepairConfig provides config for repair AndroidOS setup in the MH.
func ProvisionBtpeerConfig ¶
func ProvisionBtpeerConfig(imagePath string) *Configuration
ProvisionBtpeerConfig creates configuration to provision a btpeer with a new OS.
btpeerProvisionPlan provisions a btpeer with a new OS. The call flow is as followed:
If the device is not already partitioned for AB updates, then re-partition is by: a. Verify device has space for new B partitions b. Verify Verify device has standard partition scheme c. Enable initrd d. Shrink rootfs e. Disable initrd f. Create new AB Partitions
If the device is A/B partitioned a. Temp Boot into A partition b. Set permanent boot partition as A c. Download OS Image to device d. Flash B partitions with new OS Image e. Temp Boot into B partition f. Set permanent boot partition as B
func RecoverCBIFromInventoryConfig ¶
func RecoverCBIFromInventoryConfig() *Configuration
RecoverCBIFromInventoryConfig restores backup CBI contents from UFS
func ReserveDutConfig ¶
func ReserveDutConfig() *Configuration
ReserveDutConfig creates configuration to reserve a dut
func RestoreHWIDFromInventoryConfig ¶
func RestoreHWIDFromInventoryConfig() *Configuration
RestoreHWIDFromInventoryConfig reads the configuration from the inventory.
func SetFwTargets ¶
func SetFwTargets(ecTarget, apTarget string) *Configuration
SetFwTargets creates a custom configuration to update fw-targets.
func Validate ¶
func Validate(ctx context.Context, c *Configuration, execsExist ExecsExist) (*Configuration, error)
Validate validate configuration before usage.
The validater is also fix missed adjusted actions.
func (*Configuration) Descriptor
deprecated
func (*Configuration) Descriptor() ([]byte, []int)
Deprecated: Use Configuration.ProtoReflect.Descriptor instead.
func (*Configuration) GetPlanNames ¶
func (x *Configuration) GetPlanNames() []string
func (*Configuration) GetPlans ¶
func (x *Configuration) GetPlans() map[string]*Plan
func (*Configuration) ProtoMessage ¶
func (*Configuration) ProtoMessage()
func (*Configuration) ProtoReflect ¶
func (x *Configuration) ProtoReflect() protoreflect.Message
func (*Configuration) Reset ¶
func (x *Configuration) Reset()
func (*Configuration) String ¶
func (x *Configuration) String() string
type ExecsExist ¶
ExecsExist function to check if exec is exit.
type MetricsConfig ¶
type MetricsConfig struct { // upload_policy is the policy for uploading the individual action. UploadPolicy MetricsConfig_UploadPolicy `` /* 148-byte string literal not displayed */ // custom_kind specifies a custom kind to use for action, if one is provided. CustomKind string `protobuf:"bytes,2,opt,name=custom_kind,json=customKind,proto3" json:"custom_kind,omitempty"` // contains filtered or unexported fields }
MetricsConfig configures a single action.
func (*MetricsConfig) Descriptor
deprecated
func (*MetricsConfig) Descriptor() ([]byte, []int)
Deprecated: Use MetricsConfig.ProtoReflect.Descriptor instead.
func (*MetricsConfig) GetCustomKind ¶
func (x *MetricsConfig) GetCustomKind() string
func (*MetricsConfig) GetUploadPolicy ¶
func (x *MetricsConfig) GetUploadPolicy() MetricsConfig_UploadPolicy
func (*MetricsConfig) ProtoMessage ¶
func (*MetricsConfig) ProtoMessage()
func (*MetricsConfig) ProtoReflect ¶
func (x *MetricsConfig) ProtoReflect() protoreflect.Message
func (*MetricsConfig) Reset ¶
func (x *MetricsConfig) Reset()
func (*MetricsConfig) String ¶
func (x *MetricsConfig) String() string
type MetricsConfig_UploadPolicy ¶
type MetricsConfig_UploadPolicy int32
UploadPolicy specifies what to do with the metrics created by the action in question.
const ( // DEFAULT_UPLOAD_POLICY uploads everything. MetricsConfig_DEFAULT_UPLOAD_POLICY MetricsConfig_UploadPolicy = 0 // SKIP_ALL skips uploading all metrics. MetricsConfig_SKIP_ALL MetricsConfig_UploadPolicy = 1 // UPLOAD_ON_ERROR only uploads a metric if the action was unsuccessful in // some way. // // TODO(gregorynisbet): Add in another policy to upload ALL errors and 1% of // successes to make it possible to // // recover the true success rate for actions that have // been throttled in this way. // // TODO(gregorynisbet): Consider making this or some other kind of // "throttled" policy the default policy. MetricsConfig_UPLOAD_ON_ERROR MetricsConfig_UploadPolicy = 2 )
func (MetricsConfig_UploadPolicy) Descriptor ¶
func (MetricsConfig_UploadPolicy) Descriptor() protoreflect.EnumDescriptor
func (MetricsConfig_UploadPolicy) Enum ¶
func (x MetricsConfig_UploadPolicy) Enum() *MetricsConfig_UploadPolicy
func (MetricsConfig_UploadPolicy) EnumDescriptor
deprecated
func (MetricsConfig_UploadPolicy) EnumDescriptor() ([]byte, []int)
Deprecated: Use MetricsConfig_UploadPolicy.Descriptor instead.
func (MetricsConfig_UploadPolicy) Number ¶
func (x MetricsConfig_UploadPolicy) Number() protoreflect.EnumNumber
func (MetricsConfig_UploadPolicy) String ¶
func (x MetricsConfig_UploadPolicy) String() string
func (MetricsConfig_UploadPolicy) Type ¶
func (MetricsConfig_UploadPolicy) Type() protoreflect.EnumType
type Plan ¶
type Plan struct { // Critical actions are actions which have to pass for plan to succeed. // Order matters. CriticalActions []string `protobuf:"bytes,1,rep,name=critical_actions,json=criticalActions,proto3" json:"critical_actions,omitempty"` // Map of all actions used by the plan. Actions map[string]*Action `` /* 141-byte string literal not displayed */ // When running multiple plans, whether to continue running the next plan // if this plan fails. AllowFail bool `protobuf:"varint,3,opt,name=allow_fail,json=allowFail,proto3" json:"allow_fail,omitempty"` // contains filtered or unexported fields }
Plan holds information about actions for recovery engine to execute.
func (*Plan) Descriptor
deprecated
func (*Plan) GetActions ¶
func (*Plan) GetAllowFail ¶
func (*Plan) GetCriticalActions ¶
func (*Plan) ProtoMessage ¶
func (*Plan) ProtoMessage()
func (*Plan) ProtoReflect ¶
func (x *Plan) ProtoReflect() protoreflect.Message
type RunControl ¶
type RunControl int32
RunControl describe when and how often an action runs per plan execution.
const ( // The action is run once per plan and rerun again after each successful // recovery action. RunControl_RERUN_AFTER_RECOVERY RunControl = 0 // The action runs every time. RunControl_ALWAYS_RUN RunControl = 1 // The action is run only once per plan. RunControl_RUN_ONCE RunControl = 2 )
func (RunControl) Descriptor ¶
func (RunControl) Descriptor() protoreflect.EnumDescriptor
func (RunControl) Enum ¶
func (x RunControl) Enum() *RunControl
func (RunControl) EnumDescriptor
deprecated
func (RunControl) EnumDescriptor() ([]byte, []int)
Deprecated: Use RunControl.Descriptor instead.
func (RunControl) Number ¶
func (x RunControl) Number() protoreflect.EnumNumber
func (RunControl) String ¶
func (x RunControl) String() string
func (RunControl) Type ¶
func (RunControl) Type() protoreflect.EnumType
Source Files
¶
- android_deploy.go
- android_key.go
- android_repair.go
- audit_rpm.go
- audit_storage.go
- audit_usb.go
- config.go
- config_amt.go
- config_btpeer.go
- config_btpeer_provision.go
- config_chameleon.go
- config_cros.go
- config_cros_base.go
- config_cros_cft_containers.go
- config_cros_closing.go
- config_cros_deep_repair.go
- config_cros_deploy.go
- config_cros_devboard.go
- config_cros_repair.go
- config_cros_vm.go
- config_dolos.go
- config_dry_run.go
- config_env.go
- config_hmr.go
- config_servo.go
- config_wifirouter.go
- cros_android_actions.go
- cros_state_actions.go
- custom_plans.go
- doc.go
- labstation_deploy.go
- labstation_repair.go
- metric_config.pb.go
- plan.pb.go
- plans.go