worker

package
v0.9.11 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2014 License: BSD-2-Clause Imports: 29 Imported by: 4

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 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 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 RemoveOldAWEContainers added in v0.9.3

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

func RestartClient

func RestartClient() (err error)

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 StartProxyWorkers

func StartProxyWorkers()

func StopClient

func StopClient() (err error)

func SubmitWorkProxy

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

func UnSetEnv

func UnSetEnv(envkeys []string)

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 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