execution

package
v0.0.0-...-3a98d3a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2025 License: BSD-3-Clause Imports: 28 Imported by: 0

Documentation

Overview

Package execution implements the REAPI Execution service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

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

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.

func (*Executor) Execute

func (e *Executor) Execute(action *repb.Action) (*repb.ActionResult, error)

Execute executes the given action and returns the result.

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.

func (*ImageRepository) ImageURL

func (r *ImageRepository) ImageURL(action *repb.Action, cmd *repb.Command) string

ImageURL returns the container image to use for the given action.

type Service

type Service struct {
	repb.UnimplementedExecutionServer
	// contains filtered or unexported fields
}

Service implements the REAPI Execution service.

func NewService

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL