runtime

package module
v0.0.0-...-f35d6a9 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

README

mfe

MFE means MFE for everyone. M stands for machine-learning models.

Documentation

Index

Constants

View Source
const ServaModuletName = "mfe"

Variables

View Source
var (
	ErrNotFound = errors.New("not found")
	ErrExists   = errors.New("already exists")
)
View Source
var StateText = [...]string{
	"started",
	"running",
	"stopped",
}

Functions

This section is empty.

Types

type Archive

type Archive struct {
	Env       string
	Name      string
	Remote    string
	Local     string
	BatchSize int
}

func (*Archive) Retrieve

func (a *Archive) Retrieve(dir string) error

type Batch

type Batch struct {
}

type Batcher

type Batcher interface {
	Batch(<-chan *Task) (*Batch, error)
}

type Client

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

func (*Client) Exec

func (c *Client) Exec(batch *Batch, setState func(State)) error

type CreateOption

type CreateOption func(*CreateOptions)

func BatchSize

func BatchSize(size int) CreateOption

func Env

func Env(env string) CreateOption

func Local

func Local(dir string) CreateOption

func Remote

func Remote(addr string) CreateOption

type CreateOptions

type CreateOptions struct {
	Env       string
	Remote    string
	Local     string
	BatchSize int
}

type Group

type Group struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Group) Add

func (g *Group) Add(task *Task)

func (*Group) Close

func (g *Group) Close() error

func (*Group) Scale

func (g *Group) Scale(n int)

func (*Group) Stats

func (g *Group) Stats() []Stat

type Option

type Option func(*Options)

func Dir

func Dir(dir string) Option

func GPU

func GPU(gpu int32) Option

func Runner

func Runner(r runner.Runner) Option

type Options

type Options struct {
	Dir    string
	GPU    int32
	Runner runner.Runner
}

type Scheduler

type Scheduler struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewScheduler

func NewScheduler(opts ...Option) *Scheduler

func (*Scheduler) Append

func (s *Scheduler) Append(task *Task) error

func (*Scheduler) Create

func (s *Scheduler) Create(name string, opts ...CreateOption) error

func (*Scheduler) Delete

func (s *Scheduler) Delete(name string) error

func (*Scheduler) Read

func (s *Scheduler) Read(name string) (*Group, error)

func (*Scheduler) Scale

func (s *Scheduler) Scale(name string, n int) error

func (*Scheduler) Sync

func (s *Scheduler) Sync(env string, deps ...string) error

type Stat

type Stat struct {
	Id     int
	GPU    int32
	Uptime time.Duration
	State  State
}

type State

type State int32
const (
	Started State = iota + 1
	Running
	Stopped
)

type Task

type Task struct {
	Id      string
	Group   string
	Command string
	Request proto.Message
}

type Worker

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

func (*Worker) Exec

func (w *Worker) Exec(batch *Batch)

func (*Worker) Run

func (w *Worker) Run() error

func (*Worker) Stat

func (w *Worker) Stat() Stat

func (*Worker) Stop

func (w *Worker) Stop()

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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