Documentation
¶
Index ¶
- Constants
- Variables
- func CheckContainer(containerId string, healthCheck bool) (types.HealthStatus, bool, int, error)
- func CheckPodExitCode(files []string) (int, error)
- func CopySvcContainers(to []types.SvcContainer, from []types.SvcContainer) []types.SvcContainer
- func DockerDump()
- func EndStep(stepData map[string][]*types.StepData, stepName string, tag map[string]string, ...)
- func ForceKill() 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 GetContainerNetwork(id string) (string, error)
- func GetContainerPid(containerID 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 GetServiceContainers(files, services []string) ([]types.SvcContainer, error)
- 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, svcContainer types.SvcContainer) 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 TaskInfoInitPodStatusHooks(ctx context.Context, taskInfo *mesos.TaskInfo) error
- func ToHealthStatus(s string) types.HealthStatus
- func ToPodStatus(s string) types.PodStatus
- func UpdateHealthCheckStatus(stepData map[string][]*types.StepData)
- 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 []types.SvcContainer
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 ¶
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 CopySvcContainers ¶ added in v0.12.1
func CopySvcContainers(to []types.SvcContainer, from []types.SvcContainer) []types.SvcContainer
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]string, 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 GetContainerNetwork ¶
func GetContainerPid ¶ added in v0.12.0
func GetLabel ¶
GetLabel checks if the whole key is the suffix of a label and fetches the value of that label
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 GetServiceContainers ¶ added in v0.8.1
func GetServiceContainers(files, services []string) ([]types.SvcContainer, error)
GetServiceContainers get list of (service, container_id) pair by a list of services
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 KillContainer(sig string, svcContainer types.SvcContainer) error
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 TaskInfoInitPodStatusHooks ¶ added in v0.11.2
TaskInfoInitPodStatusHooks finds the hooks (implementations of ExecutorHook interface) configured for executor phase and init them error is returned if any of the hooks failed, and ExecutorHook.BestEffort() returns true
func ToHealthStatus ¶
func ToHealthStatus(s string) types.HealthStatus
func ToPodStatus ¶
func UpdateHealthCheckStatus ¶ added in v0.11.2
func ValidateCompose ¶
validate compose before image pull