boxmanager

package
v0.0.0-...-5733806 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCanRun

func CheckCanRun() bool

Types

type Box

type Box struct {
	// contains filtered or unexported fields
}

Box is the struct for the current box

func (*Box) Close

func (b *Box) Close() error

func (*Box) FileExists

func (b *Box) FileExists(fpath string) bool

FileExists returns if a file exists or not

func (*Box) GetID

func (b *Box) GetID() int

func (*Box) MemoryQuota

func (b *Box) MemoryQuota() int64

func (*Box) ReadDir

func (b *Box) ReadDir(fpath string) ([]string, error)

func (*Box) ReadFile

func (b *Box) ReadFile(fpath string, w io.Writer) error

func (*Box) RunCommand

func (b *Box) RunCommand(ctx context.Context, command []string, conf *eval.RunConfig) (*eval.RunStats, error)

func (*Box) WriteFile

func (b *Box) WriteFile(fpath string, r io.Reader, mode fs.FileMode) error

WriteFile writes a file to the specified path inside the box

type BoxManager

type BoxManager struct {
	// contains filtered or unexported fields
}

BoxManager manages a box with eval-based submissions

func New

func New(startingNumber int, count int, maxMemory int64, dm kilonova.GraderStore, logger *zap.SugaredLogger) (*BoxManager, error)

New creates a new box manager

func (*BoxManager) Close

func (b *BoxManager) Close(ctx context.Context) error

Close waits for all boxes to finish running

func (*BoxManager) GetBox

func (b *BoxManager) GetBox(ctx context.Context, memQuota int64) (eval.Sandbox, error)

func (*BoxManager) ReleaseBox

func (b *BoxManager) ReleaseBox(sb eval.Sandbox)

type Env

type Env struct {
	Var   string
	Value string
}

Env represents a variable-value pair for an environment variable

Jump to

Keyboard shortcuts

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