tarus

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	JudgeStatus_name = map[int32]string{
		0:   "Unknown",
		1:   "Accepted",
		2:   "WrongAnswer",
		3:   "PresentationError",
		4:   "RuntimeError",
		5:   "MemoryLimitExceed",
		6:   "TimeLimitExceed",
		7:   "OutputLimitExceed",
		8:   "PartialResult",
		9:   "CompilationError",
		10:  "Running",
		101: "SystemError",
		102: "SecurityPolicyViolation",
		103: "JudgeCheckerException",
		104: "AssertionFailed",
		105: "FloatingPointException",
	}
	JudgeStatus_value = map[string]int32{
		"Unknown":                 0,
		"Accepted":                1,
		"WrongAnswer":             2,
		"PresentationError":       3,
		"RuntimeError":            4,
		"MemoryLimitExceed":       5,
		"TimeLimitExceed":         6,
		"OutputLimitExceed":       7,
		"PartialResult":           8,
		"CompilationError":        9,
		"Running":                 10,
		"SystemError":             101,
		"SecurityPolicyViolation": 102,
		"JudgeCheckerException":   103,
		"AssertionFailed":         104,
		"FloatingPointException":  105,
	}
)

Enum value maps for JudgeStatus.

View Source
var File_api_tarus_judge_oci_proto protoreflect.FileDescriptor
View Source
var File_api_tarus_judge_proto protoreflect.FileDescriptor
View Source
var File_api_tarus_reporter_proto protoreflect.FileDescriptor
View Source
var JudgeResultReporter_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "tarus.api.reporter.JudgeResultReporter",
	HandlerType: (*JudgeResultReporterServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CallbackJudge",
			Handler:    _JudgeResultReporter_CallbackJudge_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/tarus/reporter.proto",
}

JudgeResultReporter_ServiceDesc is the grpc.ServiceDesc for JudgeResultReporter service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var JudgeService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "tarus.api.judge.JudgeService",
	HandlerType: (*JudgeServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Handshake",
			Handler:    _JudgeService_Handshake_Handler,
		},
		{
			MethodName: "CreateContainer",
			Handler:    _JudgeService_CreateContainer_Handler,
		},
		{
			MethodName: "BundleContainer",
			Handler:    _JudgeService_BundleContainer_Handler,
		},
		{
			MethodName: "RemoveContainer",
			Handler:    _JudgeService_RemoveContainer_Handler,
		},
		{
			MethodName: "CloneContainer",
			Handler:    _JudgeService_CloneContainer_Handler,
		},
		{
			MethodName: "CheckContainer",
			Handler:    _JudgeService_CheckContainer_Handler,
		},
		{
			MethodName: "CopyFile",
			Handler:    _JudgeService_CopyFile_Handler,
		},
		{
			MethodName: "CompileProgram",
			Handler:    _JudgeService_CompileProgram_Handler,
		},
		{
			MethodName: "MakeJudge",
			Handler:    _JudgeService_MakeJudge_Handler,
		},
		{
			MethodName: "QueryJudge",
			Handler:    _JudgeService_QueryJudge_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/tarus/judge.proto",
}

JudgeService_ServiceDesc is the grpc.ServiceDesc for JudgeService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterJudgeResultReporterServer

func RegisterJudgeResultReporterServer(s grpc.ServiceRegistrar, srv JudgeResultReporterServer)

func RegisterJudgeServiceServer

func RegisterJudgeServiceServer(s grpc.ServiceRegistrar, srv JudgeServiceServer)

Types

type BundleContainerRequest

type BundleContainerRequest struct {
	TaskKey []byte `protobuf:"bytes,1,opt,name=task_key,json=taskKey,proto3" json:"task_key,omitempty"`
	// contains filtered or unexported fields
}

func (*BundleContainerRequest) Descriptor deprecated

func (*BundleContainerRequest) Descriptor() ([]byte, []int)

Deprecated: Use BundleContainerRequest.ProtoReflect.Descriptor instead.

func (*BundleContainerRequest) GetTaskKey

func (x *BundleContainerRequest) GetTaskKey() []byte

func (*BundleContainerRequest) ProtoMessage

func (*BundleContainerRequest) ProtoMessage()

func (*BundleContainerRequest) ProtoReflect

func (x *BundleContainerRequest) ProtoReflect() protoreflect.Message

func (*BundleContainerRequest) Reset

func (x *BundleContainerRequest) Reset()

func (*BundleContainerRequest) String

func (x *BundleContainerRequest) String() string

type CallbackJudgeItem

type CallbackJudgeItem struct {
	JudgeKey    []byte `protobuf:"bytes,1,opt,name=judge_key,json=judgeKey,proto3" json:"judge_key,omitempty"`
	TimeUse     int64  `protobuf:"varint,101,opt,name=time_use,json=timeUse,proto3" json:"time_use,omitempty"`
	MemoryUse   int64  `protobuf:"varint,102,opt,name=memory_use,json=memoryUse,proto3" json:"memory_use,omitempty"`
	JudgeResult int64  `protobuf:"varint,103,opt,name=judge_result,json=judgeResult,proto3" json:"judge_result,omitempty"`
	Hint        string `protobuf:"bytes,104,opt,name=hint,proto3" json:"hint,omitempty"`
	// contains filtered or unexported fields
}

func (*CallbackJudgeItem) Descriptor deprecated

func (*CallbackJudgeItem) Descriptor() ([]byte, []int)

Deprecated: Use CallbackJudgeItem.ProtoReflect.Descriptor instead.

func (*CallbackJudgeItem) GetHint

func (x *CallbackJudgeItem) GetHint() string

func (*CallbackJudgeItem) GetJudgeKey

func (x *CallbackJudgeItem) GetJudgeKey() []byte

func (*CallbackJudgeItem) GetJudgeResult

func (x *CallbackJudgeItem) GetJudgeResult() int64

func (*CallbackJudgeItem) GetMemoryUse

func (x *CallbackJudgeItem) GetMemoryUse() int64

func (*CallbackJudgeItem) GetTimeUse

func (x *CallbackJudgeItem) GetTimeUse() int64

func (*CallbackJudgeItem) ProtoMessage

func (*CallbackJudgeItem) ProtoMessage()

func (*CallbackJudgeItem) ProtoReflect

func (x *CallbackJudgeItem) ProtoReflect() protoreflect.Message

func (*CallbackJudgeItem) Reset

func (x *CallbackJudgeItem) Reset()

func (*CallbackJudgeItem) String

func (x *CallbackJudgeItem) String() string

type CallbackJudgeResponse

type CallbackJudgeResponse struct {
	Items []*CallbackJudgeItem `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
	// contains filtered or unexported fields
}

func (*CallbackJudgeResponse) Descriptor deprecated

func (*CallbackJudgeResponse) Descriptor() ([]byte, []int)

Deprecated: Use CallbackJudgeResponse.ProtoReflect.Descriptor instead.

func (*CallbackJudgeResponse) GetItems

func (x *CallbackJudgeResponse) GetItems() []*CallbackJudgeItem

func (*CallbackJudgeResponse) ProtoMessage

func (*CallbackJudgeResponse) ProtoMessage()

func (*CallbackJudgeResponse) ProtoReflect

func (x *CallbackJudgeResponse) ProtoReflect() protoreflect.Message

func (*CallbackJudgeResponse) Reset

func (x *CallbackJudgeResponse) Reset()

func (*CallbackJudgeResponse) String

func (x *CallbackJudgeResponse) String() string

type CheckContainerRequest

type CheckContainerRequest struct {
	Plugin      string `protobuf:"bytes,1,opt,name=plugin,proto3" json:"plugin,omitempty"`
	TaskKey     []byte `protobuf:"bytes,2,opt,name=task_key,json=taskKey,proto3" json:"task_key,omitempty"`
	ContainerId string `protobuf:"bytes,3,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
	Extras      []byte `protobuf:"bytes,4,opt,name=extras,proto3" json:"extras,omitempty"`
	// contains filtered or unexported fields
}

func (*CheckContainerRequest) Descriptor deprecated

func (*CheckContainerRequest) Descriptor() ([]byte, []int)

Deprecated: Use CheckContainerRequest.ProtoReflect.Descriptor instead.

func (*CheckContainerRequest) GetContainerId

func (x *CheckContainerRequest) GetContainerId() string

func (*CheckContainerRequest) GetExtras

func (x *CheckContainerRequest) GetExtras() []byte

func (*CheckContainerRequest) GetPlugin

func (x *CheckContainerRequest) GetPlugin() string

func (*CheckContainerRequest) GetTaskKey

func (x *CheckContainerRequest) GetTaskKey() []byte

func (*CheckContainerRequest) ProtoMessage

func (*CheckContainerRequest) ProtoMessage()

func (*CheckContainerRequest) ProtoReflect

func (x *CheckContainerRequest) ProtoReflect() protoreflect.Message

func (*CheckContainerRequest) Reset

func (x *CheckContainerRequest) Reset()

func (*CheckContainerRequest) String

func (x *CheckContainerRequest) String() string

type CloneContainerRequest

type CloneContainerRequest struct {
	TaskKey         []byte `protobuf:"bytes,1,opt,name=task_key,json=taskKey,proto3" json:"task_key,omitempty"`
	FromTaskKey     string `protobuf:"bytes,2,opt,name=from_task_key,json=fromTaskKey,proto3" json:"from_task_key,omitempty"`
	FromContainerId string `protobuf:"bytes,3,opt,name=from_container_id,json=fromContainerId,proto3" json:"from_container_id,omitempty"`
	// contains filtered or unexported fields
}

func (*CloneContainerRequest) Descriptor deprecated

func (*CloneContainerRequest) Descriptor() ([]byte, []int)

Deprecated: Use CloneContainerRequest.ProtoReflect.Descriptor instead.

func (*CloneContainerRequest) GetFromContainerId

func (x *CloneContainerRequest) GetFromContainerId() string

func (*CloneContainerRequest) GetFromTaskKey

func (x *CloneContainerRequest) GetFromTaskKey() string

func (*CloneContainerRequest) GetTaskKey

func (x *CloneContainerRequest) GetTaskKey() []byte

func (*CloneContainerRequest) ProtoMessage

func (*CloneContainerRequest) ProtoMessage()

func (*CloneContainerRequest) ProtoReflect

func (x *CloneContainerRequest) ProtoReflect() protoreflect.Message

func (*CloneContainerRequest) Reset

func (x *CloneContainerRequest) Reset()

func (*CloneContainerRequest) String

func (x *CloneContainerRequest) String() string

type CompileProgramRequest

type CompileProgramRequest struct {
	TaskKey       []byte `protobuf:"bytes,1,opt,name=task_key,json=taskKey,proto3" json:"task_key,omitempty"`
	FromUrl       string `protobuf:"bytes,2,opt,name=from_url,json=fromUrl,proto3" json:"from_url,omitempty"`
	ToPath        string `protobuf:"bytes,3,opt,name=to_path,json=toPath,proto3" json:"to_path,omitempty"`
	CompileTarget string `protobuf:"bytes,101,opt,name=compile_target,json=compileTarget,proto3" json:"compile_target,omitempty"`
	// temporal open or close several compile flags such as asan, O0, O1, O2, O3
	CompileFeatures []string `protobuf:"bytes,102,rep,name=compile_features,json=compileFeatures,proto3" json:"compile_features,omitempty"`
	OverrideFile    bool     `protobuf:"varint,103,opt,name=override_file,json=overrideFile,proto3" json:"override_file,omitempty"`
	// contains filtered or unexported fields
}

func (*CompileProgramRequest) Descriptor deprecated

func (*CompileProgramRequest) Descriptor() ([]byte, []int)

Deprecated: Use CompileProgramRequest.ProtoReflect.Descriptor instead.

func (*CompileProgramRequest) GetCompileFeatures

func (x *CompileProgramRequest) GetCompileFeatures() []string

func (*CompileProgramRequest) GetCompileTarget

func (x *CompileProgramRequest) GetCompileTarget() string

func (*CompileProgramRequest) GetFromUrl

func (x *CompileProgramRequest) GetFromUrl() string

func (*CompileProgramRequest) GetOverrideFile

func (x *CompileProgramRequest) GetOverrideFile() bool

func (*CompileProgramRequest) GetTaskKey

func (x *CompileProgramRequest) GetTaskKey() []byte

func (*CompileProgramRequest) GetToPath

func (x *CompileProgramRequest) GetToPath() string

func (*CompileProgramRequest) ProtoMessage

func (*CompileProgramRequest) ProtoMessage()

func (*CompileProgramRequest) ProtoReflect

func (x *CompileProgramRequest) ProtoReflect() protoreflect.Message

func (*CompileProgramRequest) Reset

func (x *CompileProgramRequest) Reset()

func (*CompileProgramRequest) String

func (x *CompileProgramRequest) String() string

type CompileProgramResponse

type CompileProgramResponse struct {
	Diag string `protobuf:"bytes,1,opt,name=diag,proto3" json:"diag,omitempty"`
	Code int32  `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"`
	// contains filtered or unexported fields
}

func (*CompileProgramResponse) Descriptor deprecated

func (*CompileProgramResponse) Descriptor() ([]byte, []int)

Deprecated: Use CompileProgramResponse.ProtoReflect.Descriptor instead.

func (*CompileProgramResponse) GetCode

func (x *CompileProgramResponse) GetCode() int32

func (*CompileProgramResponse) GetDiag

func (x *CompileProgramResponse) GetDiag() string

func (*CompileProgramResponse) ProtoMessage

func (*CompileProgramResponse) ProtoMessage()

func (*CompileProgramResponse) ProtoReflect

func (x *CompileProgramResponse) ProtoReflect() protoreflect.Message

func (*CompileProgramResponse) Reset

func (x *CompileProgramResponse) Reset()

func (*CompileProgramResponse) String

func (x *CompileProgramResponse) String() string

type CopyFileRequest

type CopyFileRequest struct {
	TaskKey      []byte `protobuf:"bytes,1,opt,name=task_key,json=taskKey,proto3" json:"task_key,omitempty"`
	FromUrl      string `protobuf:"bytes,2,opt,name=from_url,json=fromUrl,proto3" json:"from_url,omitempty"`
	ToPath       string `protobuf:"bytes,3,opt,name=to_path,json=toPath,proto3" json:"to_path,omitempty"`
	OverrideFile bool   `protobuf:"varint,101,opt,name=override_file,json=overrideFile,proto3" json:"override_file,omitempty"`
	// contains filtered or unexported fields
}

func (*CopyFileRequest) Descriptor deprecated

func (*CopyFileRequest) Descriptor() ([]byte, []int)

Deprecated: Use CopyFileRequest.ProtoReflect.Descriptor instead.

func (*CopyFileRequest) GetFromUrl

func (x *CopyFileRequest) GetFromUrl() string

func (*CopyFileRequest) GetOverrideFile

func (x *CopyFileRequest) GetOverrideFile() bool

func (*CopyFileRequest) GetTaskKey

func (x *CopyFileRequest) GetTaskKey() []byte

func (*CopyFileRequest) GetToPath

func (x *CopyFileRequest) GetToPath() string

func (*CopyFileRequest) ProtoMessage

func (*CopyFileRequest) ProtoMessage()

func (*CopyFileRequest) ProtoReflect

func (x *CopyFileRequest) ProtoReflect() protoreflect.Message

func (*CopyFileRequest) Reset

func (x *CopyFileRequest) Reset()

func (*CopyFileRequest) String

func (x *CopyFileRequest) String() string

type CreateContainerRequest

