Documentation
¶
Index ¶
- Variables
- func InitKeeper() error
- func IsolateVersion() string
- func New(id int, memQuota int64, logger *slog.Logger) (eval.Sandbox, error)
- func NewStupid(boxID int, memoryQuota int64, logger *slog.Logger) (eval.Sandbox, error)
- type IsolateBox
- func (b *IsolateBox) Close() error
- func (b *IsolateBox) FileExists(fpath string) bool
- func (b *IsolateBox) GetID() int
- func (b *IsolateBox) MemoryQuota() int64
- func (b *IsolateBox) ReadFile(fpath string, w io.Writer) error
- func (b *IsolateBox) RunCommand(ctx context.Context, command []string, conf *eval.RunConfig) (*eval.RunStats, error)
- func (b *IsolateBox) SaveFile(fpath string, bucket eval.Bucket, filename string, mode fs.FileMode) error
- func (b *IsolateBox) WriteFile(fpath string, r io.Reader, mode fs.FileMode) error
- type StupidSandbox
- func (b *StupidSandbox) Close() error
- func (b *StupidSandbox) FileExists(fpath string) bool
- func (b *StupidSandbox) GetID() int
- func (b *StupidSandbox) MemoryQuota() int64
- func (b *StupidSandbox) ReadFile(fpath string, w io.Writer) error
- func (b *StupidSandbox) RunCommand(ctx context.Context, command []string, conf *eval.RunConfig) (*eval.RunStats, error)
- func (b *StupidSandbox) SaveFile(fpath string, bucket eval.Bucket, filename string, mode fs.FileMode) error
- func (b *StupidSandbox) WriteFile(fpath string, r io.Reader, mode fs.FileMode) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EnsureCGKeeper = config.GenFlag("feature.grader.ensure_keeper", false, "Ensure isolate-cg-keeper is running") IsolateConfigPath = config.GenFlag("feature.grader.isolate_config_path", "/usr/local/etc/isolate", "Configuration path for isolate sandbox") )
View Source
var CGTiming = config.GenFlag[bool]("feature.grader.use_cg_timing", false, "Use --cg-timing flag in grader. Should not be necessary.")
Functions ¶
func InitKeeper ¶ added in v0.25.0
func InitKeeper() error
func IsolateVersion ¶ added in v0.25.0
func IsolateVersion() string
Types ¶
type IsolateBox ¶
type IsolateBox struct {
// contains filtered or unexported fields
}
IsolateBox is the struct for the current box
func (*IsolateBox) Close ¶
func (b *IsolateBox) Close() error
func (*IsolateBox) FileExists ¶
func (b *IsolateBox) FileExists(fpath string) bool
FileExists returns if a file exists or not
func (*IsolateBox) GetID ¶
func (b *IsolateBox) GetID() int
func (*IsolateBox) MemoryQuota ¶
func (b *IsolateBox) MemoryQuota() int64
func (*IsolateBox) RunCommand ¶
type StupidSandbox ¶
type StupidSandbox struct {
// contains filtered or unexported fields
}
StupidSandbox can be used for testing. NOTE: should not be used in a proper environment. It has no proper memory limit And time limits are based on manually killing the program
func (*StupidSandbox) Close ¶
func (b *StupidSandbox) Close() error
func (*StupidSandbox) FileExists ¶
func (b *StupidSandbox) FileExists(fpath string) bool
func (*StupidSandbox) GetID ¶
func (b *StupidSandbox) GetID() int
func (*StupidSandbox) MemoryQuota ¶
func (b *StupidSandbox) MemoryQuota() int64
func (*StupidSandbox) RunCommand ¶
Click to show internal directories.
Click to hide internal directories.