tes

package
v0.0.0-...-5db00e0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2017 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package tes is a generated protocol buffer package.

It is generated from these files:

tes.proto

It has these top-level messages:

Task
Input
Output
Executor
Resources
TaskLog
ExecutorLog
OutputFileLog
CreateTaskResponse
GetTaskRequest
ListTasksRequest
ListTasksResponse
CancelTaskRequest
CancelTaskResponse
ServiceInfoRequest
ServiceInfo

Package tes is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Unknown       = State_UNKNOWN
	Queued        = State_QUEUED
	Running       = State_RUNNING
	Paused        = State_PAUSED
	Complete      = State_COMPLETE
	ExecutorError = State_EXECUTOR_ERROR
	SystemError   = State_SYSTEM_ERROR
	Canceled      = State_CANCELED
	Initializing  = State_INITIALIZING
)

State variables for convenience

Variables

View Source
var FileType_name = map[int32]string{
	0: "FILE",
	1: "DIRECTORY",
}
View Source
var FileType_value = map[string]int32{
	"FILE":      0,
	"DIRECTORY": 1,
}
View Source
var Marshaler = jsonpb.Marshaler{
	Indent: "  ",
}

Marshaler marshals tasks to indented JSON.

View Source
var State_name = map[int32]string{
	0: "UNKNOWN",
	1: "QUEUED",
	2: "INITIALIZING",
	3: "RUNNING",
	4: "PAUSED",
	5: "COMPLETE",
	6: "EXECUTOR_ERROR",
	7: "SYSTEM_ERROR",
	8: "CANCELED",
}
View Source
var State_value = map[string]int32{
	"UNKNOWN":        0,
	"QUEUED":         1,
	"INITIALIZING":   2,
	"RUNNING":        3,
	"PAUSED":         4,
	"COMPLETE":       5,
	"EXECUTOR_ERROR": 6,
	"SYSTEM_ERROR":   7,
	"CANCELED":       8,
}
View Source
var TaskView_name = map[int32]string{
	0: "MINIMAL",
	1: "BASIC",
	2: "FULL",
}
View Source
var TaskView_value = map[string]int32{
	"MINIMAL": 0,
	"BASIC":   1,
	"FULL":    2,
}

Functions

func GenerateID

func GenerateID() string

GenerateID generates a task ID string. IDs are globally unique and sortable.

func GetPageSize

func GetPageSize(reqSize uint32) int

GetPageSize takes in the page size from a request and returns a new page size taking into account the minimum, maximum and default as documented in the TES spec.

func InitTask

func InitTask(task *Task) error

InitTask intializes task fields which are commonly set by CreateTask, such as Id, CreationTime, State, etc. If the task fails validation, an error is returned. See Validate(). The given task is modified.

func MarshalToString

func MarshalToString(t *Task) (string, error)

MarshalToString marshals a task to an indented JSON string.

func RegisterTaskServiceHandler

func RegisterTaskServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterTaskServiceHandler registers the http handlers for service TaskService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterTaskServiceHandlerFromEndpoint

func RegisterTaskServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterTaskServiceHandlerFromEndpoint is same as RegisterTaskServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterTaskServiceServer

func RegisterTaskServiceServer(s *grpc.Server, srv TaskServiceServer)

func RunnableState

func RunnableState(s State) bool

RunnableState returns true if the state is RUNNING or INITIALIZING

func TerminalState

func TerminalState(s State) bool

TerminalState returns true if the state is COMPLETE, ERROR, SYSTEM_ERROR, or CANCELED

func ValidateTransition

func ValidateTransition(from, to State) error

ValidateTransition validates a task state transition.

Types

type CancelTaskRequest

type CancelTaskRequest struct {
	// REQUIRED
	//
	// Task identifier.
	Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
}

CancelTaskRequest describes a request to the CancelTask endpoint.

func (*CancelTaskRequest) Descriptor

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

func (*CancelTaskRequest) GetId

func (m *CancelTaskRequest) GetId() string

func (*CancelTaskRequest) ProtoMessage

func (*CancelTaskRequest) ProtoMessage()

func (*CancelTaskRequest) Reset

func (m *CancelTaskRequest) Reset()

func (*CancelTaskRequest) String

func (m *CancelTaskRequest) String() string

type CancelTaskResponse

type CancelTaskResponse struct {
}

OUTPUT ONLY

CancelTaskResponse describes a response from the CancelTask endpoint.

func (*CancelTaskResponse) Descriptor

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

func (*CancelTaskResponse) ProtoMessage

func (*CancelTaskResponse) ProtoMessage()

func (*CancelTaskResponse) Reset

func (m *CancelTaskResponse) Reset()

func (*CancelTaskResponse) String

func (m *CancelTaskResponse) String() string

type CreateTaskResponse

type CreateTaskResponse struct {
	// REQUIRED
	//
	// Task identifier assigned by the server.
	Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
}

OUTPUT ONLY

CreateTaskResponse describes a response from the CreateTask endpoint.

func (*CreateTaskResponse) Descriptor

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

func (*CreateTaskResponse) GetId

func (m *CreateTaskResponse) GetId() string

func (*CreateTaskResponse) ProtoMessage

func (*CreateTaskResponse) ProtoMessage()

func (*CreateTaskResponse) Reset

func (m *CreateTaskResponse) Reset()

func (*CreateTaskResponse) String

func (m *CreateTaskResponse) String() string

type Executor

type Executor struct {
	// REQUIRED
	//
	// Name of the container image, for example:
	// ubuntu
	// quay.io/aptible/ubuntu
	// gcr.io/my-org/my-image
	// etc...
	Image string `protobuf:"bytes,1,opt,name=image" json:"image,omitempty"`
	// REQUIRED
	//
	// A sequence of program arguments to execute, where the first argument
	// is the program to execute (i.e. argv).
	Command []string `protobuf:"bytes,2,rep,name=command" json:"command,omitempty"`
	// OPTIONAL
	//
	// The working directory that the command will be executed in.
	// Defaults to the directory set by the container image.
	Workdir string `protobuf:"bytes,3,opt,name=workdir" json:"workdir,omitempty"`
	// OPTIONAL
	//
	// Path inside the container to a file which will be piped
	// to the executor's stdin. Must be an absolute path.
	Stdin string `protobuf:"bytes,6,opt,name=stdin" json:"stdin,omitempty"`
	// OPTIONAL
	//
	// Path inside the container to a file where the executor's
	// stdout will be written to. Must be an absolute path.
	Stdout string `protobuf:"bytes,4,opt,name=stdout" json:"stdout,omitempty"`
	// OPTIONAL
	//
	// Path inside the container to a file where the executor's
	// stderr will be written to. Must be an absolute path.
	Stderr string `protobuf:"bytes,5,opt,name=stderr" json:"stderr,omitempty"`
	// OPTIONAL
	//
	// Enviromental variables to set within the container.
	Env map[string]string `` /* 126-byte string literal not displayed */
}

Executor describes a command to be executed, and its environment.

func (*Executor) Descriptor

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

func (*Executor) GetCommand

func (m *Executor) GetCommand() []string

func (*Executor) GetEnv

func (m *Executor) GetEnv() map[string]string

func (*Executor) GetImage

func (m *Executor) GetImage() string

func (*Executor) GetStderr

func (m *Executor) GetStderr() string

func (*Executor) GetStdin

func (m *Executor) GetStdin() string

func (*Executor) GetStdout

func (m *Executor) GetStdout() string

func (*Executor) GetWorkdir

func (m *Executor) GetWorkdir() string

func (*Executor) ProtoMessage

func (*Executor) ProtoMessage()

func (*Executor) Reset

func (m *Executor) Reset()

func (*Executor) String

func (m *Executor) String() string

type ExecutorLog

type ExecutorLog struct {
	// OPTIONAL
	//
	// Time the executor started, in RFC 3339 format.
	StartTime string `protobuf:"bytes,2,opt,name=start_time,json=startTime" json:"start_time,omitempty"`
	// OPTIONAL
	//
	// Time the executor ended, in RFC 3339 format.
	EndTime string `protobuf:"bytes,3,opt,name=end_time,json=endTime" json:"end_time,omitempty"`
	// OPTIONAL
	//
	// Stdout content.
	//
	// This is meant for convenience. No guarantees are made about the content.
	// Implementations may chose different approaches: only the head, only the tail,
	// a URL reference only, etc.
	//
	// In order to capture the full stdout users should set Executor.stdout
	// to a container file path, and use Task.outputs to upload that file
	// to permanent storage.
	Stdout string `protobuf:"bytes,4,opt,name=stdout" json:"stdout,omitempty"`
	// OPTIONAL
	//
	// Stderr content.
	//
	// This is meant for convenience. No guarantees are made about the content.
	// Implementations may chose different approaches: only the head, only the tail,
	// a URL reference only, etc.
	//
	// In order to capture the full stderr users should set Executor.stderr
	// to a container file path, and use Task.outputs to upload that file
	// to permanent storage.
	Stderr string `protobuf:"bytes,5,opt,name=stderr" json:"stderr,omitempty"`
	// REQUIRED
	//
	// Exit code.
	ExitCode int32 `protobuf:"varint,6,opt,name=exit_code,json=exitCode" json:"exit_code,omitempty"`
}

OUTPUT ONLY

ExecutorLog describes logging information related to an Executor.

func (*ExecutorLog) Descriptor

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

func (*ExecutorLog) GetEndTime

func (m *ExecutorLog) GetEndTime() string

func (*ExecutorLog) GetExitCode

func (m *ExecutorLog) GetExitCode() int32

func (*ExecutorLog) GetStartTime

func (m *ExecutorLog) GetStartTime() string

func (*ExecutorLog) GetStderr

func (m *ExecutorLog) GetStderr() string

func (*ExecutorLog) GetStdout

func (m *ExecutorLog) GetStdout() string

func (*ExecutorLog) ProtoMessage

func (*ExecutorLog) ProtoMessage()

func (*ExecutorLog) Reset

func (m *ExecutorLog) Reset()

func (*ExecutorLog) String

func (m *ExecutorLog) String() string

type FileType

type FileType int32
const (
	FileType_FILE      FileType = 0
	FileType_DIRECTORY FileType = 1
)

func (FileType) EnumDescriptor

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

func (FileType) String

func (x FileType) String() string

type GetTaskRequest

type GetTaskRequest struct {
	// REQUIRED
	//
	// Task identifier.
	Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	// OPTIONAL
	//
	// Affects the fields included in the returned Task messages.
	// See TaskView below.
	View TaskView `protobuf:"varint,2,opt,name=view,enum=tes.TaskView" json:"view,omitempty"`
}

GetTaskRequest describes a request to the GetTask endpoint.

func (*GetTaskRequest) Descriptor

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

func (*GetTaskRequest) GetId

func (m *GetTaskRequest) GetId() string

func (*GetTaskRequest) GetView

func (m *GetTaskRequest) GetView() TaskView

func (*GetTaskRequest) ProtoMessage

func (*GetTaskRequest) ProtoMessage()

func (*GetTaskRequest) Reset

func (m *GetTaskRequest) Reset()

func (*GetTaskRequest) String

func (m *GetTaskRequest) String() string

type Input

type Input struct {
	// OPTIONAL
	Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	// OPTIONAL
	Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"`
	// REQUIRED, unless "content" is set.
	//
	// URL in long term storage, for example:
	// s3://my-object-store/file1
	// gs://my-bucket/file2
	// file:///path/to/my/file
	// /path/to/my/file
	// etc...
	Url string `protobuf:"bytes,3,opt,name=url" json:"url,omitempty"`
	// REQUIRED
	//
	// Path of the file inside the container.
	// Must be an absolute path.
	Path string `protobuf:"bytes,4,opt,name=path" json:"path,omitempty"`
	// REQUIRED
	//
	// Type of the file, FILE or DIRECTORY
	Type FileType `protobuf:"varint,5,opt,name=type,enum=tes.FileType" json:"type,omitempty"`
	// OPTIONAL
	//
	// File content literal.
	// Implementations should support a minimum of 128 KiB in this field and may define its own maximum.
	// UTF-8 encoded
	//
	// If content is not empty, "url" must be ignored.
	Content string `protobuf:"bytes,6,opt,name=content" json:"content,omitempty"`
}

Input describes Task input files.

func (*Input) Descriptor

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

