executor

package
v0.0.0-...-a417bd8 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerClient

type DockerClient struct {
	*client.Client
	// contains filtered or unexported fields
}

func NewDockerClient

func NewDockerClient(httpAddr string, version string) (*DockerClient, error)

func (*DockerClient) RemoveByLabel

func (dockerClient *DockerClient) RemoveByLabel(labelName, labelValue string)

func (*DockerClient) String

func (dockerClient *DockerClient) String() string

type DockerClientConfig

type DockerClientConfig struct {
	HttpAddr string `json:"httpAddr"`
	Version  string `json:"version"`
}

type DockerContainerConfig

type DockerContainerConfig struct {
	NetWork        string `json:"network"`
	ProcessAddrMap string `json:"processAddrMap"`
	ProcessPort    int    `json:"processPort"`
	ListenAddrMap  string `json:"listenAddrMap"`
	Volume         string `json:"volume"`
	Image          string `json:"image"`
	Cmd            string `json:"cmd"`
	MountPoint     string `json:"mountPoint"`
	LabelName      string `json:"labelName"`
	LabelValue     string `json:"labelValue"`
}

type DockerExecutor

type DockerExecutor struct {
	// contains filtered or unexported fields
}

func NewDockerExecutor

func NewDockerExecutor(submitID int, containerName string, resource Resource, client *DockerClient, config DockerContainerConfig) *DockerExecutor

func (*DockerExecutor) CreateAndStart

func (executor *DockerExecutor) CreateAndStart() error

func (*DockerExecutor) Destroy

func (executor *DockerExecutor) Destroy() error

type DockerExecutorError

type DockerExecutorError struct {
	// contains filtered or unexported fields
}

func (*DockerExecutorError) Error

func (executorError *DockerExecutorError) Error() string

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

func NewExecutor

func NewExecutor(executorChannel chan submitwrap.SubmitTaskWrap,
	dispatchChannel chan<- submitwrap.SubmitTaskWrap, config ExecutorConfig) *Executor

func (*Executor) Run

func (executor *Executor) Run()

type ExecutorConfig

type ExecutorConfig struct {
	Workers          int                   `json:"workers"`
	RecliamFrequence int                   `json:"recliamFrequence"`
	ChannelSize      int                   `json:"channelSize"`
	ContainerConfig  DockerContainerConfig `json:"containerConfig"`
	ClientConfig     DockerClientConfig    `json:"clientConfig"`
}

type Resource

type Resource struct {
	Memory int64
	// contains filtered or unexported fields
}

func (*Resource) SetMemoryByByte

func (resc *Resource) SetMemoryByByte(mem int64)

func (*Resource) SetMemoryByGB

func (resc *Resource) SetMemoryByGB(mem int64)

func (*Resource) SetMemoryByKB

func (resc *Resource) SetMemoryByKB(mem int64)

func (*Resource) SetMemoryByMb

func (resc *Resource) SetMemoryByMb(mem int64)

Jump to

Keyboard shortcuts

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