Documentation
¶
Index ¶
- Constants
- Variables
- func CheckContainer(containerId string, healthCheck bool) (types.ContainerStatusDetails, types.HealthStatus, bool, int, error)
- func CheckPodExitCode(files []string) (int, error)
- func DockerDump()
- func EndStep(stepData map[string][]*types.StepData, stepName string, ...)
- func ForceKill(files []string) error
- func GenerateCmdParts(files []string, cmd string) ([]string, error)
- func GetAndRemoveLabel(key string, taskInfo *mesos.TaskInfo) string
- func GetContainerIdByService(files []string, service string) (string, error)
- func GetContainerIdsByServices(files, services []string) ([]string, error)
- func GetContainerNetwork(id string) (string, error)
- func GetDockerPorts(containerId string, privatePort string) (string, error)
- func GetLabel(key string, taskInfo *mesos.TaskInfo) string
- func GetPodContainerIds(files []string) ([]string, error)
- func GetPodDetail(files []string, primaryContainerId string, healthcheck bool)
- func GetPodStatus() types.PodStatus
- func GetPorts(taskInfo *mesos.TaskInfo) *list.Element
- func GetServiceDetail() types.ServiceDetail
- func HealthCheck(files []string, podServices map[string]bool, out chan<- string)
- func InspectContainerDetails(containerId string, healthcheck bool) (types.ContainerStatusDetails, error)
- func IsService(taskInfo *mesos.TaskInfo) bool
- func KillContainer(sig string, containerId string) error
- func LaunchPod(files []string) (types.PodStatus, error)
- func ListenOnTaskStatus(driver executor.ExecutorDriver, taskInfo *mesos.TaskInfo)
- func ParseToContainerDetail(output string, healthcheck bool) (types.ContainerStatusDetails, error)
- func PluginPanicHandler(condition ConditionFunc) (res string, err error)
- func PrintInspectDetail(containerId string) error
- func PullImage(files []string) error
- func RemoveNetwork(name string) error
- func RemovePodImage(files []string) error
- func RemovePodVolume(files []string) error
- func SendMesosStatus(ctx context.Context, driver executor.ExecutorDriver, taskId *mesos.TaskID, ...) error
- func SendPodStatus(ctx context.Context, status types.PodStatus)
- func SetPodStatus(status types.PodStatus)
- func SetServiceDetail(sd types.ServiceDetail)
- func StartStep(stepData map[string][]*types.StepData, stepName string)
- func StopPod(ctx context.Context, files []string) error
- func ToHealthStatus(s string) types.HealthStatus
- func ToPodStatus(s string) types.PodStatus
- func ValidateCompose(files []string) error
- func WaitOnPod(ctx context.Context)
- type ConditionFunc
- type Status
- type TaskStatus
Constants ¶
const ( OUTPUT_DELIMITER = "," PORT_SEPARATOR = ":" PRIM_INSPECT_RESULT_LEN = 7 INSPECT_RESULT_LEN = 6 )
Variables ¶
var ComposeExecutorDriver executor.ExecutorDriver
var ComposeFiles []string
var ComposeTaskInfo *mesos.TaskInfo
var CurPodStatus = &Status{ Status: types.POD_STAGING, }
var HealthCheckListId = make(map[string]bool)
var LaunchCmdAttempted = false
LaunchCmdAttempted indicates that an attempt to run the command to launch the pod (docker compose up with params) was made. This does not indicate that the result of the command execution.
var MonitorContainerList []string
var PluginOrder []string
var ServiceDetail = make(map[string]map[string]interface{})
store all docker-composed yaml file, key is filepath, value is the yaml unmarshelled object
var SinglePort bool
var StepMetrics = make(map[string][]*types.StepData)
Functions ¶
func CheckContainer ¶
func CheckContainer(containerId string, healthCheck bool) (types.ContainerStatusDetails, types.HealthStatus, bool, int, error)
CheckContainer does check container details return healthy,run,err
func CheckPodExitCode ¶
Check exit code of all the containers in the pod. If all the exit codes are zero, then assign zero as pod's exit code, otherwise assign the first non zero exit code to pod
func DockerDump ¶
func DockerDump()
DockerDump does dump docker.pid and docker-containerd.pid and docker log if docker dump is enabled in config
func EndStep ¶
func EndStep(stepData map[string][]*types.StepData, stepName string, tag map[string]interface{}, err error)
EndStep ends the current dce step, and update the result, duraiton. current dce step can be fetch from stepData, key is the stepName, value is each retry results. Update the latest result
func GenerateCmdParts ¶
Generate cmd parts docker-compose parts example : docker-compose -f compose.yaml up "docker-compose" will be the main cmd, "-f compose.yaml up" will be parts and return as an array
func GetAndRemoveLabel ¶
GetAndRemoveLabel will fetch the value for the key and removes it from the list
func GetContainerIdByService ¶
GetContainerIdByService does query container id by service name
func GetContainerIdsByServices ¶
GetContainerIdsByServices get container ids by a list of services
func GetContainerNetwork ¶
func GetPodContainerIds ¶
Get set of containers id in pod docker-compose -f docker-compose.yaml ps -q
func GetPodDetail ¶
docker-compose -f docker-compose.yaml ps
func GetServiceDetail ¶
func GetServiceDetail() types.ServiceDetail
func HealthCheck ¶
healthCheck includes health checking for primary container and exit code checking for other containers
func InspectContainerDetails ¶
func InspectContainerDetails(containerId string, healthcheck bool) (types.ContainerStatusDetails, error)
docker inspect
func KillContainer ¶
func ListenOnTaskStatus ¶
func ListenOnTaskStatus(driver executor.ExecutorDriver, taskInfo *mesos.TaskInfo)
ListenOnTaskStatus listens
func ParseToContainerDetail ¶
func ParseToContainerDetail(output string, healthcheck bool) (types.ContainerStatusDetails, error)
func PluginPanicHandler ¶
func PluginPanicHandler(condition ConditionFunc) (res string, err error)
func PrintInspectDetail ¶
get docker health check logs
func RemoveNetwork ¶
func RemovePodImage ¶
remove pod images docker-compose down --rmi
func RemovePodVolume ¶
remove pod volume docker-compose down -v
func SendMesosStatus ¶
func SendMesosStatus(ctx context.Context, driver executor.ExecutorDriver, taskId *mesos.TaskID, state *mesos.TaskState) error
Update mesos and pod status
func SetServiceDetail ¶
func SetServiceDetail(sd types.ServiceDetail)
func StartStep ¶
StartStep start a step of dce, and add a new item into the values, key is the stepName In the map, key will be step, value will be each retry result, and duration.
func ToHealthStatus ¶
func ToHealthStatus(s string) types.HealthStatus
func ToPodStatus ¶
func ValidateCompose ¶
validate compose before image pull