func (*Input) GetContent

func (m *Input) GetContent() string

func (*Input) GetDescription

func (m *Input) GetDescription() string

func (*Input) GetName

func (m *Input) GetName() string

func (*Input) GetPath

func (m *Input) GetPath() string

func (*Input) GetType

func (m *Input) GetType() FileType

func (*Input) GetUrl

func (m *Input) GetUrl() string

func (*Input) ProtoMessage

func (*Input) ProtoMessage()

func (*Input) Reset

func (m *Input) Reset()

func (*Input) String

func (m *Input) String() string

type ListTasksRequest

type ListTasksRequest struct {
	// OPTIONAL
	//
	// Filter the list to include tasks where the name matches this prefix.
	// If unspecified, no task name filtering is done.
	NamePrefix string `protobuf:"bytes,2,opt,name=name_prefix,json=namePrefix" json:"name_prefix,omitempty"`
	// OPTIONAL
	//
	// Number of tasks to return in one page.
	// Must be less than 2048. Defaults to 256.
	PageSize uint32 `protobuf:"varint,3,opt,name=page_size,json=pageSize" json:"page_size,omitempty"`
	// OPTIONAL
	//
	// Page token is used to retrieve the next page of results.
	// If unspecified, returns the first page of results.
	// See ListTasksResponse.next_page_token
	PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"`
	// OPTIONAL
	//
	// Affects the fields included in the returned Task messages.
	// See TaskView below.
	View TaskView `protobuf:"varint,5,opt,name=view,enum=tes.TaskView" json:"view,omitempty"`
}

ListTasksRequest describes a request to the ListTasks service endpoint.

func (*ListTasksRequest) Descriptor

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

func (*ListTasksRequest) GetNamePrefix

func (m *ListTasksRequest) GetNamePrefix() string

func (*ListTasksRequest) GetPageSize

func (m *ListTasksRequest) GetPageSize() uint32

func (*ListTasksRequest) GetPageToken

func (m *ListTasksRequest) GetPageToken() string

func (*ListTasksRequest) GetView

func (m *ListTasksRequest) GetView() TaskView

func (*ListTasksRequest) ProtoMessage

func (*ListTasksRequest) ProtoMessage()

func (*ListTasksRequest) Reset

func (m *ListTasksRequest) Reset()

func (*ListTasksRequest) String

func (m *ListTasksRequest) String() string

type ListTasksResponse

type ListTasksResponse struct {
	// REQUIRED
	//
	// List of tasks.
	Tasks []*Task `protobuf:"bytes,1,rep,name=tasks" json:"tasks,omitempty"`
	// OPTIONAL
	//
	// Token used to return the next page of results.
	// See TaskListRequest.next_page_token
	NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"`
}

OUTPUT ONLY

ListTasksResponse describes a response from the ListTasks endpoint.

func (*ListTasksResponse) Descriptor

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

func (*ListTasksResponse) GetNextPageToken

func (m *ListTasksResponse) GetNextPageToken() string

func (*ListTasksResponse) GetTasks

func (m *ListTasksResponse) GetTasks() []*Task

func (*ListTasksResponse) ProtoMessage

func (*ListTasksResponse) ProtoMessage()

func (*ListTasksResponse) Reset

func (m *ListTasksResponse) Reset()

func (*ListTasksResponse) String

func (m *ListTasksResponse) String() string

type Output

type Output struct {
	// OPTIONAL
	Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	// OPTIONAL
	Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"`
	// REQUIRED
	//
	// URL in long term storage, for example:
	// s3://my-object-store/file1
	// gs://my-bucket/file2
	// file:///path/to/my/file
	// /path/to/my/file
	// etc...
	Url string `protobuf:"bytes,3,opt,name=url" json:"url,omitempty"`
	// REQUIRED
	//
	// Path of the file inside the container.
	// Must be an absolute path.
	Path string `protobuf:"bytes,4,opt,name=path" json:"path,omitempty"`
	// REQUIRED
	//
	// Type of the file, FILE or DIRECTORY
	Type FileType `protobuf:"varint,5,opt,name=type,enum=tes.FileType" json:"type,omitempty"`
}

Output describes Task output files.

func (*Output) Descriptor

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

