task

package
v0.0.0-...-a69e935 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// PelotonJobIDLabelKey is the task label key for job ID
	PelotonJobIDLabelKey = "peloton.job_id"
	// PelotonInstanceIDLabelKey is the task label key for task instance ID
	PelotonInstanceIDLabelKey = "peloton.instance_id"
	// PelotonTaskIDLabelKey is the task label key for task ID
	PelotonTaskIDLabelKey = "peloton.task_id"
)

Variables

View Source
var (

	// ErrPortMismatch represents port not matching.
	ErrPortMismatch = errors.New("port in launch not in offer")
	// ErrNotEnoughResource means resource is not enough to match given task.
	ErrNotEnoughResource = errors.New("not enough resources left to run task")
	// ErrNotEnoughRevocableResource means revocable resources is not enough to match given task
	ErrNotEnoughRevocableResource = errors.New("not enough revocable resources left to run task")
)

Functions

This section is empty.

Types

type Builder

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

Builder helps to build launchable Mesos TaskInfo from offers and peloton task configs.

func NewBuilder

func NewBuilder(
	resources []*mesos.Resource) *Builder

NewBuilder creates a new instance of Builder, which caller can use to build Mesos tasks from the cached resources.

func (*Builder) Build

func (tb *Builder) Build(
	task *hostsvc.LaunchableTask,
) (*mesos.TaskInfo, error)

Build is used to build a `mesos.TaskInfo` from cached resources. Caller can keep calling this function to build more tasks. This returns error if the current instance does not have enough resources leftover (scalar, port in future), or the taskConfig is not correct.

Jump to

Keyboard shortcuts

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