task

package
v1.19.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 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
View Source
var BcsContainerExecutorPath string
View Source
var BcsProcessExecutorPath string
View Source
var NetImage string

Functions

func BuildResources

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

Build mesos resource format

func CanTaskGroupReschedule

func CanTaskGroupReschedule(taskGroup *types.TaskGroup) bool

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

Check whether the version definition is correct

func CreateBcsExecutorInfo

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

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)

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

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

func GetTaskGroupID

func GetTaskGroupID(taskGroupInfo *mesos.TaskGroupInfo) *string

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)

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)

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