func (*Output) GetDescription

func (m *Output) GetDescription() string

func (*Output) GetName

func (m *Output) GetName() string

func (*Output) GetPath

func (m *Output) GetPath() string

func (*Output) GetType

func (m *Output) GetType() FileType

func (*Output) GetUrl

func (m *Output) GetUrl() string

func (*Output) ProtoMessage

func (*Output) ProtoMessage()

func (*Output) Reset

func (m *Output) Reset()

func (*Output) String

func (m *Output) String() string

type OutputFileLog

type OutputFileLog struct {
	// REQUIRED
	//
	// URL of the file in storage, e.g. s3://bucket/file.txt
	Url string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"`
	// REQUIRED
	//
	// Path of the file inside the container. Must be an absolute path.
	Path string `protobuf:"bytes,2,opt,name=path" json:"path,omitempty"`
	// REQUIRED
	//
	// Size of the file in bytes.
	SizeBytes int64 `protobuf:"varint,3,opt,name=size_bytes,json=sizeBytes" json:"size_bytes,omitempty"`
}

OUTPUT ONLY

OutputFileLog describes a single output file. This describes file details after the task has completed successfully, for logging purposes.

func (*OutputFileLog) Descriptor

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

func (*OutputFileLog) GetPath

func (m *OutputFileLog) GetPath() string

func (*OutputFileLog) GetSizeBytes

func (m *OutputFileLog) GetSizeBytes() int64

func (*OutputFileLog) GetUrl

func (m *OutputFileLog) GetUrl() string

func (*OutputFileLog) ProtoMessage

func (*OutputFileLog) ProtoMessage()

func (*OutputFileLog) Reset

func (m *OutputFileLog) Reset()

func (*OutputFileLog) String

func (m *OutputFileLog) String() string

type Resources

type Resources struct {
	// OPTIONAL
	//
	// Requested number of CPUs
	CpuCores uint32 `protobuf:"varint,1,opt,name=cpu_cores,json=cpuCores" json:"cpu_cores,omitempty"`
	// OPTIONAL
	//
	// Is the task allowed to run on preemptible compute instances (e.g. AWS Spot)?
	Preemptible bool `protobuf:"varint,2,opt,name=preemptible" json:"preemptible,omitempty"`
	// OPTIONAL
	//
	// Requested RAM required in gigabytes (GB)
	RamGb float64 `protobuf:"fixed64,3,opt,name=ram_gb,json=ramGb" json:"ram_gb,omitempty"`
	// OPTIONAL
	//
	// Requested disk size in gigabytes (GB)
	DiskGb float64 `protobuf:"fixed64,4,opt,name=disk_gb,json=diskGb" json:"disk_gb,omitempty"`
	// OPTIONAL
	//
	// Request that the task be run in these compute zones.
	Zones []string `protobuf:"bytes,5,rep,name=zones" json:"zones,omitempty"`
}

Resources describes the resources requested by a task.

func (*Resources) Descriptor

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

func (*Resources) GetCpuCores

func (m *Resources) GetCpuCores() uint32

func (*Resources) GetDiskGb

func (m *Resources) GetDiskGb() float64

func (*Resources) GetPreemptible

func (m *Resources) GetPreemptible() bool

func (*Resources) GetRamGb

func (m *Resources) GetRamGb() float64

func (*Resources) GetZones

func (m *Resources) GetZones() []string

func (*Resources) ProtoMessage

func (*Resources) ProtoMessage()

func (*Resources) Reset

func (m *Resources) Reset()

func (*Resources) String

func (m *Resources) String() string

type ServiceInfo

type ServiceInfo struct {
	// Returns the name of the service, e.g. "ohsu-compbio-funnel".
	Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	// Returns a documentation string, e.g. "Hey, we're OHSU Comp. Bio!".
	Doc string `protobuf:"bytes,2,opt,name=doc" json:"doc,omitempty"`
	// Lists some, but not necessarily all, storage locations supported by the service.
	//
	// Must be in a valid URL format.
	// e.g.
	// file:///path/to/local/funnel-storage
	// s3://ohsu-compbio-funnel/storage
	// etc.
	Storage []string `protobuf:"bytes,3,rep,name=storage" json:"storage,omitempty"`
}

