envd

package
v0.3.45 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Localhost = "127.0.0.1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerSource added in v0.2.4

type DockerSource struct {
	Graph        ir.Graph
	MountOptions []string
}

type Engine

Engine is the core engine to manage the envd environments.

func New

func New(ctx context.Context, opt Options) (Engine, error)

type EngineSource added in v0.2.4

type EngineSource struct {
	DockerSource     *DockerSource
	EnvdServerSource *EnvdServerSource
}

type EnvdServerSource added in v0.2.4

type EnvdServerSource struct {
	Sync bool
}

type EnvironmentClient added in v0.2.4

type EnvironmentClient interface {
	PauseEnvironment(ctx context.Context, env string) (string, error)
	ResumeEnvironment(ctx context.Context, env string) (string, error)
	GetEnvironment(ctx context.Context, env string) (*types.EnvdEnvironment, error)
	ListEnvironment(ctx context.Context) ([]types.EnvdEnvironment, error)
	ListEnvRuntimeGraph(ctx context.Context, env string) (*ir.RuntimeGraph, error)
	ListEnvDependency(ctx context.Context, env string) (*types.Dependency, error)
	ListEnvPortBinding(ctx context.Context, env string) ([]types.PortBinding, error)

	CleanEnvdIfExists(ctx context.Context, name string, force bool) error
	// StartEnvd creates the container for the given tag and container name.
	StartEnvd(ctx context.Context, so StartOptions) (*StartResult, error)

	IsRunning(ctx context.Context, name string) (bool, error)
	Exists(ctx context.Context, name string) (bool, error)
	WaitUntilRunning(ctx context.Context, name string, timeout time.Duration) error
	Destroy(ctx context.Context, name string) (string, error)
}

type ImageClient added in v0.2.4

type ImageClient interface {
	ListImage(ctx context.Context) ([]types.EnvdImage, error)
	ListImageDependency(ctx context.Context, image string) (*types.Dependency, error)
	GetImage(ctx context.Context, image string) (types.EnvdImage, error)
	PruneImage(ctx context.Context) (dockertypes.ImagesPruneReport, error)
}

type Options added in v0.2.4

type Options struct {
	Context *types.Context
}

type ProgressBar added in v0.3.12

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

func InitProgressBar added in v0.3.12

func InitProgressBar(stage int) *ProgressBar

InitProgressBar initializes a progress bar. If stage <= 0, the progress bar will not show the (current/total) stage information.

func (*ProgressBar) Finish added in v0.3.36

func (b *ProgressBar) Finish()

func (*ProgressBar) UpdateTitle added in v0.3.36

func (b *ProgressBar) UpdateTitle(title string)

type SSHClient added in v0.2.4

type SSHClient interface {
	GenerateSSHConfig(name, iface, privateKeyPath string,
		startResult *StartResult) (sshconfig.EntryOptions, error)
	Attach(name, iface, privateKeyPath string,
		startResult *StartResult, g ir.Graph) error
}

type StartOptions added in v0.2.4

type StartOptions struct {
	Image           string
	EnvironmentName string
	BuildContext    string
	NumGPU          int
	NumCPU          string
	CPUSet          string
	NumMem          string
	Timeout         time.Duration
	ShmSize         int
	Forced          bool
	SshdHost        string

	EngineSource
}

type StartResult added in v0.2.4

type StartResult struct {
	// TODO(gaocegege): Make result a chan, to send running status to the receiver.
	SSHPort int
	Address string
	Name    string

	Ports []types.EnvironmentPort
}

type VersionClient added in v0.2.4

type VersionClient interface {
	GetInfo(ctx context.Context) (*types.EnvdInfo, error)
	GPUEnabled(ctx context.Context) (bool, error)
}

Jump to

Keyboard shortcuts

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