ami

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BaetylGPUStatsExtension  = "baetyl_gpu_stats_extension"
	BaetylNodeStatsExtension = "baetyl_node_stats_extension"
	BaetylQPSStatsExtension  = "baetyl_qps_stats_extension"
)

Variables

View Source
var Hooks = map[string]interface{}{}

Functions

func Register

func Register(name string, n New)

func RemoteWebsocket added in v2.4.3

func RemoteWebsocket(ctx context.Context, option *DebugOptions, pipe Pipe) error

RemoteWebsocket set up websocket connect

Types

type AMI

type AMI interface {
	// node
	CollectNodeInfo() (map[string]interface{}, error)
	CollectNodeStats() (map[string]interface{}, error)
	GetModeInfo() (interface{}, error)

	// app
	ApplyApp(string, specv1.Application, map[string]specv1.Configuration, map[string]specv1.Secret) error
	DeleteApp(string, string) error
	StatsApps(string) ([]specv1.AppStats, error)

	// TODO: update
	FetchLog(namespace, service string, tailLines, sinceSeconds int64) (io.ReadCloser, error)

	// RemoteCommand remote debug
	RemoteCommand(option *DebugOptions, pipe Pipe) error

	// RemoteWebsocket remote link
	RemoteWebsocket(ctx context.Context, option *DebugOptions, pipe Pipe) error

	// RemoteLogs remote logs
	RemoteLogs(option *LogsOptions, pipe Pipe) error

	UpdateNodeLabels(string, map[string]string) error

	// RPCApp call baetyl app from baetyl-core
	RPCApp(url string, req *specv1.RPCRequest) (*specv1.RPCResponse, error)
}

AMI app model interfaces

func NewAMI

func NewAMI(mode string, cfg config.AmiConfig) (AMI, error)

type CollectStatsExtFunc added in v2.2.0

type CollectStatsExtFunc func(mode string) (map[string]interface{}, error)

type KubeDebugOptions added in v2.2.0

type KubeDebugOptions struct {
	Namespace string
	Name      string
	Container string
	Command   []string
}

type LogsOptions added in v2.2.0

type LogsOptions struct {
	Namespace    string
	Name         string
	Container    string
	SinceSeconds *int64
	TailLines    *int64
	LimitBytes   *int64
	Follow       bool
	Previous     bool
	Timestamps   bool
}

type NativeDebugOptions added in v2.2.0

type NativeDebugOptions struct {
	IP       string
	Port     string
	Username string
	Password string
}

type New

type New func(cfg config.AmiConfig) (AMI, error)

type Pipe

type Pipe struct {
	InReader  *io.PipeReader
	InWriter  *io.PipeWriter
	OutReader *io.PipeReader
	OutWriter *io.PipeWriter
}

type WebsocketOptions added in v2.4.3

type WebsocketOptions struct {
	Host string
	Path string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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