OUTPUT ONLY

ServiceInfo describes information about the service, such as storage details, resource availability, and other documentation.

func (*ServiceInfo) Descriptor

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

func (*ServiceInfo) GetDoc

func (m *ServiceInfo) GetDoc() string

func (*ServiceInfo) GetName

func (m *ServiceInfo) GetName() string

func (*ServiceInfo) GetStorage

func (m *ServiceInfo) GetStorage() []string

func (*ServiceInfo) ProtoMessage

func (*ServiceInfo) ProtoMessage()

func (*ServiceInfo) Reset

func (m *ServiceInfo) Reset()

func (*ServiceInfo) String

func (m *ServiceInfo) String() string

type ServiceInfoRequest

type ServiceInfoRequest struct {
}

ServiceInfoRequest describes a request to the ServiceInfo endpoint.

func (*ServiceInfoRequest) Descriptor

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

func (*ServiceInfoRequest) ProtoMessage

func (*ServiceInfoRequest) ProtoMessage()

func (*ServiceInfoRequest) Reset

func (m *ServiceInfoRequest) Reset()

func (*ServiceInfoRequest) String

func (m *ServiceInfoRequest) String() string

type State

type State int32

OUTPUT ONLY

Task states.

const (
	// The state of the task is unknown.
	//
	// This provides a safe default for messages where this field is missing,
	// for example, so that a missing field does not accidentally imply that
	// the state is QUEUED.
	State_UNKNOWN State = 0
	// The task is queued.
	State_QUEUED State = 1
	// The task has been assigned to a worker and is currently preparing to run.
	// For example, the worker may be turning on, downloading input files, etc.
	State_INITIALIZING State = 2
	// The task is running. Input files are downloaded and the first Executor
	// has been started.
	State_RUNNING State = 3
	// The task is paused.
	//
	// An implementation may have the ability to pause a task, but this is not required.
	State_PAUSED State = 4
	// The task has completed running. Executors have exited without error
	// and output files have been successfully uploaded.
	State_COMPLETE State = 5
	// The task encountered an error in one of the Executor processes. Generally,
	// this means that an Executor exited with a non-zero exit code.
	State_EXECUTOR_ERROR State = 6
	// The task was stopped due to a system error, but not from an Executor,
	// for example an upload failed due to network issues, the worker's ran out
	// of disk space, etc.
	State_SYSTEM_ERROR State = 7
	// The task was canceled by the user.
	State_CANCELED State = 8
)

func (State) EnumDescriptor

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

func (State) String

func (x State) String() string

type Task

type Task struct {
	// OUTPUT ONLY
	//
	// Task identifier assigned by the server.
	Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	// OUTPUT ONLY
	State State `protobuf:"varint,2,opt,name=state,enum=tes.State" json:"state,omitempty"`
	// OPTIONAL
	Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"`
	// OPTIONAL
	Description string `protobuf:"bytes,5,opt,name=description" json:"description,omitempty"`
	// OPTIONAL
	//
	// Input files.
	// Inputs will be downloaded and mounted into the executor container.
	Inputs []*Input `protobuf:"bytes,6,rep,name=inputs" json:"inputs,omitempty"`
	// OPTIONAL
	//
	// Output files.
	// Outputs will be uploaded from the executor container to long-term storage.
	Outputs []*Output `protobuf:"bytes,7,rep,name=outputs" json:"outputs,omitempty"`
	// OPTIONAL
	//
	// Request that the task be run with these resources.
	Resources *Resources `protobuf:"bytes,8,opt,name=resources" json:"resources,omitempty"`
	// REQUIRED
	//
	// A list of executors to be run, sequentially. Execution stops
	// on the first error.
	Executors []*Executor `protobuf:"bytes,9,rep,name=executors" json:"executors,omitempty"`
	// OPTIONAL
	//
	// Volumes are directories which may be used to share data between
	// Executors. Volumes are initialized as empty directories by the
	// system when the task starts and are mounted at the same path
	// in each Executor.
	//
	// For example, given a volume defined at "/vol/A",
	// executor 1 may write a file to "/vol/A/exec1.out.txt", then
	// executor 2 may read from that file.
	//
	// (Essentially, this translates to a `docker run -v` flag where
	// the container path is the same for each executor).
	Volumes []string `protobuf:"bytes,10,rep,name=volumes" json:"volumes,omitempty"`
	// OPTIONAL
	//
	// A key-value map of arbitrary tags.
	Tags map[string]string `` /* 129-byte string literal not displayed */
	// OUTPUT ONLY
	//
	// Task logging information.
	// Normally, this will contain only one entry, but in the case where
	// a task fails and is retried, an entry will be appended to this list.
	Logs []*TaskLog `protobuf:"bytes,12,rep,name=logs" json:"logs,omitempty"`
	// OUTPUT ONLY, REQUIRED
	//
	// Date + time the task was created, in RFC 3339 format.
	// This is set by the system, not the client.
	CreationTime string `protobuf:"bytes,13,opt,name=creation_time,json=creationTime" json:"creation_time,omitempty"`
}

Task describes an instance of a task.

func (*Task) Descriptor

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

func (*Task) GetBasicView

func (task *Task) GetBasicView() *Task

GetBasicView returns the basic view of a task.

func (*Task) GetCreationTime

func (m *Task) GetCreationTime() string

func (*Task) GetDescription

func (m *Task) GetDescription() string

func (*Task) GetExecLog

func (task *Task) GetExecLog(attempt int, i int) *ExecutorLog

GetExecLog gets the executor log entry at the given index "i". If the entry doesn't exist, empty logs will be appended up to "i".

func (*Task) GetExecutors

func (m *Task) GetExecutors() []*Executor

func (*Task) GetId

func (m *Task) GetId() string

func (*Task) GetInputs

func (m *Task) GetInputs() []*Input

func (*Task) GetLogs

func (m *Task) GetLogs() []*TaskLog

func (*Task) GetMinimalView

func (task *Task) GetMinimalView() *Task

GetMinimalView returns the minimal view of a task.

func (*Task) GetName

func (m *Task) GetName() string

func (*Task) GetOutputs

func (m *Task) GetOutputs() []*Output

func (*Task) GetResources

func (m *Task) GetResources() *Resources

func (*Task) GetState

func (m *Task) GetState() State

func (*Task) GetTags

func (m *Task) GetTags() map[string]string

func (*Task) GetTaskLog

func (task *Task) GetTaskLog(i int) *TaskLog

GetTaskLog gets the task log entry at the given index "i". If the entry doesn't exist, empty logs will be appended up to "i".

func (*Task) GetVolumes

func (m *Task) GetVolumes() []string

func (*Task) ProtoMessage

func (*Task) ProtoMessage()

func (*Task) Reset

func (m *Task) Reset()

func (*Task) String

func (m *Task) String() string

type TaskLog

type TaskLog struct {
	// REQUIRED
	//
	// Logs for each executor
	Logs []*ExecutorLog `protobuf:"bytes,1,rep,name=logs" json:"logs,omitempty"`
	// OPTIONAL
	//
	// Arbitrary logging metadata included by the implementation.
	Metadata map[string]string `` /* 136-byte string literal not displayed */
	// OPTIONAL
	//
	// When the task started, in RFC 3339 format.
	StartTime string `protobuf:"bytes,3,opt,name=start_time,json=startTime" json:"start_time,omitempty"`
	// OPTIONAL
	//
	// When the task ended, in RFC 3339 format.
	EndTime string `protobuf:"bytes,4,opt,name=end_time,json=endTime" json:"end_time,omitempty"`
	// REQUIRED
	//
	// Information about all output files. Directory outputs are
	// flattened into separate items.
	Outputs []*OutputFileLog `protobuf:"bytes,5,rep,name=outputs" json:"outputs,omitempty"`
	// OPTIONAL
	//
	// System logs are any logs the system decides are relevant,
	// which are not tied directly to an Executor process.
	// Content is implementation specific: format, size, etc.
	//
	// System logs may be collected here to provide convenient access.
	//
	// For example, the system may include the name of the host
	// where the task is executing, an error message that caused
	// a SYSTEM_ERROR state (e.g. disk is full), etc.
	//
	// System logs are only included in the FULL task view.
	SystemLogs []string `protobuf:"bytes,6,rep,name=system_logs,json=systemLogs" json:"system_logs,omitempty"`
}

