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
- 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
var BcsContainerExecutorPath string
var BcsProcessExecutorPath string
var NetImage string
var Passwd = static.BcsDefaultPasswd
var User = static.BcsDefaultUser
Functions ¶
func BuildResources ¶
Build mesos resource format
func CanTaskGroupReschedule ¶
Whether an taskgroup can be rescheduled currently
func CanTaskGroupShutdown ¶
CanTaskGroupShutdown Whether an taskgroup can be shutdown currently
func 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
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 ¶
GetVersionRequestIpCount Get reserve IP number in version definition
func InitExecutorInfo ¶
func InitExecutorInfo(CExec, PExec, CniDir, netImage string)
init mesos executor info
func IsTaskGroupEnd ¶
IsTaskGroupEnd Whether an taskgroup is in ending statuses
func 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.