Documentation
¶
Overview ¶
Package execution implements the REAPI Execution service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(s *grpc.Server, executor ExecutorInterface, ac *actioncache.ActionCache, cas *blobstore.ContentAddressableStorage) error
Register creates and registers a new Service with the given gRPC server.
Types ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor is a local executor that executes actions on the local machine. It uses a ContentAddressableStorage to fetch all required inputs for the action into a sandbox directory, executes the action in that sandbox directory, and then uploads the output files and directories to the CAS after the action has finished.
func New ¶
func New(baseDir string, cas *blobstore.ContentAddressableStorage) (*Executor, error)
New creates a new Executor. baseDir is a directory used to store temporary files required during execution, such as sandbox directories. cas is the ContentAddressableStorage to use for fetching and uploading blobs.
type ExecutorInterface ¶
type ExecutorInterface interface {
Execute(*repb.Action) (*repb.ActionResult, error)
}
ExecutorInterface is an interface of Executor.
type ImageRepository ¶
type ImageRepository struct {
// contains filtered or unexported fields
}
ImageRepository represents a repository for managing container images. It uses Docker to fetch and extract container images for actions.
func NewImageRepository ¶
func NewImageRepository(baseDir string) (*ImageRepository, error)
NewImageRepository creates a new image repository with the given base directory.
func (*ImageRepository) FetchImage ¶
func (r *ImageRepository) FetchImage(containerImage string) (string, error)
FetchImage fetches the container image for the given action and extracts it into the image directory. It returns the path to the extracted image.
type Service ¶
type Service struct { repb.UnimplementedExecutionServer // contains filtered or unexported fields }
Service implements the REAPI Execution service.
func NewService ¶
func NewService(executor ExecutorInterface, ac *actioncache.ActionCache, cas *blobstore.ContentAddressableStorage) (*Service, error)
NewService creates a new Service.
func (*Service) Execute ¶
func (s *Service) Execute(request *repb.ExecuteRequest, executeServer repb.Execution_ExecuteServer) error
Execute executes the given action and returns the result.
func (*Service) WaitExecution ¶
func (s *Service) WaitExecution(request *repb.WaitExecutionRequest, executionServer repb.Execution_WaitExecutionServer) error
WaitExecution waits for the specified execution to complete.
type TreeRepository ¶
type TreeRepository struct {
// contains filtered or unexported fields
}
TreeRepository is a repository for trees. It provides methods for materializing trees in the local filesystem, which can then be mounted into an action's input root later.
func (*TreeRepository) StageDirectory ¶
func (t *TreeRepository) StageDirectory(dirDigest *repb.Digest, path string) error
StageDirectory downloads the given directory from the CAS and writes it to the given path. If the directory already exists, it is overwritten.