oci_judge

package
v0.0.0-...-5379b69 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2022 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ContainerdJudgeVersion = []byte("oci-v1.0.0")
)

Functions

This section is empty.

Types

type ContainerdJudgeConfig

type ContainerdJudgeConfig struct {
	Address            string              `json:"address"`
	JudgeCachePath     string              `json:"judge_cache_path"`
	Concurrency        int                 `json:"concurrency"`
	JudgeWorkdir       string              `json:"judge_workdir"`
	JudgeSeccompOption *specs.LinuxSeccomp `json:"judge_seccomp_option"`
}

type ContainerdJudgeOption

type ContainerdJudgeOption func(svc *ContainerdJudgeServiceServer) error

func WithContainerdAddress

func WithContainerdAddress(address string) ContainerdJudgeOption

func WithContainerdCheckerPlugin

func WithContainerdCheckerPlugin(plugin tarus_io.Router) ContainerdJudgeOption

func WithContainerdCompilerPlugin

func WithContainerdCompilerPlugin(plugin tarus_compiler.Compiler) ContainerdJudgeOption

func WithContainerdConcurrencyNum

func WithContainerdConcurrencyNum(cc int) ContainerdJudgeOption

func WithContainerdJudgeCachePath

func WithContainerdJudgeCachePath(path string) ContainerdJudgeOption

func WithContainerdJudgeSeccomp

func WithContainerdJudgeSeccomp(sc *specs.LinuxSeccomp) ContainerdJudgeOption

func WithContainerdJudgeWorkdir

func WithContainerdJudgeWorkdir(wd string) ContainerdJudgeOption

type ContainerdJudgeServiceServer

type ContainerdJudgeServiceServer struct {
	tarus.UnimplementedJudgeServiceServer
	// contains filtered or unexported fields
}

func NewContainerdServer

func NewContainerdServer(options ...ContainerdJudgeOption) (svc *ContainerdJudgeServiceServer, err error)

func (*ContainerdJudgeServiceServer) Close

func (*ContainerdJudgeServiceServer) CompileProgram

func (*ContainerdJudgeServiceServer) CopyFile

func (*ContainerdJudgeServiceServer) CreateContainer

func (c *ContainerdJudgeServiceServer) CreateContainer(ctx context.Context, request *tarus.CreateContainerRequest) (_ *emptypb.Empty, err error)

func (*ContainerdJudgeServiceServer) Handshake

func (*ContainerdJudgeServiceServer) ImportOCIArchive

func (c *ContainerdJudgeServiceServer) ImportOCIArchive(ctx context.Context, fp string) error

func (*ContainerdJudgeServiceServer) ImportOCIArchiveR

func (c *ContainerdJudgeServiceServer) ImportOCIArchiveR(ctx context.Context, f io.Reader, ref string) error

func (*ContainerdJudgeServiceServer) MakeJudge

func (*ContainerdJudgeServiceServer) QueryJudge

func (*ContainerdJudgeServiceServer) RemoveContainer

type JudgeEnvironment

type JudgeEnvironment struct {
	ProcessSpec    specs.Process
	MemoryLimit    int64
	StackLimit     int64
	CpuTime        int64
	CpuHard        int64
	ChannelFactory tarus_io.ChannelFactory
	JudgeIO        tarus_io.Factory
}

type JudgeHint

type JudgeHint struct {
	Code          int    `json:"code" yaml:"code"`
	Signal        string `json:"signal,omitempty" yaml:"signal,omitempty"`
	CheckerResult string `json:"checker_result" yaml:"checker_result"`
}

type JudgeMetric

type JudgeMetric struct {
	ContainerInfo *types.Metric
	Code          uint32
	IsTimeout     bool
	StartedAt     time.Time
	ExitedAt      time.Time
	JudgeReport   []byte
}

type MemoryJudgeConfig

type MemoryJudgeConfig struct {
	CallbackKey []byte
	ImageId     string
	ProcessArgs []string
	Input       io.ReadCloser
	Output      io.WriteCloser
	Timeout     int64 // in microsecond
	Memory      int64 // in bytes
}

type OCIJudgeServiceServer

type OCIJudgeServiceServer interface {
	tarus.JudgeServiceServer
}

Jump to

Keyboard shortcuts

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