type CreateContainerRequest struct {
	TaskKey          []byte `protobuf:"bytes,1,opt,name=task_key,json=taskKey,proto3" json:"task_key,omitempty"`
	ImageId          string `protobuf:"bytes,2,opt,name=image_id,json=imageId,proto3" json:"image_id,omitempty"`
	BinTarget        string `protobuf:"bytes,101,opt,name=bin_target,json=binTarget,proto3" json:"bin_target,omitempty"`
	EstimatedCputime int64  `protobuf:"varint,102,opt,name=estimated_cputime,json=estimatedCputime,proto3" json:"estimated_cputime,omitempty"`
	EstimatedCpuhard int64  `protobuf:"varint,103,opt,name=estimated_cpuhard,json=estimatedCpuhard,proto3" json:"estimated_cpuhard,omitempty"`
	EstimatedMemory  int64  `protobuf:"varint,104,opt,name=estimated_memory,json=estimatedMemory,proto3" json:"estimated_memory,omitempty"`
	EstimatedStack   int64  `protobuf:"varint,105,opt,name=estimated_stack,json=estimatedStack,proto3" json:"estimated_stack,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateContainerRequest) Descriptor deprecated

func (*CreateContainerRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateContainerRequest.ProtoReflect.Descriptor instead.

func (*CreateContainerRequest) GetBinTarget

func (x *CreateContainerRequest) GetBinTarget() string

func (*CreateContainerRequest) GetEstimatedCpuhard

func (x *CreateContainerRequest) GetEstimatedCpuhard() int64

func (*CreateContainerRequest) GetEstimatedCputime

func (x *CreateContainerRequest) GetEstimatedCputime() int64

func (*CreateContainerRequest) GetEstimatedMemory

func (x *CreateContainerRequest) GetEstimatedMemory() int64

func (*CreateContainerRequest) GetEstimatedStack

func (x *CreateContainerRequest) GetEstimatedStack() int64

func (*CreateContainerRequest) GetImageId

func (x *CreateContainerRequest) GetImageId() string

func (*CreateContainerRequest) GetTaskKey

func (x *CreateContainerRequest) GetTaskKey() []byte

func (*CreateContainerRequest) ProtoMessage

func (*CreateContainerRequest) ProtoMessage()

func (*CreateContainerRequest) ProtoReflect

func (x *CreateContainerRequest) ProtoReflect() protoreflect.Message

func (*CreateContainerRequest) Reset

func (x *CreateContainerRequest) Reset()

func (*CreateContainerRequest) String

func (x *CreateContainerRequest) String() string

type HandshakeRequest

type HandshakeRequest struct {
	ApiVersion []byte `protobuf:"bytes,1,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"`
	WebHookUrl string `protobuf:"bytes,101,opt,name=web_hook_url,json=webHookUrl,proto3" json:"web_hook_url,omitempty"`
	// contains filtered or unexported fields
}

func (*HandshakeRequest) Descriptor deprecated

func (*HandshakeRequest) Descriptor() ([]byte, []int)

Deprecated: Use HandshakeRequest.ProtoReflect.Descriptor instead.

func (*HandshakeRequest) GetApiVersion

func (x *HandshakeRequest) GetApiVersion() []byte

func (*HandshakeRequest) GetWebHookUrl

func (x *HandshakeRequest) GetWebHookUrl() string

func (*HandshakeRequest) ProtoMessage

func (*HandshakeRequest) ProtoMessage()

func (*HandshakeRequest) ProtoReflect

func (x *HandshakeRequest) ProtoReflect() protoreflect.Message

func (*HandshakeRequest) Reset

func (x *HandshakeRequest) Reset()

func (*HandshakeRequest) String

func (x *HandshakeRequest) String() string

type HandshakeResponse

type HandshakeResponse struct {
	ApiVersion []byte `protobuf:"bytes,1,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"`
	// you can pull the judge status mapping if inconsistent
	JudgeStatusHash string `protobuf:"bytes,2,opt,name=judge_status_hash,json=judgeStatusHash,proto3" json:"judge_status_hash,omitempty"`
	// Simplest Judge Service Only implements 3 api:
	//   CreateContainer
	//   RemoveContainer
	//   QueryJudge
	// special string:
	//   All: implemented all apis in this version
	ImplementedApis []string `protobuf:"bytes,3,rep,name=implemented_apis,json=implementedApis,proto3" json:"implemented_apis,omitempty"`
	// contains filtered or unexported fields
}

func (*HandshakeResponse) Descriptor deprecated

func (*HandshakeResponse) Descriptor() ([]byte, []int)

Deprecated: Use HandshakeResponse.ProtoReflect.Descriptor instead.

func (*HandshakeResponse) GetApiVersion

func (x *HandshakeResponse) GetApiVersion() []byte

func (*HandshakeResponse) GetImplementedApis

func (x *HandshakeResponse) GetImplementedApis() []string

func (*HandshakeResponse) GetJudgeStatusHash

func (x *HandshakeResponse) GetJudgeStatusHash() string

func (*HandshakeResponse) ProtoMessage

func (*HandshakeResponse) ProtoMessage()

func (*HandshakeResponse) ProtoReflect

func (x *HandshakeResponse) ProtoReflect() protoreflect.Message

func (*HandshakeResponse) Reset

func (x *HandshakeResponse) Reset()

func (*HandshakeResponse) String

func (x *HandshakeResponse) String() string

type JudgeResultReporterClient

type JudgeResultReporterClient interface {
	CallbackJudge(ctx context.Context, in *CallbackJudgeItem, opts ...grpc.CallOption) (*CallbackJudgeResponse, error)
}

JudgeResultReporterClient is the client API for JudgeResultReporter service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type JudgeResultReporterServer

type JudgeResultReporterServer interface {
	CallbackJudge(context.Context, *CallbackJudgeItem) (*CallbackJudgeResponse, error)
	// contains filtered or unexported methods
}

JudgeResultReporterServer is the server API for JudgeResultReporter service. All implementations must embed UnimplementedJudgeResultReporterServer for forward compatibility

type JudgeServiceClient

type JudgeServiceClient interface {
	Handshake(ctx context.Context, in *HandshakeRequest, opts ...grpc.CallOption) (*HandshakeResponse, error)
	// Environment Management
	// Create
	CreateContainer(ctx context.Context, in *CreateContainerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Bundle
	BundleContainer(ctx context.Context, in *BundleContainerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Remove
	RemoveContainer(ctx context.Context, in *RemoveContainerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Clone
	CloneContainer(ctx context.Context, in *CloneContainerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Check (single container or list container)
	// simple debugging. don't design complex plugin on it...
	CheckContainer(ctx context.Context, in *CheckContainerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Judge Program (Compile it).
	//   please notice that the container environment is prepared by container bundle.
	// copy binary is dangerous, but one can use this api to upload program.
	CopyFile(ctx context.Context, in *CopyFileRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// compile by the judge service with security checking
	CompileProgram(ctx context.Context, in *CompileProgramRequest, opts ...grpc.CallOption) (*CompileProgramResponse, error)
	// Judge Program (Run it).
	// Judge multiple times.
	// The judge service MUST accept all judge requests, and indicates the congestion by `MakeJudgeResponse.waiting`.
	// One user should place a high priority request before other requests in `MakeJudgeRequest.items`.
	// One user can cancel the waiting request in time.
	// The synchronized request will not block a service if it comes to the waiting status.
	MakeJudge(ctx context.Context, in *MakeJudgeRequest, opts ...grpc.CallOption) (*MakeJudgeResponse, error)
	// Query.
	QueryJudge(ctx context.Context, in *QueryJudgeRequest, opts ...grpc.CallOption) (*QueryJudgeResponse, error)
}

JudgeServiceClient is the client API for JudgeService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type JudgeServiceServer

type JudgeServiceServer interface {
	Handshake(context.Context, *HandshakeRequest) (*HandshakeResponse, error)
	// Environment Management
	// Create
	CreateContainer(context.Context, *CreateContainerRequest) (*emptypb.Empty, error)
	// Bundle
	BundleContainer(context.Context, *BundleContainerRequest) (*emptypb.Empty, error)
	// Remove
	RemoveContainer(context.Context, *RemoveContainerRequest) (*emptypb.Empty, error)
	// Clone
	CloneContainer(context.Context, *CloneContainerRequest) (*emptypb.Empty, error)
	// Check (single container or list container)
	// simple debugging. don't design complex plugin on it...
	CheckContainer(context.Context, *CheckContainerRequest) (*emptypb.Empty, error)
	// Judge Program (Compile it).
	//   please notice that the container environment is prepared by container bundle.
	// copy binary is dangerous, but one can use this api to upload program.
	CopyFile(context.Context, *CopyFileRequest) (*emptypb.Empty, error)
	// compile by the judge service with security checking
	CompileProgram(context.Context, *CompileProgramRequest) (*CompileProgramResponse, error)
	// Judge Program (Run it).
	// Judge multiple times.
	// The judge service MUST accept all judge requests, and indicates the congestion by `MakeJudgeResponse.waiting`.
	// One user should place a high priority request before other requests in `MakeJudgeRequest.items`.
	// One user can cancel the waiting request in time.
	// The synchronized request will not block a service if it comes to the waiting status.
	MakeJudge(context.Context, *MakeJudgeRequest) (*MakeJudgeResponse, error)
	// Query.
	QueryJudge(context.Context, *QueryJudgeRequest) (*QueryJudgeResponse, error)
	// contains filtered or unexported methods
}

JudgeServiceServer is the server API for JudgeService service. All implementations must embed UnimplementedJudgeServiceServer for forward compatibility

type JudgeStatus

type JudgeStatus int32

status in range [0, 1024) are reserved.

const (
	// never show in a correct response
	JudgeStatus_Unknown JudgeStatus = 0
	// traditional judge status, [0, 101) are reserved for judging programs.
	// accepted by checker
	JudgeStatus_Accepted JudgeStatus = 1
	// rejected by checker
	JudgeStatus_WrongAnswer JudgeStatus = 2
	// almost right but take subtle format error.
	JudgeStatus_PresentationError JudgeStatus = 3
	// The program throws some exception, sends a signal or gets a memory error such as segmentation fault.
	JudgeStatus_RuntimeError JudgeStatus = 4
	// The program tries to consume more memory than is indicated in the problem statement.
	JudgeStatus_MemoryLimitExceed JudgeStatus = 5
	// The program hadn't terminated in time indicated in the problem statement.
	JudgeStatus_TimeLimitExceed JudgeStatus = 6
	// The program touch the limit on output buffer size.
	JudgeStatus_OutputLimitExceed JudgeStatus = 7
	// if true, the points got from hint
	// for example:
	// “`
	// status: PartialResult
	// hint:
	//   points: 80
	//   message: 3 of 4 tasks passed
	// “`
	JudgeStatus_PartialResult JudgeStatus = 8
	// this status are not from runtime container, but can be returned from the JudgeService for convenience.
	//   (consider that the judge result storage can also make a response for tarus.api.judge.QueryJudge api)
	JudgeStatus_CompilationError JudgeStatus = 9
	// for not finished request.
	JudgeStatus_Running JudgeStatus = 10
	// traditional judge status, [101, 201) are reserved for judge services.
	// for internal error.
	JudgeStatus_SystemError JudgeStatus = 101
	// for security detection.
	JudgeStatus_SecurityPolicyViolation JudgeStatus = 102
	// crashing the judge checker, for the problem writers :)
	JudgeStatus_JudgeCheckerException JudgeStatus = 103
	// signal abort is raised, convert to runtime error if one wants
	JudgeStatus_AssertionFailed JudgeStatus = 104
	// signal float point exception is raised, convert to runtime error if one wants
	JudgeStatus_FloatingPointException JudgeStatus = 105
)

