runtime

package
v0.0.0-...-37f5ccb Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 42 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 struct {
	// contains filtered or unexported fields
}

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,
	inferenceClient clientset.Interface,
	eventRecorder event.Interface,
	ingressEnabled, eventEnabled bool,
	ingressAnyIPToDomain bool,
) (Runtime, error)

func (Runtime) BuildCreate

func (r Runtime) BuildCreate(ctx context.Context,
	req types.Build, builderImage, buildkitdAddress, buildCtlBin,
	buildRegistry, buildRegistryToken string) error

func (Runtime) BuildGet

func (r Runtime) BuildGet(ctx context.Context, namespace, buildName string) (types.Build, error)

func (Runtime) BuildList

func (r Runtime) BuildList(ctx context.Context, namespace string) (
	[]types.Build, error)

func (Runtime) InferenceCreate

func (r Runtime) InferenceCreate(ctx context.Context,
	req types.InferenceDeployment, ingressDomain, ingressNamespace, event string) error

func (Runtime) InferenceDelete

func (r Runtime) InferenceDelete(ctx context.Context, namespace,
	inferenceName, ingressNamespace, event string) error

func (Runtime) InferenceExec

func (r Runtime) InferenceExec(ctx *gin.Context, namespace, instance string,
	commands []string, tty bool) error

func (Runtime) InferenceGet

func (r Runtime) InferenceGet(namespace, inferenceName string) (
	*types.InferenceDeployment, error)

func (Runtime) InferenceInstanceList

func (r Runtime) InferenceInstanceList(namespace, inferenceName string) (
	[]types.InferenceDeploymentInstance, error)

func (Runtime) InferenceList

func (r Runtime) InferenceList(namespace string) ([]types.InferenceDeployment, error)

func (Runtime) InferenceScale

func (r Runtime) InferenceScale(ctx context.Context, namespace string,
	req types.ScaleServiceRequest) (err error)

func (Runtime) InferenceUpdate

func (r Runtime) InferenceUpdate(ctx context.Context, namespace string,
	req types.InferenceDeployment, event string) (err error)

func (Runtime) NamespaceCreate

func (r Runtime) NamespaceCreate(ctx context.Context, name string) error

func (Runtime) NamespaceList

func (r Runtime) NamespaceList(ctx context.Context) ([]string, error)

func (Runtime) ServerLabelCreate

func (r Runtime) ServerLabelCreate(ctx context.Context, name string, spec types.ServerSpec) error

func (Runtime) ServerList

func (r Runtime) ServerList(ctx context.Context) ([]types.Server, 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

Jump to

Keyboard shortcuts

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