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 ¶
- Variables
- func BuildResources(r *types.Resource) []*mesos.Resource
- func CanTaskGroupReschedule(taskGroup *types.TaskGroup) bool
- func CanTaskGroupShutdown(taskGroup *types.TaskGroup) bool
- func CheckVersion(version *types.Version, store store.Store) error
- func CreateBcsExecutorInfo(offer *mesos.Offer, taskGroupID *string, version *types.Version, ...) (*mesos.ExecutorInfo, error)
- func CreateTaskGroup(version *types.Version, ID string, appInstances uint64, appClusterID string, ...) (*types.TaskGroup, error)
- func CreateTaskGroupInfo(offer *mesos.Offer, version *types.Version, resources []*mesos.Resource, ...) *mesos.TaskGroupInfo
- func GetTaskGroupID(taskGroupInfo *mesos.TaskGroupInfo) *string
- func GetVersionRequestIpCount(version *types.Version) int
- func InitExecutorInfo(CExec, PExec, CniDir, netImage string)
- func IsTaskGroupEnd(taskGroup *types.TaskGroup) bool
- func ReBuildTaskGroupID(taskGroupID string) (string, error)
Constants ¶
This section is empty.
Variables ¶
var BcsCniDir string
BcsCniDir default bcs cni plugin directory
var BcsContainerExecutorPath string
BcsContainerExecutorPath default container binary path
var BcsProcessExecutorPath string
BcsProcessExecutorPath default process binary path
var NetImage string
NetImage default network image information
var Passwd = static.BcsDefaultPasswd
Passwd registry pass
var User = static.BcsDefaultUser
User registry user
Functions ¶
func BuildResources ¶
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 ¶
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 ¶
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.