controller

package
v0.0.0-...-8a430b7 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2016 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitAC = 42
	ExitWA = 43
)
View Source
const (
	FilePerm    = 0644
	DirPerm     = 0755
	SandboxRoot = "/sandbox"
)
View Source
const (
	ErrMaxWorkerExceed = "max worker exceed"
)

Variables

This section is empty.

Functions

func GetAvailableCPU

func GetAvailableCPU(ctx context.Context) (cpuid int, err error)

func Ping

func Ping(ctx context.Context) (err error)

Types

type Daemon

type Daemon struct {
	MaxWorker     int
	CurrentWorker int
	WorkerState   []string
	// contains filtered or unexported fields
}

func (*Daemon) AddTask

func (d *Daemon) AddTask(ctx context.Context, jinfo config.JudgeInfo, dir string, img string) (err error)

func (*Daemon) Run

func (d *Daemon) Run(ctx context.Context)

type RunResult

type RunResult struct {
	Stage string
	RunID int
	// contains filtered or unexported fields
}

type Worker

type Worker struct {
	JudgeInfo    config.JudgeInfo
	WorkDir      string
	DockerImage  string
	RunUser      string
	CPUID        int
	MaxRetryTime int
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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