Documentation ¶
Index ¶
- Constants
- func NewBcsExecutor(flag *CommandFlags) exec.Executor
- func Run(cmd *CommandFlags) error
- type BcsExecutor
- func (executor *BcsExecutor) Disconnected(driver exec.ExecutorDriver)
- func (executor *BcsExecutor) Error(driver exec.ExecutorDriver, err string)
- func (executor *BcsExecutor) FrameworkMessage(driver exec.ExecutorDriver, msg string)
- func (executor *BcsExecutor) KillTask(driver exec.ExecutorDriver, taskID *mesos.TaskID)
- func (executor *BcsExecutor) LaunchTask(driver exec.ExecutorDriver, taskInfo *mesos.TaskInfo)
- func (executor *BcsExecutor) LaunchTaskGroup(driver exec.ExecutorDriver, taskGroup *mesos.TaskGroupInfo)
- func (executor *BcsExecutor) Registered(driver exec.ExecutorDriver, execInfo *mesos.ExecutorInfo, ...)
- func (executor *BcsExecutor) Reregistered(driver exec.ExecutorDriver, slaveInfo *mesos.AgentInfo)
- func (executor *BcsExecutor) SetDriver(driver exec.ExecutorDriver)
- func (executor *BcsExecutor) Shutdown(driver exec.ExecutorDriver)
- func (executor *BcsExecutor) Stop()
- type BcsTaskInfo
- func (bcsTask *BcsTaskInfo) Clean()
- func (bcsTask *BcsTaskInfo) CleanContainer(containerID string) (*mesos.TaskInfo, *container.BcsContainerInfo)
- func (bcsTask *BcsTaskInfo) CleanTask(taskID string) (*mesos.TaskInfo, *container.BcsContainerInfo)
- func (bcsTask *BcsTaskInfo) GetAllContainerID() (list []string)
- func (bcsTask *BcsTaskInfo) GetContainer(containerID string) *container.BcsContainerInfo
- func (bcsTask *BcsTaskInfo) GetContainerByTaskID(taskID string) *container.BcsContainerInfo
- func (bcsTask *BcsTaskInfo) GetTask(taskID string) *mesos.TaskInfo
- func (bcsTask *BcsTaskInfo) GetTaskByContainerID(containerID string) *mesos.TaskInfo
- func (bcsTask *BcsTaskInfo) GetTaskGroup() *mesos.TaskGroupInfo
- func (bcsTask *BcsTaskInfo) SetContainerWithTaskID(taskID string, container *container.BcsContainerInfo) error
- func (bcsTask *BcsTaskInfo) SetTaskInfo(task *mesos.TaskInfo) error
- type CommandFlags
Constants ¶
const ( // ContainerNamePrefix docker container name prefix ContainerNamePrefix = "bcs-container-" // ContainerCoreFilePrefix container corefile directory ContainerCoreFilePrefix = "/data/corefile" // ExecutorStatus_NOTRUNNING not running state ExecutorStatus_NOTRUNNING = "NotRunning" // ExecutorStatus_LAUNCHING launching state ExecutorStatus_LAUNCHING = "Launching" // ExecutorStatus_RUNNING running state ExecutorStatus_RUNNING = "Running" // ExecutorStatus_KILLING killing state ExecutorStatus_KILLING = "Killing" // ExecutorStatus_SHUTDOWN shutdown state ExecutorStatus_SHUTDOWN = "Shutdown" )
const ContainerCheckTicker = 1
ContainerCheckTicker duration for checking Running Container Status
const (
//DefaultCNIDirectory defualt cni directory
DefaultCNIDirectory = "/data/bcs/bcs-cni"
)
Variables ¶
This section is empty.
Functions ¶
func NewBcsExecutor ¶
func NewBcsExecutor(flag *CommandFlags) exec.Executor
NewBcsExecutor create Executor instance
Types ¶
type BcsExecutor ¶
type BcsExecutor struct {
// contains filtered or unexported fields
}
BcsExecutor implement interface MesosContainerExecutor
func (*BcsExecutor) Disconnected ¶
func (executor *BcsExecutor) Disconnected(driver exec.ExecutorDriver)
Disconnected call by ExecutorDriver if cnnection to mesos slave broken
func (*BcsExecutor) Error ¶
func (executor *BcsExecutor) Error(driver exec.ExecutorDriver, err string)
Error Executor receiving Error message from mesos slave.
func (*BcsExecutor) FrameworkMessage ¶
func (executor *BcsExecutor) FrameworkMessage(driver exec.ExecutorDriver, msg string)
FrameworkMessage receiving message from scheduler framework
func (*BcsExecutor) KillTask ¶
func (executor *BcsExecutor) KillTask(driver exec.ExecutorDriver, taskID *mesos.TaskID)
KillTask kill task by taskId
func (*BcsExecutor) LaunchTask ¶
func (executor *BcsExecutor) LaunchTask(driver exec.ExecutorDriver, taskInfo *mesos.TaskInfo)
LaunchTask launch a task, create taskgroup for this TaskInfo all launchTask request will be handled by LaunchTaskGroup
func (*BcsExecutor) LaunchTaskGroup ¶
func (executor *BcsExecutor) LaunchTaskGroup(driver exec.ExecutorDriver, taskGroup *mesos.TaskGroupInfo)
LaunchTaskGroup Invoked when a task has been launched on this executor (initiated via SchedulerDriver.LaunchTasks). Note that this task can be realized with a goroutine, an external process, or some simple computation, however, no other callbacks will be invoked on this executor until this callback has returned.
func (*BcsExecutor) Registered ¶
func (executor *BcsExecutor) Registered(driver exec.ExecutorDriver, execInfo *mesos.ExecutorInfo, fwinfo *mesos.FrameworkInfo, slaveInfo *mesos.AgentInfo)
Registered call by ExecutorDriver when receiving Subscribed from mesos slave
func (*BcsExecutor) Reregistered ¶
func (executor *BcsExecutor) Reregistered(driver exec.ExecutorDriver, slaveInfo *mesos.AgentInfo)
Reregistered call by ExecutorDriver when receiving Subscribed from mesos slave
func (*BcsExecutor) SetDriver ¶
func (executor *BcsExecutor) SetDriver(driver exec.ExecutorDriver)
SetDriver driver injection
func (*BcsExecutor) Shutdown ¶
func (executor *BcsExecutor) Shutdown(driver exec.ExecutorDriver)
Shutdown Executor Shutdown & exit
type BcsTaskInfo ¶
type BcsTaskInfo struct { ContainerRef map[string]string //ContainerName to TaskID TaskRef map[string]string //TaskID to ContainerName TaskInfo map[string]*mesos.TaskInfo //mesos task info, key is taskID ContainerInfo map[string]*container.BcsContainerInfo //BcsContainerInfo, key is containerName // contains filtered or unexported fields }
BcsTaskInfo task info relate to Mesos TaskGroupInfo & ContainerInfo we not only can find TaskInfo by containerID, but also can find ContainerInfo by TaskID
func (*BcsTaskInfo) CleanContainer ¶
func (bcsTask *BcsTaskInfo) CleanContainer(containerID string) (*mesos.TaskInfo, *container.BcsContainerInfo)
CleanContainer clean task & container by containerID
func (*BcsTaskInfo) CleanTask ¶
func (bcsTask *BcsTaskInfo) CleanTask(taskID string) (*mesos.TaskInfo, *container.BcsContainerInfo)
CleanTask clean task & container by taskID
func (*BcsTaskInfo) GetAllContainerID ¶
func (bcsTask *BcsTaskInfo) GetAllContainerID() (list []string)
GetAllContainerID return all containerID
func (*BcsTaskInfo) GetContainer ¶
func (bcsTask *BcsTaskInfo) GetContainer(containerID string) *container.BcsContainerInfo
GetContainer get BcsContainer by containerId
func (*BcsTaskInfo) GetContainerByTaskID ¶
func (bcsTask *BcsTaskInfo) GetContainerByTaskID(taskID string) *container.BcsContainerInfo
GetContainerByTaskID get container
func (*BcsTaskInfo) GetTask ¶
func (bcsTask *BcsTaskInfo) GetTask(taskID string) *mesos.TaskInfo
GetTask get TaskInfo by taskId
func (*BcsTaskInfo) GetTaskByContainerID ¶
func (bcsTask *BcsTaskInfo) GetTaskByContainerID(containerID string) *mesos.TaskInfo
GetTaskByContainerID get container
func (*BcsTaskInfo) GetTaskGroup ¶
func (bcsTask *BcsTaskInfo) GetTaskGroup() *mesos.TaskGroupInfo
GetTaskGroup return task group
func (*BcsTaskInfo) SetContainerWithTaskID ¶
func (bcsTask *BcsTaskInfo) SetContainerWithTaskID(taskID string, container *container.BcsContainerInfo) error
SetContainerWithTaskID setting container with taskID.
func (*BcsTaskInfo) SetTaskInfo ¶
func (bcsTask *BcsTaskInfo) SetTaskInfo(task *mesos.TaskInfo) error
SetTaskInfo Set TaskInfo
type CommandFlags ¶
type CommandFlags struct { User string //user for authentication Passwd string //password for authentication DockerSocket string //docker socket path MappedDirectory string //The sandbox directory path that is mapped in the docker container. NetworkMode string //mode for cni/cnm CNIPluginDir string //cni plugin directory, $CNIPluginDir/bin for binary, $CNIPluginDir/conf for configuration NetworkImage string //cni network images }
CommandFlags hold all command line flags from mesos-slave
func NewCommandFlags ¶
func NewCommandFlags() *CommandFlags
NewCommandFlags return new DockerFalgs with default value