Documentation
¶
Index ¶
- Constants
- func CVDLogsDir(ctx hoexec.ExecContext, groupName, name string) (string, error)
- func CreateCVD(ctx hoexec.ExecContext, p startCVDParams) (*cvd.Group, error)
- func CvdGroupToAPIObject(group *cvd.Group) []*apiv1.CVD
- func CvdInstanceToAPIObject(instance *cvd.Instance, group string) *apiv1.CVD
- func NewChunkState(fileSize int64) *chunkState
- func ValidateCreateSnapshotRequest(r *apiv1.CreateSnapshotRequest) error
- func ValidateSnapshotID(v string) error
- func ValidateStartCVDRequest(r *apiv1.StartCVDRequest) error
- type BuildAPICredentialsConfig
- type CVDBundleFetcher
- type Config
- type Controller
- type CreateCVDAction
- type CreateCVDActionOpts
- type CreateCVDBugReportAction
- type CreateCVDBugReportActionOpts
- type CreateSnapshotAction
- type CreateSnapshotActionOpts
- type DisplayAddAction
- type DisplayAddActionOpts
- type DisplayListAction
- type DisplayListActionOpts
- type DisplayRemoveAction
- type DisplayRemoveActionOpts
- type DisplayScreenshotAction
- type DisplayScreenshotActionOpts
- type EmptyFieldError
- type ExecCVDGroupCommandAction
- type ExecCVDGroupCommandActionOpts
- type ExecCVDInstanceCommandAction
- type ExecCVDInstanceCommandActionOpts
- type ExtraCVDOptions
- type FetchArtifactsAction
- type FetchArtifactsActionOpts
- type HostValidator
- type IMPaths
- type ImageDirectoriesManager
- type ImageDirectoriesManagerImpl
- func (m *ImageDirectoriesManagerImpl) CreateImageDirectory() (string, error)
- func (m *ImageDirectoriesManagerImpl) DeleteImageDirectory(imageDirName string) error
- func (m *ImageDirectoriesManagerImpl) ListImageDirectories() ([]string, error)
- func (m *ImageDirectoriesManagerImpl) UpdateImageDirectory(imageDirName, dir string) error
- type ImageDirectoriesManagerOpts
- type ListCVDsAction
- type ListCVDsActionOpts
- type MapOM
- func (m *MapOM) Complete(name string, result *OperationResult) error
- func (m *MapOM) Get(name string) (apiv1.Operation, error)
- func (m *MapOM) GetResult(name string) (*OperationResult, error)
- func (m *MapOM) ListRunning() []apiv1.Operation
- func (m *MapOM) New() apiv1.Operation
- func (m *MapOM) Wait(name string, dt time.Duration) (*OperationResult, error)
- type NotFoundOperationError
- type OperationManager
- type OperationNotDoneError
- type OperationResult
- type OperationWaitTimeoutError
- type ResetCVDAction
- type ResetCVDActionOpts
- type StartCVDAction
- type StartCVDActionOpts
- type UserArtifactChunk
- type UserArtifactsDirResolver
- type UserArtifactsManager
- type UserArtifactsManagerImpl
- func (m *UserArtifactsManagerImpl) ExtractArtifact(checksum string) error
- func (m *UserArtifactsManagerImpl) ExtractedArtifactPath(checksum string) string
- func (m *UserArtifactsManagerImpl) StatArtifact(checksum string) (*apiv1.StatArtifactResponse, error)
- func (m *UserArtifactsManagerImpl) UpdateArtifact(checksum string, chunk UserArtifactChunk) error
- func (m *UserArtifactsManagerImpl) UpdatedArtifactPath(checksum string) string
- type UserArtifactsManagerOpts
- type Validator
Constants ¶
View Source
const BugReportZipFileName = "cvd_bugreport.zip"
View Source
const ErrMsgLaunchCVDFailed = "failed to launch cvd"
View Source
const HeaderBuildAPICreds = "X-Cutf-Host-Orchestrator-BuildAPI-Creds"
View Source
const HeaderUserProject = "X-Cutf-Host-Orchestrator-BuildAPI-Creds-User-Project-ID"
View Source
const (
URLQueryKeyIncludeAdbBugReport = "include_adb_bugreport"
)
Variables ¶
This section is empty.
Functions ¶
func CVDLogsDir ¶
func CVDLogsDir(ctx hoexec.ExecContext, groupName, name string) (string, error)
func CvdInstanceToAPIObject ¶
func NewChunkState ¶
func NewChunkState(fileSize int64) *chunkState
func ValidateCreateSnapshotRequest ¶
func ValidateCreateSnapshotRequest(r *apiv1.CreateSnapshotRequest) error
func ValidateSnapshotID ¶
func ValidateStartCVDRequest ¶
func ValidateStartCVDRequest(r *apiv1.StartCVDRequest) error
Types ¶
type BuildAPICredentialsConfig ¶
type BuildAPICredentialsConfig struct {
UseGCEMetadata bool
}
type CVDBundleFetcher ¶
type CVDBundleFetcher interface { // Fetches artifacts to launch a Cuttlefish device Fetch(outDir string, mainBuild cvd.AndroidBuild, opts ExtraCVDOptions) error }
type Config ¶
type Config struct { Paths IMPaths AndroidBuildServiceURL string BuildAPICredentials BuildAPICredentialsConfig }
type Controller ¶
type Controller struct { Config Config OperationManager OperationManager WaitOperationDuration time.Duration UserArtifactsManager UserArtifactsManager ImageDirectoriesManager ImageDirectoriesManager DebugVariablesManager *debug.VariablesManager }
func (*Controller) AddRoutes ¶
func (c *Controller) AddRoutes(router *mux.Router)
type CreateCVDAction ¶
type CreateCVDAction struct {
// contains filtered or unexported fields
}
func NewCreateCVDAction ¶
func NewCreateCVDAction(opts CreateCVDActionOpts) *CreateCVDAction
type CreateCVDActionOpts ¶
type CreateCVDActionOpts struct { Request *apiv1.CreateCVDRequest HostValidator Validator Paths IMPaths OperationManager OperationManager ExecContext exec.ExecContext CVDBundleFetcher CVDBundleFetcher UUIDGen func() string UserArtifactsDirResolver UserArtifactsDirResolver FetchCredentials cvd.FetchCredentials BuildAPIBaseURL string }
type CreateCVDBugReportAction ¶
type CreateCVDBugReportAction struct {
// contains filtered or unexported fields
}
func NewCreateCVDBugReportAction ¶
func NewCreateCVDBugReportAction(opts CreateCVDBugReportActionOpts) *CreateCVDBugReportAction
type CreateCVDBugReportActionOpts ¶
type CreateCVDBugReportActionOpts struct { Group string IncludeADBBugreport bool Paths IMPaths OperationManager OperationManager ExecContext exec.ExecContext UUIDGen func() string }
type CreateSnapshotAction ¶
type CreateSnapshotAction struct {
// contains filtered or unexported fields
}
func NewCreateSnapshotAction ¶
func NewCreateSnapshotAction(opts CreateSnapshotActionOpts) *CreateSnapshotAction
type CreateSnapshotActionOpts ¶
type CreateSnapshotActionOpts struct { Request *apiv1.CreateSnapshotRequest Selector cvd.InstanceSelector Paths IMPaths OperationManager OperationManager ExecContext exec.ExecContext }
type DisplayAddAction ¶
type DisplayAddAction struct {
// contains filtered or unexported fields
}
func NewDisplayAddAction ¶
func NewDisplayAddAction(opts DisplayAddActionOpts) *DisplayAddAction
func (*DisplayAddAction) Run ¶
func (a *DisplayAddAction) Run() (*apiv1.DisplayAddResponse, error)
type DisplayAddActionOpts ¶
type DisplayAddActionOpts struct { Request *apiv1.DisplayAddRequest Selector cvd.InstanceSelector Paths IMPaths OperationManager OperationManager ExecContext exec.ExecContext }
type DisplayListAction ¶
type DisplayListAction struct {
// contains filtered or unexported fields
}
func NewDisplayListAction ¶
func NewDisplayListAction(opts DisplayListActionOpts) *DisplayListAction
func (*DisplayListAction) Run ¶
func (a *DisplayListAction) Run() (*apiv1.DisplayListResponse, error)
type DisplayListActionOpts ¶
type DisplayListActionOpts struct { Selector cvd.InstanceSelector Paths IMPaths OperationManager OperationManager ExecContext exec.ExecContext }
type DisplayRemoveAction ¶
type DisplayRemoveAction struct {
// contains filtered or unexported fields
}
func NewDisplayRemoveAction ¶
func NewDisplayRemoveAction(opts DisplayRemoveActionOpts) *DisplayRemoveAction
func (*DisplayRemoveAction) Run ¶
func (a *DisplayRemoveAction) Run() (*apiv1.DisplayRemoveResponse, error)
type DisplayRemoveActionOpts ¶
type DisplayRemoveActionOpts struct { DisplayNumber int Selector cvd.InstanceSelector Paths IMPaths OperationManager OperationManager ExecContext exec.ExecContext }
type DisplayScreenshotAction ¶
type DisplayScreenshotAction struct {
// contains filtered or unexported fields
}
func NewDisplayScreenshotAction ¶
func NewDisplayScreenshotAction(opts DisplayScreenshotActionOpts) *DisplayScreenshotAction
type DisplayScreenshotActionOpts ¶
type DisplayScreenshotActionOpts struct { Request *apiv1.DisplayScreenshotRequest Selector cvd.InstanceSelector Paths IMPaths OperationManager OperationManager ExecContext exec.ExecContext }
type EmptyFieldError ¶
type EmptyFieldError string
func (EmptyFieldError) Error ¶
func (s EmptyFieldError) Error() string
type ExecCVDGroupCommandAction ¶
type ExecCVDGroupCommandAction struct {
// contains filtered or unexported fields
}
func NewExecCVDGroupCommandAction ¶
func NewExecCVDGroupCommandAction(opts ExecCVDGroupCommandActionOpts) *ExecCVDGroupCommandAction
type ExecCVDGroupCommandActionOpts ¶
type ExecCVDGroupCommandActionOpts struct { Command execCvdGroupCommand Selector cvd.GroupSelector OperationManager OperationManager ExecContext exec.ExecContext }
type ExecCVDInstanceCommandAction ¶
type ExecCVDInstanceCommandAction struct {
// contains filtered or unexported fields
}
func NewExecCVDInstanceCommandAction ¶
func NewExecCVDInstanceCommandAction(opts ExecCVDInstanceCommandActionOpts) *ExecCVDInstanceCommandAction
type ExecCVDInstanceCommandActionOpts ¶
type ExecCVDInstanceCommandActionOpts struct { Command execCvdInstanceCommand Selector cvd.InstanceSelector OperationManager OperationManager ExecContext exec.ExecContext }
type ExtraCVDOptions ¶
type ExtraCVDOptions struct { KernelBuild cvd.AndroidBuild BootloaderBuild cvd.AndroidBuild SystemImageBuild cvd.AndroidBuild }
type FetchArtifactsAction ¶
type FetchArtifactsAction struct {
// contains filtered or unexported fields
}
func NewFetchArtifactsAction ¶
func NewFetchArtifactsAction(opts FetchArtifactsActionOpts) *FetchArtifactsAction
type FetchArtifactsActionOpts ¶
type FetchArtifactsActionOpts struct { Request *apiv1.FetchArtifactsRequest Paths IMPaths OperationManager OperationManager CVDBundleFetcher CVDBundleFetcher UUIDGen func() string }
type HostValidator ¶
type HostValidator struct {
ExecContext hoexec.ExecContext
}
Validates whether the current host is valid to run CVDs.
func (*HostValidator) Validate ¶
func (v *HostValidator) Validate() error
type ImageDirectoriesManager ¶
type ImageDirectoriesManager interface { // Create an empty image directory. CreateImageDirectory() (string, error) // List all image directories. ListImageDirectories() ([]string, error) // Update image directory with creating or modifying symlinks of all files // under specified directory. UpdateImageDirectory(imageDirName, dir string) error // Delete the specified image directory. DeleteImageDirectory(imageDirName string) error }
type ImageDirectoriesManagerImpl ¶
type ImageDirectoriesManagerImpl struct {
ImageDirectoriesManagerOpts
}
An implementation of the ImageDirectoriesManager interface.
func NewImageDirectoriesManagerImpl ¶
func NewImageDirectoriesManagerImpl(opts ImageDirectoriesManagerOpts) *ImageDirectoriesManagerImpl
func (*ImageDirectoriesManagerImpl) CreateImageDirectory ¶
func (m *ImageDirectoriesManagerImpl) CreateImageDirectory() (string, error)
func (*ImageDirectoriesManagerImpl) DeleteImageDirectory ¶
func (m *ImageDirectoriesManagerImpl) DeleteImageDirectory(imageDirName string) error
func (*ImageDirectoriesManagerImpl) ListImageDirectories ¶
func (m *ImageDirectoriesManagerImpl) ListImageDirectories() ([]string, error)
func (*ImageDirectoriesManagerImpl) UpdateImageDirectory ¶
func (m *ImageDirectoriesManagerImpl) UpdateImageDirectory(imageDirName, dir string) error
type ImageDirectoriesManagerOpts ¶
type ImageDirectoriesManagerOpts struct { // Root directory for storing image directories. RootDir string }
Options for creating instances of ImageDirectoriesManager implementations.
type ListCVDsAction ¶
type ListCVDsAction struct {
// contains filtered or unexported fields
}
func NewListCVDsAction ¶
func NewListCVDsAction(opts ListCVDsActionOpts) *ListCVDsAction
func (*ListCVDsAction) Run ¶
func (a *ListCVDsAction) Run() (*apiv1.ListCVDsResponse, error)
type ListCVDsActionOpts ¶
type ListCVDsActionOpts struct { Group string Paths IMPaths ExecContext exec.ExecContext }
type MapOM ¶
type MapOM struct {
// contains filtered or unexported fields
}
func (*MapOM) ListRunning ¶
type NotFoundOperationError ¶
type NotFoundOperationError string
func (NotFoundOperationError) Error ¶
func (s NotFoundOperationError) Error() string
type OperationManager ¶
type OperationManager interface { New() apiv1.Operation Get(name string) (apiv1.Operation, error) ListRunning() []apiv1.Operation GetResult(name string) (*OperationResult, error) Complete(name string, result *OperationResult) error // Waits for the specified operation to be DONE within the passed deadline. If the deadline // is reached `OperationWaitTimeoutError` will be returned. // NOTE: if dt is zero there's no timeout. Wait(name string, dt time.Duration) (*OperationResult, error) }
type OperationNotDoneError ¶
type OperationNotDoneError string
func (OperationNotDoneError) Error ¶
func (s OperationNotDoneError) Error() string
type OperationResult ¶
type OperationResult struct { Error error Value interface{} }
type OperationWaitTimeoutError ¶
type OperationWaitTimeoutError struct{}
func (OperationWaitTimeoutError) Error ¶
func (s OperationWaitTimeoutError) Error() string
type ResetCVDAction ¶
type ResetCVDAction struct {
// contains filtered or unexported fields
}
func NewResetCVDAction ¶
func NewResetCVDAction(opts ResetCVDActionOpts) *ResetCVDAction
type ResetCVDActionOpts ¶
type ResetCVDActionOpts struct { OperationManager OperationManager ExecContext exec.ExecContext }
type StartCVDAction ¶
type StartCVDAction struct {
// contains filtered or unexported fields
}
func NewStartCVDAction ¶
func NewStartCVDAction(opts StartCVDActionOpts) *StartCVDAction
type StartCVDActionOpts ¶
type StartCVDActionOpts struct { Request *apiv1.StartCVDRequest Selector cvd.GroupSelector Paths IMPaths OperationManager OperationManager ExecContext exec.ExecContext }
type UserArtifactChunk ¶
type UserArtifactsDirResolver ¶
type UserArtifactsDirResolver interface { // Retrieve the full path where the updated artifact located UpdatedArtifactPath(checksum string) string // Retrieve the full path where the extracted artifact located ExtractedArtifactPath(checksum string) string }
Resolves the user artifacts full directory.
type UserArtifactsManager ¶
type UserArtifactsManager interface { // Update artifact with the passed chunk UpdateArtifact(checksum string, chunk UserArtifactChunk) error // Stat artifact whether artifact with given checksum exists or not. StatArtifact(checksum string) (*apiv1.StatArtifactResponse, error) // Extract artifact with the given checksum ExtractArtifact(checksum string) error UserArtifactsDirResolver }
Abstraction for managing user artifacts for launching CVDs.
type UserArtifactsManagerImpl ¶
type UserArtifactsManagerImpl struct { UserArtifactsManagerOpts WorkDir string // contains filtered or unexported fields }
An implementation of the UserArtifactsManager interface.
func NewUserArtifactsManagerImpl ¶
func NewUserArtifactsManagerImpl(opts UserArtifactsManagerOpts) (*UserArtifactsManagerImpl, error)
Creates a new instance of UserArtifactsManagerImpl.
func (*UserArtifactsManagerImpl) ExtractArtifact ¶
func (m *UserArtifactsManagerImpl) ExtractArtifact(checksum string) error
func (*UserArtifactsManagerImpl) ExtractedArtifactPath ¶
func (m *UserArtifactsManagerImpl) ExtractedArtifactPath(checksum string) string
func (*UserArtifactsManagerImpl) StatArtifact ¶
func (m *UserArtifactsManagerImpl) StatArtifact(checksum string) (*apiv1.StatArtifactResponse, error)
func (*UserArtifactsManagerImpl) UpdateArtifact ¶
func (m *UserArtifactsManagerImpl) UpdateArtifact(checksum string, chunk UserArtifactChunk) error
func (*UserArtifactsManagerImpl) UpdatedArtifactPath ¶
func (m *UserArtifactsManagerImpl) UpdatedArtifactPath(checksum string) string
type UserArtifactsManagerOpts ¶
type UserArtifactsManagerOpts struct { // Root directory for storing user artifacts. After Host Orchestrator moves user artifacts from // the working directory into here, it becomes immutable unless introducing any replacement // algorithm(e.g. LRU) on RootDir to manage the storage. RootDir string }
Options for creating instances of UserArtifactsManager implementations.
Source Files
¶
- controller.go
- createcvdaction.go
- createcvdbugreportaction.go
- createsnapshotaction.go
- displayaddaction.go
- displaylistaction.go
- displayremoveaction.go
- displayscreenshotaction.go
- execcvdcommandaction.go
- fetchartifactsaction.go
- imagedirectories.go
- instancemanager.go
- listcvdsaction.go
- operation.go
- resetcvdaction.go
- startcvdaction.go
- userartifacts.go
- validation.go
Click to show internal directories.
Click to hide internal directories.