task

package
v1.20.11 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package task provides task related implements. Function CreateTaskGroup and CreateTaskGroupInfo are used to build taskgroup's information from version and offer Other functions are mostly used to judge status of taskgroups

Index

Constants

This section is empty.

Variables

View Source
var BcsCniDir string

BcsCniDir default bcs cni plugin directory

View Source
var BcsContainerExecutorPath string

BcsContainerExecutorPath default container binary path

View Source
var BcsProcessExecutorPath string

BcsProcessExecutorPath default process binary path

View Source
var NetImage string

NetImage default network image information

Passwd registry pass

User registry user

Functions

func BuildResources

func BuildResources(r *types.Resource) []*mesos.Resource

BuildResources Build mesos resource format

func CanTaskGroupReschedule

func CanTaskGroupReschedule(taskGroup *types.TaskGroup) bool

CanTaskGroupReschedule Whether an taskgroup can be rescheduled currently

func CanTaskGroupShutdown

func CanTaskGroupShutdown(taskGroup *types.TaskGroup) bool

CanTaskGroupShutdown Whether an taskgroup can be shutdown currently

func CheckVersion

func CheckVersion(version *types.Version, store store.Store) error

CheckVersion Check whether the version definition is correct

func CreateBcsExecutorInfo

func CreateBcsExecutorInfo(offer *mesos.Offer, taskGroupID *string,
	version *types.Version, store store.Store) (*mesos.ExecutorInfo, error)

CreateBcsExecutorInfo special the bcs executor

func CreateTaskGroup

func CreateTaskGroup(version *types.Version, ID string, appInstances uint64, appClusterID string, reason string, store store.Store) (*types.TaskGroup, error)

CreateTaskGroup Create a taskgroup for an application, there are two methods to create a taskgroup: 1: you can create a taskgroup with the input of version(application definition), ID(taskgroup ID), reason and store 2: you can create a taskgroup with the input of version(application definition), appInstances, appClusterID, reason and store. taskgroup ID will be appInstances.$appname(version).$namespace(version).appClusterID.$timestamp

func CreateTaskGroupInfo

func CreateTaskGroupInfo(offer *mesos.Offer, version *types.Version, resources []*mesos.Resource, taskgroup *types.TaskGroup) *mesos.TaskGroupInfo

CreateTaskGroupInfo Create taskgroup information with offered resource, the information include: ports, slave attributions, health-check information etc.

func GetTaskGroupID

func GetTaskGroupID(taskGroupInfo *mesos.TaskGroupInfo) *string

GetTaskGroupID get taskgroup id from mesos information

func GetVersionRequestIpCount

func GetVersionRequestIpCount(version *types.Version) int

GetVersionRequestIpCount Get reserve IP number in version definition

func InitExecutorInfo

func InitExecutorInfo(CExec, PExec, CniDir, netImage string)

InitExecutorInfo init mesos executor info

func IsTaskGroupEnd

func IsTaskGroupEnd(taskGroup *types.TaskGroup) bool

IsTaskGroupEnd Whether an taskgroup is in ending statuses

func ReBuildTaskGroupID

func ReBuildTaskGroupID(taskGroupID string) (string, error)

ReBuildTaskGroupID Build a new taskgroup ID from an old grouptask ID: the ID format is index.application.namespace.cluster.timestamp The new ID is different from old ID in timestamp.

Types

This section is empty.

Jump to

Keyboard shortcuts

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