func (JudgeStatus) Descriptor

func (JudgeStatus) Enum

func (x JudgeStatus) Enum() *JudgeStatus

func (JudgeStatus) EnumDescriptor deprecated

func (JudgeStatus) EnumDescriptor() ([]byte, []int)

Deprecated: Use JudgeStatus.Descriptor instead.

func (JudgeStatus) Number

func (x JudgeStatus) Number() protoreflect.EnumNumber

func (JudgeStatus) String

func (x JudgeStatus) String() string

func (JudgeStatus) Type

type JudgeTestcase

type JudgeTestcase struct {
	JudgeKey []byte `protobuf:"bytes,1,opt,name=judge_key,json=judgeKey,proto3" json:"judge_key,omitempty"`
	// control behavior of the stdin and stdout of problem solver's process
	IoProvider string `protobuf:"bytes,2,opt,name=io_provider,json=ioProvider,proto3" json:"io_provider,omitempty"`
	// input argument for io_provider
	Input string `protobuf:"bytes,3,opt,name=input,proto3" json:"input,omitempty"`
	// output argument for io_provider
	Answer           string `protobuf:"bytes,4,opt,name=answer,proto3" json:"answer,omitempty"`
	EstimatedCputime int64  `protobuf:"varint,101,opt,name=estimated_cputime,json=estimatedCputime,proto3" json:"estimated_cputime,omitempty"`
	EstimatedCpuhard int64  `protobuf:"varint,102,opt,name=estimated_cpuhard,json=estimatedCpuhard,proto3" json:"estimated_cpuhard,omitempty"`
	EstimatedMemory  int64  `protobuf:"varint,103,opt,name=estimated_memory,json=estimatedMemory,proto3" json:"estimated_memory,omitempty"`
	EstimatedStack   int64  `protobuf:"varint,104,opt,name=estimated_stack,json=estimatedStack,proto3" json:"estimated_stack,omitempty"`
	// contains filtered or unexported fields
}

func (*JudgeTestcase) Descriptor deprecated

func (*JudgeTestcase) Descriptor() ([]byte, []int)

Deprecated: Use JudgeTestcase.ProtoReflect.Descriptor instead.

func (*JudgeTestcase) GetAnswer

func (x *JudgeTestcase) GetAnswer() string

func (*JudgeTestcase) GetEstimatedCpuhard

func (x *JudgeTestcase) GetEstimatedCpuhard() int64

func (*JudgeTestcase) GetEstimatedCputime

func (x *JudgeTestcase) GetEstimatedCputime() int64

func (*JudgeTestcase) GetEstimatedMemory

func (x *JudgeTestcase) GetEstimatedMemory() int64

func (*JudgeTestcase) GetEstimatedStack

func (x *JudgeTestcase) GetEstimatedStack() int64

func (*JudgeTestcase) GetInput

func (x *JudgeTestcase) GetInput() string

func (*JudgeTestcase) GetIoProvider

func (x *JudgeTestcase) GetIoProvider() string

func (*JudgeTestcase) GetJudgeKey

func (x *JudgeTestcase) GetJudgeKey() []byte

func (*JudgeTestcase) ProtoMessage

func (*JudgeTestcase) ProtoMessage()

func (*JudgeTestcase) ProtoReflect

func (x *JudgeTestcase) ProtoReflect() protoreflect.Message

func (*JudgeTestcase) Reset

func (x *JudgeTestcase) Reset()

func (*JudgeTestcase) String

func (x *JudgeTestcase) String() string

type MakeJudgeRequest

type MakeJudgeRequest struct {
	TaskKey    []byte           `protobuf:"bytes,1,opt,name=task_key,json=taskKey,proto3" json:"task_key,omitempty"`
	IoProvider string           `protobuf:"bytes,2,opt,name=io_provider,json=ioProvider,proto3" json:"io_provider,omitempty"`
	Testcases  []*JudgeTestcase `protobuf:"bytes,3,rep,name=testcases,proto3" json:"testcases,omitempty"`
	IsAsync    bool             `protobuf:"varint,101,opt,name=is_async,json=isAsync,proto3" json:"is_async,omitempty"`
	Cputime    int64            `protobuf:"varint,102,opt,name=cputime,proto3" json:"cputime,omitempty"`
	Cpuhard    int64            `protobuf:"varint,103,opt,name=cpuhard,proto3" json:"cpuhard,omitempty"`
	Memory     int64            `protobuf:"varint,104,opt,name=memory,proto3" json:"memory,omitempty"`
	Stack      int64            `protobuf:"varint,105,opt,name=stack,proto3" json:"stack,omitempty"`
	// contains filtered or unexported fields
}

func (*MakeJudgeRequest) Descriptor deprecated

func (*MakeJudgeRequest) Descriptor() ([]byte, []int)

Deprecated: Use MakeJudgeRequest.ProtoReflect.Descriptor instead.

func (*MakeJudgeRequest) GetCpuhard

func (x *MakeJudgeRequest) GetCpuhard() int64

func (*MakeJudgeRequest) GetCputime

func (x *MakeJudgeRequest) GetCputime() int64

func (*MakeJudgeRequest) GetIoProvider

func (x *MakeJudgeRequest) GetIoProvider() string

func (*MakeJudgeRequest) GetIsAsync

func (x *MakeJudgeRequest) GetIsAsync() bool

func (*MakeJudgeRequest) GetMemory

func (x *MakeJudgeRequest) GetMemory() int64

func (*MakeJudgeRequest) GetStack

func (x *MakeJudgeRequest) GetStack() int64

func (*MakeJudgeRequest) GetTaskKey

func (x *MakeJudgeRequest) GetTaskKey() []byte

func (*MakeJudgeRequest) GetTestcases

func (x *MakeJudgeRequest) GetTestcases() []*JudgeTestcase

func (*MakeJudgeRequest) ProtoMessage

func (*MakeJudgeRequest) ProtoMessage()

func (*MakeJudgeRequest) ProtoReflect

func (x *MakeJudgeRequest) ProtoReflect() protoreflect.Message

func (*MakeJudgeRequest) Reset

