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
Index ¶
- Constants
- Variables
- func MarshalToString(t *Task) (string, error)
- type CancelTaskRequest
- type CancelTaskResponse
- type Client
- func (c *Client) CancelTask(ctx context.Context, req *CancelTaskRequest) (*CancelTaskResponse, error)
- func (c *Client) CreateTask(ctx context.Context, task *Task) (*CreateTaskResponse, error)
- func (c *Client) GetServiceInfo(ctx context.Context, req *ServiceInfoRequest) (*ServiceInfo, error)
- func (c *Client) GetTask(ctx context.Context, req *GetTaskRequest) (*Task, error)
- func (c *Client) ListTasks(ctx context.Context, req *ListTasksRequest) (*ListTasksResponse, error)
- func (c *Client) WaitForTask(ctx context.Context, taskIDs ...string) error
- type CreateTaskResponse
- type Executor
- func (*Executor) Descriptor() ([]byte, []int)
- func (m *Executor) GetCommand() []string
- func (m *Executor) GetEnv() map[string]string
- func (m *Executor) GetImage() string
- func (m *Executor) GetStderr() string
- func (m *Executor) GetStdin() string
- func (m *Executor) GetStdout() string
- func (m *Executor) GetWorkdir() string
- func (*Executor) ProtoMessage()
- func (m *Executor) Reset()
- func (m *Executor) String() string
- type ExecutorLog
- func (*ExecutorLog) Descriptor() ([]byte, []int)
- func (m *ExecutorLog) GetEndTime() string
- func (m *ExecutorLog) GetExitCode() int32
- func (m *ExecutorLog) GetStartTime() string
- func (m *ExecutorLog) GetStderr() string
- func (m *ExecutorLog) GetStdout() string
- func (*ExecutorLog) ProtoMessage()
- func (m *ExecutorLog) Reset()
- func (m *ExecutorLog) String() string
- type FileType
- type GetTaskRequest
- type Input
- func (*Input) Descriptor() ([]byte, []int)
- func (m *Input) GetContent() string
- func (m *Input) GetDescription() string
- func (m *Input) GetName() string
- func (m *Input) GetPath() string
- func (m *Input) GetType() FileType
- func (m *Input) GetUrl() string
- func (*Input) ProtoMessage()
- func (m *Input) Reset()
- func (m *Input) String() string
- type ListTasksRequest
- func (*ListTasksRequest) Descriptor() ([]byte, []int)
- func (m *ListTasksRequest) GetNamePrefix() string
- func (m *ListTasksRequest) GetPageSize() uint32
- func (m *ListTasksRequest) GetPageToken() string
- func (m *ListTasksRequest) GetView() TaskView
- func (*ListTasksRequest) ProtoMessage()
- func (m *ListTasksRequest) Reset()
- func (m *ListTasksRequest) String() string
- type ListTasksResponse
- type Output
- func (*Output) Descriptor() ([]byte, []int)
- func (m *Output) GetDescription() string
- func (m *Output) GetName() string
- func (m *Output) GetPath() string
- func (m *Output) GetType() FileType
- func (m *Output) GetUrl() string
- func (*Output) ProtoMessage()
- func (m *Output) Reset()
- func (m *Output) String() string
- type OutputFileLog
- type Resources
- func (*Resources) Descriptor() ([]byte, []int)
- func (m *Resources) GetCpuCores() uint32
- func (m *Resources) GetDiskGb() float64
- func (m *Resources) GetPreemptible() bool
- func (m *Resources) GetRamGb() float64
- func (m *Resources) GetZones() []string
- func (*Resources) ProtoMessage()
- func (m *Resources) Reset()
- func (m *Resources) String() string
- type ServiceInfo
- type ServiceInfoRequest
- type State
- type Task
- func (*Task) Descriptor() ([]byte, []int)
- func (task *Task) GetBasicView() *Task
- func (m *Task) GetCreationTime() string
- func (m *Task) GetDescription() string
- func (task *Task) GetExecLog(attempt int, i int) *ExecutorLog
- func (m *Task) GetExecutors() []*Executor
- func (m *Task) GetId() string
- func (m *Task) GetInputs() []*Input
- func (m *Task) GetLogs() []*TaskLog
- func (task *Task) GetMinimalView() *Task
- func (m *Task) GetName() string
- func (m *Task) GetOutputs() []*Output
- func (m *Task) GetResources() *Resources
- func (m *Task) GetState() State
- func (m *Task) GetTags() map[string]string
- func (task *Task) GetTaskLog(i int) *TaskLog
- func (m *Task) GetVolumes() []string
- func (task *Task) MarshalJSON() ([]byte, error)
- func (*Task) ProtoMessage()
- func (m *Task) Reset()
- func (m *Task) String() string
- func (task *Task) UnmarshalJSON(b []byte) error
- type TaskLog
- func (*TaskLog) Descriptor() ([]byte, []int)
- func (m *TaskLog) GetEndTime() string
- func (m *TaskLog) GetLogs() []*ExecutorLog
- func (m *TaskLog) GetMetadata() map[string]string
- func (m *TaskLog) GetOutputs() []*OutputFileLog
- func (m *TaskLog) GetStartTime() string
- func (m *TaskLog) GetSystemLogs() []string
- func (*TaskLog) ProtoMessage()
- func (m *TaskLog) Reset()
- func (m *TaskLog) String() string
- type TaskView
- type ValidationError
Constants ¶
const ( Unknown = State_UNKNOWN Queued = State_QUEUED Initializing = State_INITIALIZING Running = State_RUNNING Paused = State_PAUSED Complete = State_COMPLETE ExecutorError = State_EXECUTOR_ERROR SystemError = State_SYSTEM_ERROR Canceled = State_CANCELED )
State constants for convenience
const ( Minimal = TaskView_MINIMAL Basic = TaskView_BASIC Full = TaskView_FULL )
View constants for convenience
Variables ¶
var ErrNotFound = fmt.Errorf("task not found")
var FileType_name = map[int32]string{
0: "FILE",
1: "DIRECTORY",
}
var FileType_value = map[string]int32{
"FILE": 0,
"DIRECTORY": 1,
}
var Marshaler = jsonpb.Marshaler{
Indent: " ",
}
Marshaler marshals tasks to indented JSON.
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",
}
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,
}
var TaskView_name = map[int32]string{
0: "MINIMAL",
1: "BASIC",
2: "FULL",
}
var TaskView_value = map[string]int32{
"MINIMAL": 0,
"BASIC": 1,
"FULL": 2,
}
Functions ¶
func MarshalToString ¶
MarshalToString marshals a task to an indented JSON string.
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 Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents the HTTP Task client.
func NewClient ¶
NewClient returns a new HTTP client for accessing Create/List/Get/Cancel Task endpoints. "address" is the address of the TES server.
func (*Client) CancelTask ¶
func (c *Client) CancelTask(ctx context.Context, req *CancelTaskRequest) (*CancelTaskResponse, error)
CancelTask POSTs to /v1/tasks/{id}:cancel
func (*Client) CreateTask ¶
CreateTask POSTs a Task message to /v1/tasks
func (*Client) GetServiceInfo ¶
func (c *Client) GetServiceInfo(ctx context.Context, req *ServiceInfoRequest) (*ServiceInfo, error)
GetServiceInfo returns result of GET /v1/tasks/service-info
func (*Client) ListTasks ¶
func (c *Client) ListTasks(ctx context.Context, req *ListTasksRequest) (*ListTasksResponse, error)
ListTasks returns the result of GET /v1/tasks
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 // // Environment 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) GetCommand ¶
func (*Executor) GetWorkdir ¶
func (*Executor) ProtoMessage ¶
func (*Executor) ProtoMessage()
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 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) GetContent ¶
func (*Input) GetDescription ¶
func (*Input) ProtoMessage ¶
func (*Input) ProtoMessage()
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) GetDescription ¶
func (*Output) ProtoMessage ¶
func (*Output) ProtoMessage()
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) GetCpuCores ¶
func (*Resources) GetPreemptible ¶
func (*Resources) ProtoMessage ¶
func (*Resources) ProtoMessage()
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) Active ¶
Active returns true if the state is any of the active states:
queued, initializing, running
func (State) EnumDescriptor ¶
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) GetBasicView ¶
GetBasicView returns the basic view of a task.
func (*Task) GetCreationTime ¶
func (*Task) GetDescription ¶
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 (*Task) GetMinimalView ¶
GetMinimalView returns the minimal view of a task.
func (*Task) GetOutputs ¶
func (*Task) GetResources ¶
func (*Task) GetTaskLog ¶
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 (*Task) MarshalJSON ¶
func (*Task) ProtoMessage ¶
func (*Task) ProtoMessage()
func (*Task) UnmarshalJSON ¶
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) GetEndTime ¶
func (*TaskLog) GetLogs ¶
func (m *TaskLog) GetLogs() []*ExecutorLog
func (*TaskLog) GetMetadata ¶
func (*TaskLog) GetOutputs ¶
func (m *TaskLog) GetOutputs() []*OutputFileLog
func (*TaskLog) GetStartTime ¶
func (*TaskLog) GetSystemLogs ¶
func (*TaskLog) ProtoMessage ¶
func (*TaskLog) ProtoMessage()
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 ¶
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