manager

package
v0.0.0-...-8f169fa Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2015 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SLA_ONE_PER_NODE = "one-per-node"
	SLA_SINGLETON    = "singleton"

	NETWORK_MODE_BRIDGE = "bridge"
	NETWORK_MODE_HOST   = "host"
	NETWORK_MODE_NONE   = "none"
)

Variables

This section is empty.

Functions

func ResetTask

func ResetTask(task *Task)

func UpdateTaskWithDockerInfo

func UpdateTaskWithDockerInfo(task *Task, dockerInspectOutput []byte)

Types

type DockerState

type DockerState struct {
	Pid uint `json:"Pid"`
}

type DockerTask

type DockerTask struct {
	DockerId    string          `json:"Id"`
	DockerName  string          `json:"Name"`
	DockerState json.RawMessage `json:"State"`
}

type Manager

type Manager interface {
	Start() error

	GetListenerIP() string
	GetListenerPortForScheduler() int
	GetListenerPortForRESTApi() int

	GetRedisConnectionIPAndPort() string

	GetTasks() []*Task
	GetNodes() []*Node

	GetOpenTaskRequestsNoSla() []*Task
	ResourceRequirementsWouldMatch(offer *mesosproto.Offer, taskRequest *Task) bool

	GetOpenTaskRequests() []*Task
	GetRunningTasks() []*Task

	SetTaskIntelligence(taskname string, attribute string, value string)
	GetTaskIntelligence(taskname string, attribute string) string

	HandleFrameworkRegistered(frameworkId string)
	HandleResourceOffered(offers []*mesosproto.Offer)
	HandleStatusMessage(statusMessage *mesosproto.StatusUpdateMessage)
	HandleRunDockerImage(task *Task)
	HandleDeleteTask(task *Task)
	HandleReshuffleTasks()

	AcceptOffer(offerId *mesosproto.OfferID, slaveId *mesosproto.SlaveID, task *Task)
	DeclineOffer(offerId *mesosproto.OfferID)
}

type Node

type Node struct {
	ID              string `json:"id"`
	Hostname        string `json:"hostname"`
	NodeType        string `json:"nodetype"`
	NodeName        string `json:"nodename"`
	TimeOfLastOffer int64  `json:"timeoflastoffer"`
}

type Port

type Port struct {
	ContainerPort uint32 `json:"container_port,string"`
	HostPort      uint32 `json:"host_port,string"`
}

type Task

type Task struct {
	ID            string    `json:"id"`
	DockerImage   string    `json:"dockerimage"`
	Mem           uint64    `json:"mem,string"`
	Cpus          float64   `json:"cpus,string"`
	Sla           string    `json:"sla"`
	NodeType      string    `json:"nodetype"`
	NodeName      string    `json:"nodename"`
	NotMetered    bool      `json:"notmetered"`
	Reshuffleable bool      `json:"reshuffleable"`
	Arguments     []string  `json:"arguments,omitempty"`
	Volumes       []*Volume `json:"volumes,omitempty"`
	Ports         []*Port   `json:"ports,omitempty"`
	NetworkMode   string    `json:"networkmode"`

	InternalID  string
	SlaveID     string
	DockerID    string
	DockerName  string
	ProcessID   uint
	CreatedAt   int64
	TaskInfo    *mesosproto.TaskInfo
	RequestSent bool
	Running     bool
}

func CopyTask

func CopyTask(source Task) Task

type Volume

type Volume struct {
	ContainerPath string `json:"container_path"`
	HostPath      string `json:"host_path"`
	Mode          string `json:"mode"` //rw or ro
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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