runtime

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnnotationDomain = "ai.tensorchord.domain"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PtyHandler

type PtyHandler interface {
	io.Reader
	io.Writer
	remotecommand.TerminalSizeQueue
}

type Runtime

type Runtime interface {
	// build
	BuildList(ctx context.Context, namespace string) ([]types.Build, error)
	BuildCreate(ctx context.Context, req types.Build, inference *v2alpha1.Inference, builderImage,
		buildkitdAddress, buildCtlBin, secret string) error
	BuildGet(ctx context.Context, namespace, buildName string) (types.Build, error)
	// cache
	ImageCacheCreate(ctx context.Context, req types.ImageCache, inference *modelzetes.Inference) error
	// inference
	InferenceCreate(ctx context.Context,
		req types.InferenceDeployment, cfg config.IngressConfig, event string, serverPort int) error
	InferenceDelete(ctx context.Context, namespace, inferenceName, ingressNamespace, event string) error
	InferenceExec(ctx *gin.Context, namespace, instance string, commands []string, tty bool) error
	InferenceGet(namespace, inferenceName string) (*types.InferenceDeployment, error)
	InferenceGetCRD(namespace, name string) (*apis.Inference, error)
	InferenceInstanceList(namespace, inferenceName string) ([]types.InferenceDeploymentInstance, error)
	InferenceList(namespace string) ([]types.InferenceDeployment, error)
	InferenceScale(ctx context.Context, namespace string, req types.ScaleServiceRequest, inf *types.InferenceDeployment) error
	InferenceUpdate(ctx context.Context, namespace string, req types.InferenceDeployment, event string) (err error)
	// namespace
	NamespaceList(ctx context.Context) ([]string, error)
	NamespaceCreate(ctx context.Context, name string) error
	NamespaceGet(ctx context.Context, name string) bool
	NamespaceDelete(ctx context.Context, name string) error
	// server
	ServerDeleteNode(ctx context.Context, name string) error
	ServerLabelCreate(ctx context.Context, name string, spec types.ServerSpec) error
	ServerList(ctx context.Context) ([]types.Server, error)
	// managed cluster
	GetClusterInfo(cluster *types.ManagedCluster) error
}

func New

func New(clientConfig *rest.Config,
	endpointsInformer corev1.EndpointsInformer,
	deploymentInformer appsv1.DeploymentInformer,
	inferenceInformer modelzv2alpha1.InferenceInformer,
	podInformer corev1.PodInformer,
	kubeClient kubernetes.Interface,
	ingressClient ingressclient.Interface,
	kubefledgedClient kubefledged.Interface,
	inferenceClient clientset.Interface,
	eventRecorder event.Interface,
	ingressEnabled bool,
	eventEnabled bool,
	buildEnabled bool,
	ingressAnyIPToDomain bool,
) (Runtime, error)

type TerminalMessage

type TerminalMessage struct {
	ID   string `json:"id,omitempty"`
	Op   string `json:"op,omitempty"`
	Data string `json:"data,omitempty"`
	Rows uint16 `json:"rows,omitempty"`
	Cols uint16 `json:"cols,omitempty"`
}

TerminalMessage is the messaging protocol between ShellController and TerminalSession.

OP DIRECTION FIELD(S) USED DESCRIPTION --------------------------------------------------------------------- bind fe->be SessionID Id sent back from TerminalResponse stdin fe->be Data Keystrokes/paste buffer resize fe->be Rows, Cols New terminal size stdout be->fe Data Output from the process toast be->fe Data OOB message to be shown to the user

type TerminalSession

type TerminalSession struct {
	ID string
	// contains filtered or unexported fields
}

TerminalSession

func (*TerminalSession) Close

func (t *TerminalSession) Close() error

func (*TerminalSession) Next

TerminalSize handles pty->process resize events Called in a loop from remotecommand as long as the process is running

func (*TerminalSession) Read

func (t *TerminalSession) Read(p []byte) (int, error)

Read handles pty->process messages (stdin, resize) Called in a loop from remotecommand as long as the process is running

func (*TerminalSession) Write

func (t *TerminalSession) Write(p []byte) (int, error)

Write handles process->pty stdout Called from remotecommand whenever there is any output

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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