docker

package
v0.0.0-...-eecaf76 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert_name2ID

func Convert_name2ID(name string) string

Convert yarn name to short container ID.

func Delete_container

func Delete_container(id string, wg *sync.WaitGroup)

Delete a docker container.

func Delete_container_file_list

func Delete_container_file_list(path string)

Delete the containers of the file list

func Delete_containers_on_host

func Delete_containers_on_host(hostname string)

Delete all the yarn docker containers on the host.

func Get_all_docker_containers

func Get_all_docker_containers() ([]dc.APIContainers, error)

Get all the docker containers of swarm cluster

func Get_container_name

func Get_container_name(longname string) string

Get container name for example: yarn1-20141231-nm1

func Get_docker_status

func Get_docker_status(cluster_names []string)

Get the yarn docker cluster status

func Get_nodemanager_host

func Get_nodemanager_host(longname string) string

Get nodemanager local machine's hostname for example:bj-dc-datanode-006.tendcloud.com

func Get_running_docker_containers

func Get_running_docker_containers() ([]dc.APIContainers, error)

Get all the running docker containers of swarm cluster

func Get_swarm_nodes_status

func Get_swarm_nodes_status()

Show the swarm cluster status

func Lookup

func Lookup(hostname string, all bool)

Lookup the IP address of hostname Hostname is the 12 byte short container ID.

func Scale_yarn_cluster

func Scale_yarn_cluster(clustername string, numInstances int)

Scale yarn cluster with the base container

func Swarm_client

func Swarm_client() (*dc.Client, error)

Make a swarm client

Types

type Node

type Node struct {
	ID             string   `json:"id,omitempty" gorethink:"id,omitempty"`
	Name           string   `json:"name,omitempty" gorethink:"name,omitempty"`
	Addr           string   `json:"addr,omitempty" gorethink:"addr,omitempty"`
	Containers     string   `json:"containers,omitempty"`
	ReservedCPUs   string   `json:"reserved_cpus,omitempty"`
	ReservedMemory string   `json:"reserved_memory,omitempty"`
	Labels         []string `json:"labels,omitempty"`
	ResponseTime   float64  `json:"response_time" gorethink:"response_time,omitempty"`
}

func ParseClusterNodes

func ParseClusterNodes() ([]Node, error)

Parse swarm cluster nodes info

type ScaleResult

type ScaleResult struct {
	Scaled []string
	Errors []string
}

type Yarn_docker_container

type Yarn_docker_container struct {
	ID          string
	Clustername string //yarn1
	Name        string //yarn1-20160912-nm1
	Status      string //exited
	State       string //Exited (0) 3 hours ago
	Ip          string //172.18.12.31
	Host        string //bj-dc-datanode-078.tendcloud.com
}

Yarn nodemanager docker container

func Convert_yarn_docker_container

func Convert_yarn_docker_container(docker_container dc.APIContainers) Yarn_docker_container

Convert the swarm docker struct to yarn_docker_container struct

func Get_all_yarn_containers

func Get_all_yarn_containers() []Yarn_docker_container

Get yarn docker containers list

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL