worker

package
v0.9.15 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2015 License: BSD-2-Clause Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ID_HEARTBEATER   = 0
	ID_WORKSTEALER   = 1
	ID_DATAMOVER     = 2
	ID_WORKER        = 3
	ID_DELIVERER     = 4
	ID_REDISTRIBUTOR = 5
	ID_DISCARDED     = 6
)

Variables

This section is empty.

Functions

func CheckoutTokenByJobId

func CheckoutTokenByJobId(jobid string) (token string, err error)

func CheckoutWorkunitRemote

func CheckoutWorkunitRemote() (workunit *core.Workunit, err error)

func CleanDisk

func CleanDisk() (err error)

func ComposeProfile

func ComposeProfile() (profile *core.Client, err error)

func CreateContainer added in v0.9.13

func CreateContainer(create_args []string) (container_id string, err error)

func DiscardWorkunit

func DiscardWorkunit(id string) (err error)

func FetchDataTokenByWorkId

func FetchDataTokenByWorkId(workid string) (token string, err error)

func FetchPrivateEnvByWorkId added in v0.9.3

func FetchPrivateEnvByWorkId(workid string) (envs map[string]string, err error)

func InitWorkers

func InitWorkers(client *core.Client) (err error)

func InspectImage added in v0.9.13

func InspectImage(client *docker.Client, dockerimage_id string) (image *docker.Image, err error)

func KillContainer added in v0.9.13

func KillContainer(container_id string) (err error)

func ParseWorkunitArgs

func ParseWorkunitArgs(work *core.Workunit) (err error)

parse workunit, fetch input data, compose command arguments

func ReRegisterWithSelf

func ReRegisterWithSelf(host string) (client *core.Client, err error)

func RegisterWithAuth

func RegisterWithAuth(host string, profile *core.Client) (client *core.Client, err error)

func RegisterWithProfile

func RegisterWithProfile(host string, profile *core.Client) (client *core.Client, err error)

func RemoveContainer added in v0.9.13

func RemoveContainer(container_id string) (err error)

func RemoveOldAWEContainers added in v0.9.3

func RemoveOldAWEContainers(client *docker.Client, container_name string) (err error)

func RestartClient

func RestartClient() (err error)

func RunCommand added in v0.9.13

func RunCommand(name string, arg ...string) (stdo []byte, stde []byte, err error)

execute command, wait, and return stdout and stderr ; do not use for large outputs ! it returns both stdout and stderr

func RunContainer added in v0.9.13

func RunContainer(run_args []string) (container_id string, err error)

** not tested **

func RunWorkunit

func RunWorkunit(work *core.Workunit) (pstats *core.WorkPerf, err error)

func RunWorkunitDirect

func RunWorkunitDirect(work *core.Workunit) (pstats *core.WorkPerf, err error)

func RunWorkunitDocker

func RunWorkunitDocker(work *core.Workunit) (pstats *core.WorkPerf, err error)

func SendHeartBeat

func SendHeartBeat()

client sends heartbeat to server to maintain active status and re-register when needed

func SetEnv

func SetEnv(work *core.Workunit) (envkeys []string, err error)

func StartClientWorkers

func StartClientWorkers()

func StartContainer added in v0.9.13

func StartContainer(container_id string, args string) (err error)

func StartProxyWorkers

func StartProxyWorkers()

func StopClient

func StopClient() (err error)

func SubmitWorkProxy

func SubmitWorkProxy(work *core.Workunit) (err error)

func TagImage added in v0.9.13

func TagImage(client *docker.Client, dockerimage_id string, tag_opts docker.TagImageOptions) (err error)

func UnSetEnv

func UnSetEnv(envkeys []string)

func WaitContainer added in v0.9.13

func WaitContainer(container_id string) (status int, err error)

Types

type ClientResponse

type ClientResponse struct {
	Code int         `bson:"status" json:"status"`
	Data core.Client `bson:"data" json:"data"`
	Errs []string    `bson:"error" json:"error"`
}

type DockerImageAttributes added in v0.9.13

type DockerImageAttributes struct {
	Name       string `bson:"name" json:"name"`
	Tag        string `bson:"tag" json:"tag"`
	Repository string `bson:"repository" json:"repository"`
}

type DockerShockNode added in v0.9.13

type DockerShockNode struct {
	shock.ShockNode
	Version    []int
	Attributes DockerImageAttributes
}

type DockerShockNodeArray added in v0.9.13

type DockerShockNodeArray []DockerShockNode

func (DockerShockNodeArray) Len added in v0.9.13

func (a DockerShockNodeArray) Len() int

func (DockerShockNodeArray) Less added in v0.9.13

func (a DockerShockNodeArray) Less(i, j int) bool

func (DockerShockNodeArray) Swap added in v0.9.13

func (a DockerShockNodeArray) Swap(i, j int)

type HeartbeatResponse

type HeartbeatResponse struct {
	Code int        `bson:"status" json:"status"`
	Data core.HBmsg `bson:"data" json:"data"`
	Errs []string   `bson:"error" json:"error"`
}

type Shock_Dockerimage_attributes added in v0.9.4

type Shock_Dockerimage_attributes struct {
	Id          string `bson:"id" json:"id"`                       // this is docker image id, not Shock id
	Name        string `bson:"name" json:"name"`                   // docker image name
	Type        string `bson:"type" json:"type"`                   // should be "dockerimage"
	BaseImageId string `bson:"base_image_id" json:"base_image_id"` // could used to reference parent image
}

type TokenResponse

type TokenResponse struct {
	Code int      `bson:"status" json:"status"`
	Data string   `bson:"data" json:"data"`
	Errs []string `bson:"error" json:"error"`
}

type WorkResponse

type WorkResponse struct {
	Code int            `bson:"status" json:"status"`
	Data *core.Workunit `bson:"data" json:"data"`
	Errs []string       `bson:"error" json:"error"`
}

Jump to

Keyboard shortcuts

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