func (x *MakeJudgeRequest) Reset()

func (*MakeJudgeRequest) String

func (x *MakeJudgeRequest) String() string

type MakeJudgeResponse

type MakeJudgeResponse struct {

	// empty if is_async == true
	Items []*QueryJudgeItem `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
	// experimental fields
	// serving == len(requests) - (waiting + len(items))
	Waiting int32 `protobuf:"varint,101,opt,name=waiting,proto3" json:"waiting,omitempty"`
	// experimental fields
	// the service is likely recover at the time (time.Now() + qos_wait * time.Millisecond)
	// the qos is disabled if qos_wait == 0
	QosWait int32 `protobuf:"varint,102,opt,name=qos_wait,json=qosWait,proto3" json:"qos_wait,omitempty"`
	// contains filtered or unexported fields
}

func (*MakeJudgeResponse) Descriptor deprecated

func (*MakeJudgeResponse) Descriptor() ([]byte, []int)

Deprecated: Use MakeJudgeResponse.ProtoReflect.Descriptor instead.

func (*MakeJudgeResponse) GetItems

func (x *MakeJudgeResponse) GetItems() []*QueryJudgeItem

func (*MakeJudgeResponse) GetQosWait

func (x *MakeJudgeResponse) GetQosWait() int32

func (*MakeJudgeResponse) GetWaiting

func (x *MakeJudgeResponse) GetWaiting() int32

func (*MakeJudgeResponse) ProtoMessage

func (*MakeJudgeResponse) ProtoMessage()

func (*MakeJudgeResponse) ProtoReflect

func (x *MakeJudgeResponse) ProtoReflect() protoreflect.Message

func (*MakeJudgeResponse) Reset

func (x *MakeJudgeResponse) Reset()

func (*MakeJudgeResponse) String

func (x *MakeJudgeResponse) String() string

type OCIJudgeSession

type OCIJudgeSession struct {

	// StartedAt provides the time session begin.
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// UpdatedAt provides the last time of a successful write.
	UpdatedAt    *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	CommitStatus int32                  `protobuf:"varint,3,opt,name=commit_status,json=commitStatus,proto3" json:"commit_status,omitempty"`
	WorkerId     int32                  `protobuf:"varint,4,opt,name=worker_id,json=workerId,proto3" json:"worker_id,omitempty"`
	ContainerId  string                 `protobuf:"bytes,5,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
	BinTarget    string                 `protobuf:"bytes,6,opt,name=bin_target,json=binTarget,proto3" json:"bin_target,omitempty"`
	HostWorkdir  string                 `protobuf:"bytes,101,opt,name=host_workdir,json=hostWorkdir,proto3" json:"host_workdir,omitempty"`
	// contains filtered or unexported fields
}

func (*OCIJudgeSession) Descriptor deprecated

func (*OCIJudgeSession) Descriptor() ([]byte, []int)

Deprecated: Use OCIJudgeSession.ProtoReflect.Descriptor instead.

func (*OCIJudgeSession) GetBinTarget

func (x *OCIJudgeSession) GetBinTarget() string

func (*OCIJudgeSession) GetCommitStatus

func (x *OCIJudgeSession) GetCommitStatus() int32

func (*OCIJudgeSession) GetContainerId

func (x *OCIJudgeSession) GetContainerId() string

func (*OCIJudgeSession) GetCreatedAt

func (x *OCIJudgeSession) GetCreatedAt() *timestamppb.Timestamp

func (*OCIJudgeSession) GetHostWorkdir

func (x *OCIJudgeSession) GetHostWorkdir() string

func (*OCIJudgeSession) GetUpdatedAt

func (x *OCIJudgeSession) GetUpdatedAt() *timestamppb.Timestamp

func (*OCIJudgeSession) GetWorkerId

func (x *OCIJudgeSession) GetWorkerId() int32

func (*OCIJudgeSession) ProtoMessage

func (*OCIJudgeSession) ProtoMessage()

func (*OCIJudgeSession) ProtoReflect

func (x *OCIJudgeSession) ProtoReflect() protoreflect.Message

func (*OCIJudgeSession) Reset

func (x *OCIJudgeSession) Reset()

func (*OCIJudgeSession) String

func (x *OCIJudgeSession) String() string

type QueryJudgeItem

