runner

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InferSelfIPv4

func InferSelfIPv4(ipv4 string, nic string) (uint32, error)

func Init

func Init(f *FlagSet)

func ResolveHostList

func ResolveHostList(config string, nic string) (plan.HostList, error)

func ResolvePeerList

func ResolvePeerList(localhostIPv4 uint32, port uint16, config string) (plan.PeerList, error)

func SimpleRun

func SimpleRun(ctx context.Context, selfIPv4 uint32, pl plan.PeerList, j job.Job, verboseLog bool)

func WatchRun

func WatchRun(ctx context.Context, self plan.PeerID, runners plan.PeerList, ch chan Stage, j job.Job, keep bool, debugPort int)

Types

type FlagSet

type FlagSet struct {
	ConfigServer string
	ClusterSize  int
	HostList     string
	PeerList     string

	User string

	PortRange plan.PortRange

	Self        string
	Timeout     time.Duration
	VerboseLog  bool
	NIC         string
	AllowNVLink bool

	Strategy kb.Strategy

	Port        int
	DebugPort   int
	Watch       bool
	Keep        bool
	InitVersion int

	Logfile string
	LogDir  string
	Quiet   bool

	Prog string
	Args []string
}

func (*FlagSet) Parse

func (f *FlagSet) Parse() error

func (*FlagSet) Register

func (f *FlagSet) Register(flag *flag.FlagSet)

type Handler

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

func NewHandler

func NewHandler(self plan.PeerID, ch chan Stage, cancel context.CancelFunc) *Handler

func (*Handler) Handle

func (h *Handler) Handle(conn connection.Connection) (int, error)

func (*Handler) Self

func (h *Handler) Self() plan.PeerID

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type HostSpec

type HostSpec struct {
	Hostname   string
	Slots      int
	PublicAddr string
}

func ParseHostList

func ParseHostList(config string) ([]HostSpec, error)

type PeerSpec

type PeerSpec struct {
	Host string
	Port uint16
	Slot int
}

func ParsePeerSpec

func ParsePeerSpec(config string) (*PeerSpec, error)

func (PeerSpec) String

func (p PeerSpec) String() string

type PeerSpecList

type PeerSpecList []PeerSpec

func ParsePeerSpecList

func ParsePeerSpecList(config string) (PeerSpecList, error)

func (PeerSpecList) Eq

func (l PeerSpecList) Eq(r PeerSpecList) bool

func (PeerSpecList) String

func (l PeerSpecList) String() string

type Stage

type Stage struct {
	Version int
	Cluster plan.Cluster
}

func (*Stage) Decode

func (s *Stage) Decode(bs []byte) error

func (Stage) Encode

func (s Stage) Encode() []byte

func (Stage) Eq

func (s Stage) Eq(t Stage) bool

Jump to

Keyboard shortcuts

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