tes

package module
v0.0.0-...-9be943b Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2018 License: MIT Imports: 14 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

Index

Constants

View Source
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

View Source
const (
	Minimal = TaskView_MINIMAL
	Basic   = TaskView_BASIC
	Full    = TaskView_FULL
)

View constants for convenience

Variables

View Source
var ErrNotFound = fmt.Errorf("task not found")
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 MarshalToString

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

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

func NewClient(address string) (*Client, error)

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

func (c *Client) CreateTask(ctx context.Context, task *Task) (*CreateTaskResponse, error)

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) GetTask

func (c *Client) GetTask(ctx context.Context, req *GetTaskRequest) (*Task, error)

GetTask returns the raw bytes from GET /v1/tasks/{id}

func (*Client) ListTasks

func (c *Client) ListTasks(ctx context.Context, req *ListTasksRequest) (*ListTasksResponse, error)

ListTasks returns the result of GET /v1/tasks

func (*Client) WaitForTask

func (c *Client) WaitForTask(ctx context.Context, taskIDs ...string) error

WaitForTask polls /v1/tasks/{id} for each Id provided and returns once all tasks are in a terminal state.

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) 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) Active

func (s State) Active() bool

Active returns true if the state is any of the active states:

queued, initializing, running

func (State) EnumDescriptor

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

func (State) Final

func (s State) Final() bool

Final returns true if the state is any of the final states:

complete, executor error, system error, canceled

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) MarshalJSON

func (task *Task) MarshalJSON() ([]byte, error)

func (*Task) ProtoMessage

func (*Task) ProtoMessage()

func (*Task) Reset

func (m *Task) Reset()

func (*Task) String

func (m *Task) String() string

func (*Task) UnmarshalJSON

func (task *Task) UnmarshalJSON(b []byte) error

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 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