type QueryJudgeItem struct {
	JudgeKey  []byte      `protobuf:"bytes,1,opt,name=judge_key,json=judgeKey,proto3" json:"judge_key,omitempty"`
	TimeUse   int64       `protobuf:"varint,2,opt,name=time_use,json=timeUse,proto3" json:"time_use,omitempty"`
	MemoryUse int64       `protobuf:"varint,3,opt,name=memory_use,json=memoryUse,proto3" json:"memory_use,omitempty"`
	Status    JudgeStatus `protobuf:"varint,4,opt,name=status,proto3,enum=tarus.api.judge.JudgeStatus" json:"status,omitempty"`
	// customized message here, most likely return something special for judge server
	// some possible fields including:
	//  points: subtask bonus
	//  message: compilation error
	//  signal: memory error, floating point exception, etc.
	//  checker: asan report, seccomp violation, etc.
	// if you are looking for attaching the listed properties, please encode them into the `hint` field.
	Hint        []byte `protobuf:"bytes,101,opt,name=hint,proto3" json:"hint,omitempty"`
	TimeUseHard int64  `protobuf:"varint,102,opt,name=time_use_hard,json=timeUseHard,proto3" json:"time_use_hard,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryJudgeItem) Descriptor deprecated

func (*QueryJudgeItem) Descriptor() ([]byte, []int)

Deprecated: Use QueryJudgeItem.ProtoReflect.Descriptor instead.

func (*QueryJudgeItem) GetHint

func (x *QueryJudgeItem) GetHint() []byte

func (*QueryJudgeItem) GetJudgeKey

func (x *QueryJudgeItem) GetJudgeKey() []byte

func (*QueryJudgeItem) GetMemoryUse

func (x *QueryJudgeItem) GetMemoryUse() int64

func (*QueryJudgeItem) GetStatus

func (x *QueryJudgeItem) GetStatus() JudgeStatus

func (*QueryJudgeItem) GetTimeUse

func (x *QueryJudgeItem) GetTimeUse() int64

func (*QueryJudgeItem) GetTimeUseHard

func (x *QueryJudgeItem) GetTimeUseHard() int64

func (*QueryJudgeItem) ProtoMessage

func (*QueryJudgeItem) ProtoMessage()

func (*QueryJudgeItem) ProtoReflect

func (x *QueryJudgeItem) ProtoReflect() protoreflect.Message

func (*QueryJudgeItem) Reset

func (x *QueryJudgeItem) Reset()

func (*QueryJudgeItem) String

func (x *QueryJudgeItem) String() string

type QueryJudgeRequest

type QueryJudgeRequest struct {
	TaskKey  []byte `protobuf:"bytes,1,opt,name=task_key,json=taskKey,proto3" json:"task_key,omitempty"`
	JudgeKey []byte `protobuf:"bytes,2,opt,name=judge_key,json=judgeKey,proto3" json:"judge_key,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryJudgeRequest) Descriptor deprecated

func (*QueryJudgeRequest) Descriptor() ([]byte, []int)

Deprecated: Use QueryJudgeRequest.ProtoReflect.Descriptor instead.

func (*QueryJudgeRequest) GetJudgeKey

func (x *QueryJudgeRequest) GetJudgeKey() []byte

func (*QueryJudgeRequest) GetTaskKey

func (x *QueryJudgeRequest) GetTaskKey() []byte

func (*QueryJudgeRequest) ProtoMessage

func (*QueryJudgeRequest) ProtoMessage()

func (*QueryJudgeRequest) ProtoReflect

func (x *QueryJudgeRequest) ProtoReflect() protoreflect.Message

func (*QueryJudgeRequest) Reset

func (x *QueryJudgeRequest) Reset()

func (*QueryJudgeRequest) String

func (x *QueryJudgeRequest) String() string

type QueryJudgeResponse

type QueryJudgeResponse struct {
	Items []*QueryJudgeItem `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryJudgeResponse) Descriptor deprecated

func (*QueryJudgeResponse) Descriptor() ([]byte, []int)

Deprecated: Use QueryJudgeResponse.ProtoReflect.Descriptor instead.

func (*QueryJudgeResponse) GetItems

func (x *QueryJudgeResponse) GetItems() []*QueryJudgeItem

func (*QueryJudgeResponse) ProtoMessage

func (*QueryJudgeResponse) ProtoMessage()

func (*QueryJudgeResponse) ProtoReflect

func (x *QueryJudgeResponse) ProtoReflect() protoreflect.Message

func (*QueryJudgeResponse) Reset

func (x *QueryJudgeResponse) Reset()

func (*QueryJudgeResponse) String

func (x *QueryJudgeResponse) String() string

type RemoveContainerRequest

type RemoveContainerRequest struct {
	TaskKey []byte `protobuf:"bytes,1,opt,name=task_key,json=taskKey,proto3" json:"task_key,omitempty"`
	// contains filtered or unexported fields
}

func (*RemoveContainerRequest) Descriptor deprecated

func (*RemoveContainerRequest) Descriptor() ([]byte, []int)

Deprecated: Use RemoveContainerRequest.ProtoReflect.Descriptor instead.

func (*RemoveContainerRequest) GetTaskKey

func (x *RemoveContainerRequest) GetTaskKey() []byte

func (*RemoveContainerRequest) ProtoMessage

func (*RemoveContainerRequest) ProtoMessage()

func (*RemoveContainerRequest) ProtoReflect

func (x *RemoveContainerRequest) ProtoReflect() protoreflect.Message

func (*RemoveContainerRequest) Reset

func (x *RemoveContainerRequest) Reset()

func (*RemoveContainerRequest) String

func (x *RemoveContainerRequest) String() string

type UnimplementedJudgeResultReporterServer

type UnimplementedJudgeResultReporterServer struct {
}

UnimplementedJudgeResultReporterServer must be embedded to have forward compatible implementations.

func (UnimplementedJudgeResultReporterServer) CallbackJudge

type UnimplementedJudgeServiceServer

type UnimplementedJudgeServiceServer struct {
}

UnimplementedJudgeServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedJudgeServiceServer) BundleContainer

func (UnimplementedJudgeServiceServer) CheckContainer

func (UnimplementedJudgeServiceServer) CloneContainer

func (UnimplementedJudgeServiceServer) CompileProgram

func (UnimplementedJudgeServiceServer) CopyFile

func (UnimplementedJudgeServiceServer) CreateContainer

func (UnimplementedJudgeServiceServer) Handshake

func (UnimplementedJudgeServiceServer) MakeJudge

func (UnimplementedJudgeServiceServer) QueryJudge

func (UnimplementedJudgeServiceServer) RemoveContainer

type UnsafeJudgeResultReporterServer

type UnsafeJudgeResultReporterServer interface {
	// contains filtered or unexported methods
}

UnsafeJudgeResultReporterServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to JudgeResultReporterServer will result in compilation errors.

type UnsafeJudgeServiceServer

type UnsafeJudgeServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeJudgeServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to JudgeServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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