OUTPUT ONLY

TaskLog describes logging information related to a Task.

func (*TaskLog) Descriptor

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

func (*TaskLog) GetEndTime

func (m *TaskLog) GetEndTime() string

func (*TaskLog) GetLogs

func (m *TaskLog) GetLogs() []*ExecutorLog

func (*TaskLog) GetMetadata

func (m *TaskLog) GetMetadata() map[string]string

func (*TaskLog) GetOutputs

func (m *TaskLog) GetOutputs() []*OutputFileLog

func (*TaskLog) GetStartTime

func (m *TaskLog) GetStartTime() string

func (*TaskLog) GetSystemLogs

func (m *TaskLog) GetSystemLogs() []string

func (*TaskLog) ProtoMessage

func (*TaskLog) ProtoMessage()

func (*TaskLog) Reset

func (m *TaskLog) Reset()

func (*TaskLog) String

func (m *TaskLog) String() string

type TaskServiceClient

type TaskServiceClient interface {
	// GetServiceInfo provides information about the service,
	// such as storage details, resource availability, and
	// other documentation.
	GetServiceInfo(ctx context.Context, in *ServiceInfoRequest, opts ...grpc.CallOption) (*ServiceInfo, error)
	// Create a new task.
	CreateTask(ctx context.Context, in *Task, opts ...grpc.CallOption) (*CreateTaskResponse, error)
	// List tasks.
	// TaskView is requested as such: "v1/tasks?view=BASIC"
	ListTasks(ctx context.Context, in *ListTasksRequest, opts ...grpc.CallOption) (*ListTasksResponse, error)
	// Get a task.
	// TaskView is requested as such: "v1/tasks/{id}?view=FULL"
	GetTask(ctx context.Context, in *GetTaskRequest, opts ...grpc.CallOption) (*Task, error)
	// Cancel a task.
	CancelTask(ctx context.Context, in *CancelTaskRequest, opts ...grpc.CallOption) (*CancelTaskResponse, error)
}

func NewTaskServiceClient

func NewTaskServiceClient(cc *grpc.ClientConn) TaskServiceClient

type TaskServiceServer

type TaskServiceServer interface {
	// GetServiceInfo provides information about the service,
	// such as storage details, resource availability, and
	// other documentation.
	GetServiceInfo(context.Context, *ServiceInfoRequest) (*ServiceInfo, error)
	// Create a new task.
	CreateTask(context.Context, *Task) (*CreateTaskResponse, error)
	// List tasks.
	// TaskView is requested as such: "v1/tasks?view=BASIC"
	ListTasks(context.Context, *ListTasksRequest) (*ListTasksResponse, error)
	// Get a task.
	// TaskView is requested as such: "v1/tasks/{id}?view=FULL"
	GetTask(context.Context, *GetTaskRequest) (*Task, error)
	// Cancel a task.
	CancelTask(context.Context, *CancelTaskRequest) (*CancelTaskResponse, error)
}

type TaskView

type TaskView int32

TaskView affects the fields returned by the ListTasks endpoint.

Some of the fields in task can be large strings (e.g. logs), which can be a burden on the network. In the default BASIC view, these heavyweight fields are not included, however, a client may request the FULL version to include these fields.

const (
	// Task message will include ONLY the fields:
	//   Task.Id
	//   Task.State
	TaskView_MINIMAL TaskView = 0
	// Task message will include all fields EXCEPT:
	//   Task.ExecutorLog.stdout
	//   Task.ExecutorLog.stderr
	//   Input.content
	//   TaskLog.system_logs
	TaskView_BASIC TaskView = 1
	// Task message includes all fields.
	TaskView_FULL TaskView = 2
)

func (TaskView) EnumDescriptor

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

func (TaskView) String

func (x TaskView) String() string

type ValidationError

type ValidationError []error

ValidationError contains task validation errors.

func Validate

func Validate(t *Task) ValidationError

Validate validates the given task and returns ValidationError, or nil if the task is valid.

func (ValidationError) Error

func (v ValidationError) Error() string

Jump to

Keyboard shortcuts

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