pb

package
v0.0.0-...-ebdf71b Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	JobStatus_JobState_name = map[int32]string{
		0: "JOBSTATE_INVALID",
		1: "JOBSTATE_RUNNING",
		2: "JOBSTATE_COMPLETED",
	}
	JobStatus_JobState_value = map[string]int32{
		"JOBSTATE_INVALID":   0,
		"JOBSTATE_RUNNING":   1,
		"JOBSTATE_COMPLETED": 2,
	}
)

Enum value maps for JobStatus_JobState.

View Source
var File_jobexec_proto protoreflect.FileDescriptor
View Source
var JobExecutor_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "JobExecutor",
	HandlerType: (*JobExecutorServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Run",
			Handler:    _JobExecutor_Run_Handler,
		},
		{
			MethodName: "Stop",
			Handler:    _JobExecutor_Stop_Handler,
		},
		{
			MethodName: "List",
			Handler:    _JobExecutor_List_Handler,
		},
		{
			MethodName: "Status",
			Handler:    _JobExecutor_Status_Handler,
		},
		{
			MethodName: "Shutdown",
			Handler:    _JobExecutor_Shutdown_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Logs",
			Handler:       _JobExecutor_Logs_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "jobexec.proto",
}

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

Functions

func RegisterJobExecutorServer

func RegisterJobExecutorServer(s grpc.ServiceRegistrar, srv JobExecutorServer)

Types

type DiskIOLimit

type DiskIOLimit struct {

	// device is a block device node in the filesystem (e.g. /dev/sda) that
	// the limits are on.
	Device string `protobuf:"bytes,1,opt,name=device,proto3" json:"device,omitempty"`
	// read_bps is the maximum read rate in bytes per second
	ReadBps uint64 `protobuf:"varint,2,opt,name=read_bps,json=readBps,proto3" json:"read_bps,omitempty"`
	// write_bps is the maximum write rate in bytes per second
	WriteBps uint64 `protobuf:"varint,3,opt,name=write_bps,json=writeBps,proto3" json:"write_bps,omitempty"`
	// read_iops is the maximum number of read i/o operations per second
	ReadIops uint32 `protobuf:"varint,4,opt,name=read_iops,json=readIops,proto3" json:"read_iops,omitempty"`
	// write_iops is the maximum number of write i/o operations per second
	WriteIops uint32 `protobuf:"varint,5,opt,name=write_iops,json=writeIops,proto3" json:"write_iops,omitempty"`
	// contains filtered or unexported fields
}

func (*DiskIOLimit) Descriptor deprecated

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

Deprecated: Use DiskIOLimit.ProtoReflect.Descriptor instead.

func (*DiskIOLimit) GetDevice

func (x *DiskIOLimit) GetDevice() string

func (*DiskIOLimit) GetReadBps

func (x *DiskIOLimit) GetReadBps() uint64

func (*DiskIOLimit) GetReadIops

func (x *DiskIOLimit) GetReadIops() uint32

func (*DiskIOLimit) GetWriteBps

func (x *DiskIOLimit) GetWriteBps() uint64

func (*DiskIOLimit) GetWriteIops

func (x *DiskIOLimit) GetWriteIops() uint32

func (*DiskIOLimit) ProtoMessage

func (*DiskIOLimit) ProtoMessage()

func (*DiskIOLimit) ProtoReflect

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

func (*DiskIOLimit) Reset

func (x *DiskIOLimit) Reset()

func (*DiskIOLimit) String

func (x *DiskIOLimit) String() string

type JobExecutorClient

type JobExecutorClient interface {
	Run(ctx context.Context, in *RunRequest, opts ...grpc.CallOption) (*RunResponse, error)
	Stop(ctx context.Context, in *StopRequest, opts ...grpc.CallOption) (*StopResponse, error)
	List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
	Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error)
	Logs(ctx context.Context, in *LogsRequest, opts ...grpc.CallOption) (JobExecutor_LogsClient, error)
	Shutdown(ctx context.Context, in *ShutdownRequest, opts ...grpc.CallOption) (*ShutdownResponse, error)
}

JobExecutorClient is the client API for JobExecutor 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 JobExecutorServer

type JobExecutorServer interface {
	Run(context.Context, *RunRequest) (*RunResponse, error)
	Stop(context.Context, *StopRequest) (*StopResponse, error)
	List(context.Context, *ListRequest) (*ListResponse, error)
	Status(context.Context, *StatusRequest) (*StatusResponse, error)
	Logs(*LogsRequest, JobExecutor_LogsServer) error
	Shutdown(context.Context, *ShutdownRequest) (*ShutdownResponse, error)
	// contains filtered or unexported methods
}

JobExecutorServer is the server API for JobExecutor service. All implementations must embed UnimplementedJobExecutorServer for forward compatibility

type JobExecutor_LogsClient

type JobExecutor_LogsClient interface {
	Recv() (*LogsResponse, error)
	grpc.ClientStream
}

type JobExecutor_LogsServer

type JobExecutor_LogsServer interface {
	Send(*LogsResponse) error
	grpc.ServerStream
}

type JobSpec

type JobSpec struct {

	// command is a full path to the program to be executed for the job.
	// $PATH is not searched for the command.
	Command string `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"`
	// arguments is the argument vector given to the process when it is run.
	// The first argument should be the name of the command followed by the
	// arguments to the command.
	Arguments []string `protobuf:"bytes,2,rep,name=arguments,proto3" json:"arguments,omitempty"`
	// resources specify resource constraints for running the job. Default
	// resource constraints may be applied if this field is not provided.
	Resources *Resources `protobuf:"bytes,3,opt,name=resources,proto3" json:"resources,omitempty"`
	// root_dir is a directory that is set as the root directory in the
	// filesystem namespace in which the job runs. If it is empty, the job
	// runs in the the same filesystem namespace as the program executing
	// the job.
	RootDir string `protobuf:"bytes,4,opt,name=root_dir,json=rootDir,proto3" json:"root_dir,omitempty"`
	// isolate_network runs the job in a network namespace with no network
	// interfaces, preventing any network communication.
	IsolateNetwork bool `protobuf:"varint,5,opt,name=isolate_network,json=isolateNetwork,proto3" json:"isolate_network,omitempty"`
	// contains filtered or unexported fields
}

func (*JobSpec) Descriptor deprecated

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

Deprecated: Use JobSpec.ProtoReflect.Descriptor instead.

func (*JobSpec) GetArguments

func (x *JobSpec) GetArguments() []string

func (*JobSpec) GetCommand

func (x *JobSpec) GetCommand() string

func (*JobSpec) GetIsolateNetwork

func (x *JobSpec) GetIsolateNetwork() bool

func (*JobSpec) GetResources

func (x *JobSpec) GetResources() *Resources

func (*JobSpec) GetRootDir

func (x *JobSpec) GetRootDir() string

func (*JobSpec) ProtoMessage

func (*JobSpec) ProtoMessage()

func (*JobSpec) ProtoReflect

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

func (*JobSpec) Reset

func (x *JobSpec) Reset()

func (*JobSpec) String

func (x *JobSpec) String() string

type JobStatus

type JobStatus struct {
	JobId     []byte                 `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"`
	StartTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
	User      string                 `protobuf:"bytes,3,opt,name=user,proto3" json:"user,omitempty"`
	State     JobStatus_JobState     `protobuf:"varint,4,opt,name=state,proto3,enum=JobStatus_JobState" json:"state,omitempty"`
	ExitCode  uint32                 `protobuf:"varint,5,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"`
	Spec      *JobSpec               `protobuf:"bytes,6,opt,name=spec,proto3" json:"spec,omitempty"`
	// contains filtered or unexported fields
}

func (*JobStatus) Descriptor deprecated

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

Deprecated: Use JobStatus.ProtoReflect.Descriptor instead.

func (*JobStatus) GetExitCode

func (x *JobStatus) GetExitCode() uint32

func (*JobStatus) GetJobId

func (x *JobStatus) GetJobId() []byte

func (*JobStatus) GetSpec

func (x *JobStatus) GetSpec() *JobSpec

func (*JobStatus) GetStartTime

func (x *JobStatus) GetStartTime() *timestamppb.Timestamp

func (*JobStatus) GetState

func (x *JobStatus) GetState() JobStatus_JobState

func (*JobStatus) GetUser

func (x *JobStatus) GetUser() string

func (*JobStatus) ProtoMessage

func (*JobStatus) ProtoMessage()

func (*JobStatus) ProtoReflect

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

func (*JobStatus) Reset

func (x *JobStatus) Reset()

func (*JobStatus) String

func (x *JobStatus) String() string

type JobStatus_JobState

type JobStatus_JobState int32
const (
	JobStatus_JOBSTATE_INVALID   JobStatus_JobState = 0
	JobStatus_JOBSTATE_RUNNING   JobStatus_JobState = 1
	JobStatus_JOBSTATE_COMPLETED JobStatus_JobState = 2
)

func (JobStatus_JobState) Descriptor

func (JobStatus_JobState) Enum

func (JobStatus_JobState) EnumDescriptor deprecated

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

Deprecated: Use JobStatus_JobState.Descriptor instead.

func (JobStatus_JobState) Number

func (JobStatus_JobState) String

func (x JobStatus_JobState) String() string

func (JobStatus_JobState) Type

type ListRequest

type ListRequest struct {

	// all_job requests that a user with admin authorization list all users jobs
	// and not just their own.
	AllJobs bool `protobuf:"varint,1,opt,name=all_jobs,json=allJobs,proto3" json:"all_jobs,omitempty"`
	// completed requests that completed jobs be included in the response as
	// well as running jobs
	Completed bool `protobuf:"varint,2,opt,name=completed,proto3" json:"completed,omitempty"`
	// contains filtered or unexported fields
}

func (*ListRequest) Descriptor deprecated

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

Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.

func (*ListRequest) GetAllJobs

func (x *ListRequest) GetAllJobs() bool

func (*ListRequest) GetCompleted

func (x *ListRequest) GetCompleted() bool

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) ProtoReflect

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

func (*ListRequest) Reset

func (x *ListRequest) Reset()

func (*ListRequest) String

func (x *ListRequest) String() string

type ListResponse

type ListResponse struct {
	Jobs []*JobStatus `protobuf:"bytes,1,rep,name=jobs,proto3" json:"jobs,omitempty"`
	// contains filtered or unexported fields
}

func (*ListResponse) Descriptor deprecated

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

Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.

func (*ListResponse) GetJobs

func (x *ListResponse) GetJobs() []*JobStatus

func (*ListResponse) ProtoMessage

func (*ListResponse) ProtoMessage()

func (*ListResponse) ProtoReflect

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

func (*ListResponse) Reset

func (x *ListResponse) Reset()

func (*ListResponse) String

func (x *ListResponse) String() string

type LogsRequest

type LogsRequest struct {
	JobId  []byte `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"`
	Follow bool   `protobuf:"varint,2,opt,name=follow,proto3" json:"follow,omitempty"`
	// contains filtered or unexported fields
}

func (*LogsRequest) Descriptor deprecated

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

Deprecated: Use LogsRequest.ProtoReflect.Descriptor instead.

func (*LogsRequest) GetFollow

func (x *LogsRequest) GetFollow() bool

func (*LogsRequest) GetJobId

func (x *LogsRequest) GetJobId() []byte

func (*LogsRequest) ProtoMessage

func (*LogsRequest) ProtoMessage()

func (*LogsRequest) ProtoReflect

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

func (*LogsRequest) Reset

func (x *LogsRequest) Reset()

func (*LogsRequest) String

func (x *LogsRequest) String() string

type LogsResponse

type LogsResponse struct {

	// timestamp is the time the log line was captured.
	Timestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// line is a line of output from a job, including the trailing newline.
	// The length is capped at 512 bytes; lines longer than that are split
	// into multiple LogsReponse messages. Split lines will not have a newline
	// within it. Purely binary output from a job will appear as multiple
	// 512-byte chunks, although a newline character in the binary stream may
	// cause a short block.
	Line []byte `protobuf:"bytes,2,opt,name=line,proto3" json:"line,omitempty"`
	// contains filtered or unexported fields
}

func (*LogsResponse) Descriptor deprecated

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

Deprecated: Use LogsResponse.ProtoReflect.Descriptor instead.

func (*LogsResponse) GetLine

func (x *LogsResponse) GetLine() []byte

func (*LogsResponse) GetTimestamp

func (x *LogsResponse) GetTimestamp() *timestamppb.Timestamp

func (*LogsResponse) ProtoMessage

func (*LogsResponse) ProtoMessage()

func (*LogsResponse) ProtoReflect

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

func (*LogsResponse) Reset

func (x *LogsResponse) Reset()

func (*LogsResponse) String

func (x *LogsResponse) String() string

type Resources

type Resources struct {

	// milli_cpu is the amount of CPU available to the job when there is CPU
	// contention. 1000 mCPU means 1 full CPU is available to the job.
	MilliCpu uint32 `protobuf:"varint,1,opt,name=milli_cpu,json=milliCpu,proto3" json:"milli_cpu,omitempty"`
	// memory is the amount of RAM made available to the job. A job exceeding
	// this amount may be killed by the kernel.
	Memory uint64 `protobuf:"varint,2,opt,name=memory,proto3" json:"memory,omitempty"`
	// io_limits is the input/output bandwidth limits for block devices.
	IoLimits []*DiskIOLimit `protobuf:"bytes,3,rep,name=io_limits,json=ioLimits,proto3" json:"io_limits,omitempty"`
	// max_processes is the maximum number of processes the job can run
	// concurrently, including itself.
	MaxProcesses uint32 `protobuf:"varint,4,opt,name=max_processes,json=maxProcesses,proto3" json:"max_processes,omitempty"`
	// contains filtered or unexported fields
}

func (*Resources) Descriptor deprecated

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

Deprecated: Use Resources.ProtoReflect.Descriptor instead.

func (*Resources) GetIoLimits

func (x *Resources) GetIoLimits() []*DiskIOLimit

func (*Resources) GetMaxProcesses

func (x *Resources) GetMaxProcesses() uint32

func (*Resources) GetMemory

func (x *Resources) GetMemory() uint64

func (*Resources) GetMilliCpu

func (x *Resources) GetMilliCpu() uint32

func (*Resources) ProtoMessage

func (*Resources) ProtoMessage()

func (*Resources) ProtoReflect

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

func (*Resources) Reset

func (x *Resources) Reset()

func (*Resources) String

func (x *Resources) String() string

type RunRequest

type RunRequest struct {
	Spec *JobSpec `protobuf:"bytes,1,opt,name=spec,proto3" json:"spec,omitempty"`
	// contains filtered or unexported fields
}

func (*RunRequest) Descriptor deprecated

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

Deprecated: Use RunRequest.ProtoReflect.Descriptor instead.

func (*RunRequest) GetSpec

func (x *RunRequest) GetSpec() *JobSpec

func (*RunRequest) ProtoMessage

func (*RunRequest) ProtoMessage()

func (*RunRequest) ProtoReflect

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

func (*RunRequest) Reset

func (x *RunRequest) Reset()

func (*RunRequest) String

func (x *RunRequest) String() string

type RunResponse

type RunResponse struct {
	JobId []byte `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"`
	// contains filtered or unexported fields
}

func (*RunResponse) Descriptor deprecated

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

Deprecated: Use RunResponse.ProtoReflect.Descriptor instead.

func (*RunResponse) GetJobId

func (x *RunResponse) GetJobId() []byte

func (*RunResponse) ProtoMessage

func (*RunResponse) ProtoMessage()

func (*RunResponse) ProtoReflect

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

func (*RunResponse) Reset

func (x *RunResponse) Reset()

func (*RunResponse) String

func (x *RunResponse) String() string

type ShutdownRequest

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

func (*ShutdownRequest) Descriptor deprecated

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

Deprecated: Use ShutdownRequest.ProtoReflect.Descriptor instead.

func (*ShutdownRequest) ProtoMessage

func (*ShutdownRequest) ProtoMessage()

func (*ShutdownRequest) ProtoReflect

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

func (*ShutdownRequest) Reset

func (x *ShutdownRequest) Reset()

func (*ShutdownRequest) String

func (x *ShutdownRequest) String() string

type ShutdownResponse

type ShutdownResponse struct {
	NumJobsStopped int32 `protobuf:"varint,1,opt,name=num_jobs_stopped,json=numJobsStopped,proto3" json:"num_jobs_stopped,omitempty"`
	// contains filtered or unexported fields
}

func (*ShutdownResponse) Descriptor deprecated

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

Deprecated: Use ShutdownResponse.ProtoReflect.Descriptor instead.

func (*ShutdownResponse) GetNumJobsStopped

func (x *ShutdownResponse) GetNumJobsStopped() int32

func (*ShutdownResponse) ProtoMessage

func (*ShutdownResponse) ProtoMessage()

func (*ShutdownResponse) ProtoReflect

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

func (*ShutdownResponse) Reset

func (x *ShutdownResponse) Reset()

func (*ShutdownResponse) String

func (x *ShutdownResponse) String() string

type StatusRequest

type StatusRequest struct {
	JobId []byte `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"`
	// contains filtered or unexported fields
}

func (*StatusRequest) Descriptor deprecated

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

Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead.

func (*StatusRequest) GetJobId

func (x *StatusRequest) GetJobId() []byte

func (*StatusRequest) ProtoMessage

func (*StatusRequest) ProtoMessage()

func (*StatusRequest) ProtoReflect

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

func (*StatusRequest) Reset

func (x *StatusRequest) Reset()

func (*StatusRequest) String

func (x *StatusRequest) String() string

type StatusResponse

type StatusResponse struct {
	Status *JobStatus `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*StatusResponse) Descriptor deprecated

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

Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead.

func (*StatusResponse) GetStatus

func (x *StatusResponse) GetStatus() *JobStatus

func (*StatusResponse) ProtoMessage

func (*StatusResponse) ProtoMessage()

func (*StatusResponse) ProtoReflect

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

func (*StatusResponse) Reset

func (x *StatusResponse) Reset()

func (*StatusResponse) String

func (x *StatusResponse) String() string

type StopRequest

type StopRequest struct {
	JobId []byte `protobuf:"bytes,1,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"`
	// cleanup specifies that the job be removed from tracking. After completion
	// of a cleanup stop request, the job_id will no longer be valid, and status
	// and stored output will be discarded by the server.
	Cleanup bool `protobuf:"varint,2,opt,name=cleanup,proto3" json:"cleanup,omitempty"`
	// contains filtered or unexported fields
}

func (*StopRequest) Descriptor deprecated

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

Deprecated: Use StopRequest.ProtoReflect.Descriptor instead.

func (*StopRequest) GetCleanup

func (x *StopRequest) GetCleanup() bool

func (*StopRequest) GetJobId

func (x *StopRequest) GetJobId() []byte

func (*StopRequest) ProtoMessage

func (*StopRequest) ProtoMessage()

func (*StopRequest) ProtoReflect

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

func (*StopRequest) Reset

func (x *StopRequest) Reset()

func (*StopRequest) String

func (x *StopRequest) String() string

type StopResponse

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

func (*StopResponse) Descriptor deprecated

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

Deprecated: Use StopResponse.ProtoReflect.Descriptor instead.

func (*StopResponse) ProtoMessage

func (*StopResponse) ProtoMessage()

func (*StopResponse) ProtoReflect

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

func (*StopResponse) Reset

func (x *StopResponse) Reset()

func (*StopResponse) String

func (x *StopResponse) String() string

type UnimplementedJobExecutorServer

type UnimplementedJobExecutorServer struct {
}

UnimplementedJobExecutorServer must be embedded to have forward compatible implementations.

func (UnimplementedJobExecutorServer) List

func (UnimplementedJobExecutorServer) Logs

func (UnimplementedJobExecutorServer) Run

func (UnimplementedJobExecutorServer) Shutdown

func (UnimplementedJobExecutorServer) Status

func (UnimplementedJobExecutorServer) Stop

type UnsafeJobExecutorServer

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

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

Jump to

Keyboard shortcuts

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