eval

package
v0.1.23-oss Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ABFSConfig

type ABFSConfig struct {
	// subset of values from ABFS config
	FSType       instance.CASFSType
	LocalOnly    bool
	CacheDir     string
	FetchTimeout time.Duration
}

type ActiveJob

type ActiveJob struct {
	ReqHash   entities.Hash
	Patches   []entities.Hash
	StartTime time.Time
	Status    JobStatus
	Command   string
	Durations JobDurations
}

type EvalOptions

type EvalOptions struct {
	// Whether to store the eval response in the store
	WriteEvalResponse bool
	// Whether to store the eval response as a map result of the eval request
	StoreMapResult bool
	// Whether to prefetch the inputs of the eval request
	PrefetchInputs bool
}

type Evaluator

type Evaluator struct {
	SetupInput
	// contains filtered or unexported fields
}

func NewEvaluator

func NewEvaluator(store entities.CASStore, cacheman *client.Client, in SetupInput) (*Evaluator, error)

NewEvaluator creates a temporary directory, mounts casfs at /mnt inside that directory, applies a hard-coded NSJail patch to the mount to prepare NSJail for use, and copies tap into the mount for ABFS-copying later on.

func (*Evaluator) ActiveJobs

func (e *Evaluator) ActiveJobs() []*ActiveJob

func (*Evaluator) Close

func (e *Evaluator) Close() error

func (*Evaluator) Eval

func (e *Evaluator) Eval(ctx context.Context, h entities.Hash, patchHashes []entities.Hash, opt EvalOptions) (_ *binding.EvalResponse, _ *ActiveJob, returnErr error)

Eval calls the mount's Chroot function to establish a temporary directory for execution. This is used as the NSJail chroot so the linux OS directories /lib, /bin, /usr are placed there via NSJail read-only binds. The Android tree is rooted at /src inside the chroot. Tap is placed at /tap inside. The whole directory is removed afterwards.

type JobDurations

type JobDurations struct {
	Fetch   time.Duration
	Prepare time.Duration
	Run     time.Duration
	Post    time.Duration
}

type JobStatus

type JobStatus string

JobStatus represents the state of an evaluation job.

const (
	JobStatusFetch       JobStatus = "fetch"
	JobStatusPrepare     JobStatus = "prepare"
	JobStatusRun         JobStatus = "run"
	JobStatusPostProcess JobStatus = "post-process"
	JobStatusError       JobStatus = "error"
	JobStatusSuccess     JobStatus = "success"
)

type SetupInput

type SetupInput struct {
	ABFSConfig

	// path of tap binary outside of ABFS
	TapPath string
	// Keep filesystem artifacts alive after closing.
	Keep bool
}

Jump to

Keyboard shortcuts

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