types

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: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// environment PATH
	DefaultSystemPath = system.DefaultPathEnvUnix
	DefaultCondaPath  = "/opt/conda/envs/envd/bin:/opt/conda/bin:/home/envd/.local/bin"
	DefaultJuliaPath  = "/usr/local/julia/bin"
	// image
	PythonBaseImage   = "ubuntu:20.04"
	EnvdStarshipImage = "tensorchord/starship:v0.0.1"
	// supervisor
	HorustImage      = "tensorchord/horust:v0.2.3"
	HorustServiceDir = "/etc/horust/services"
	HorustLogDir     = "/var/log/horust"
	// env
	EnvdWorkDir = "ENVD_WORKDIR"
)
View Source
const (
	ContainerLabelName              = "ai.tensorchord.envd.name"
	ContainerLabelJupyterAddr       = "ai.tensorchord.envd.jupyter.address"
	ContainerLabelRStudioServerAddr = "ai.tensorchord.envd.rstudio.server.address"
	ContainerLabelSSHPort           = "ai.tensorchord.envd.ssh.port"

	ImageLabelContainerName = "ai.tensorchord.envd.container.name"
	ImageLabelVendor        = "ai.tensorchord.envd.vendor"
	ImageLabelGPU           = "ai.tensorchord.envd.gpu"
	ImageLabelRepo          = "ai.tensorchord.envd.repo"
	ImageLabelPorts         = "ai.tensorchord.envd.ports"
	ImageLabelAPT           = "ai.tensorchord.envd.apt.packages"
	ImageLabelPyPI          = "ai.tensorchord.envd.pypi.commands"
	ImageLabelR             = "ai.tensorchord.envd.r.packages"
	ImageLabelCUDA          = "ai.tensorchord.envd.gpu.cuda"
	ImageLabelCUDNN         = "ai.tensorchord.envd.gpu.cudnn"
	ImageLabelContext       = "ai.tensorchord.envd.build.context"
	ImageLabelCacheHash     = "ai.tensorchord.envd.build.digest"
	ImageLabelSyntaxVer     = "ai.tensorchord.envd.syntax.version"
	RuntimeGraphCode        = "ai.tensorchord.envd.graph.runtime"
	GeneralGraphCode        = "ai.tensorchord.envd.graph.general"

	ImageVendorEnvd = "envd"
)

Variables

View Source
var BaseAptPackage = []string{
	"bash-static",
	"libtinfo5",
	"libncursesw5",

	"bzip2",
	"ca-certificates",
	"libglib2.0-0",
	"libsm6",
	"libxext6",
	"libxrender1",
	"mercurial",
	"procps",
	"subversion",
	"wget",

	"curl",
	"openssh-client",
	"git",
	"sudo",
	"vim",
	"make",
	"zsh",
	"locales",
}
View Source
var BaseEnvironment = []struct {
	Name  string
	Value string
}{
	{"DEBIAN_FRONTEND", "noninteractive"},
	{"PATH", DefaultSystemPath},
	{"LANG", "en_US.UTF-8"},
	{"LC_ALL", "en_US.UTF-8"},
}
View Source
var EnvdSshdImage = fmt.Sprintf(
	"tensorchord/envd-sshd-from-scratch:%s",
	version.GetVersionForImageTag())

Functions

This section is empty.

Types

type AuthConfig added in v0.2.4

type AuthConfig struct {
	Name     string `json:"name,omitempty"`
	JWTToken string `json:"jwt_token,omitempty"`
}

type BuilderType added in v0.2.0

type BuilderType string
const (
	BuilderTypeMoby             BuilderType = "moby-worker"
	BuilderTypeDocker           BuilderType = "docker-container"
	BuilderTypeNerdctl          BuilderType = "nerdctl-container"
	BuilderTypeKubernetes       BuilderType = "kube-pod"
	BuilderTypeTCP              BuilderType = "tcp"
	BuilderTypeUNIXDomainSocket BuilderType = "unix"
)

type ContainerStatus added in v0.3.44

type ContainerStatus string
const (
	StatusCreated    ContainerStatus = "created"
	StatusRunning    ContainerStatus = "running"
	StatusPaused     ContainerStatus = "paused"
	StatusRestarting ContainerStatus = "restarting"
	StatusRemoving   ContainerStatus = "removing"
	StatusExited     ContainerStatus = "exited"
	StatusDead       ContainerStatus = "dead"
)

type Context added in v0.2.0

type Context struct {
	Name           string      `json:"name,omitempty"`
	Builder        BuilderType `json:"builder,omitempty"`
	BuilderAddress string      `json:"builder_address,omitempty"`
	Runner         RunnerType  `json:"runner,omitempty"`
	RunnerAddress  *string     `json:"runner_address,omitempty"`
}

func (Context) GetSSHHostname added in v0.2.4

func (c Context) GetSSHHostname(sshdHost string) (string, error)

type Dependency

type Dependency struct {
	APTPackages  []string `json:"apt_packages,omitempty"`
	PyPIPackages []string `json:"pypi_packages,omitempty"`
}

func NewDependencyFromContainerJSON

func NewDependencyFromContainerJSON(ctr types.ContainerJSON) (*Dependency, error)

func NewDependencyFromImageSummary added in v0.2.5

func NewDependencyFromImageSummary(img types.ImageSummary) (*Dependency, error)

func NewDependencyFromLabels added in v0.2.4

func NewDependencyFromLabels(label map[string]string) (*Dependency, error)

type EnvdAuth added in v0.2.4

type EnvdAuth struct {
	Current string       `json:"current,omitempty"`
	Auth    []AuthConfig `json:"auth,omitempty"`
}

type EnvdContext added in v0.2.0

type EnvdContext struct {
	Current  string    `json:"current,omitempty"`
	Contexts []Context `json:"contexts,omitempty"`
}

type EnvdEnvironment

type EnvdEnvironment struct {
	servertypes.Environment `json:",inline,omitempty"`

	EnvdManifest `json:",inline,omitempty"`
}

func NewEnvironmentFromContainer added in v0.2.4

func NewEnvironmentFromContainer(ctr types.Container) (*EnvdEnvironment, error)

func NewEnvironmentFromServer added in v0.2.4

func NewEnvironmentFromServer(ctr servertypes.Environment) (*EnvdEnvironment, error)

type EnvdImage

type EnvdImage struct {
	servertypes.ImageMeta `json:",inline,omitempty"`

	EnvdManifest `json:",inline,omitempty"`
}

func NewImageFromMeta added in v0.2.5

func NewImageFromMeta(meta servertypes.ImageMeta) (*EnvdImage, error)

func NewImageFromSummary added in v0.2.5

func NewImageFromSummary(image types.ImageSummary) (*EnvdImage, error)

type EnvdInfo added in v0.2.0

type EnvdInfo struct {
	types.Info
}

type EnvdManifest

type EnvdManifest struct {
	GPU          bool   `json:"gpu,omitempty"`
	CUDA         string `json:"cuda,omitempty"`
	CUDNN        string `json:"cudnn,omitempty"`
	BuildContext string `json:"build_context,omitempty"`
	Dependency   `json:",inline,omitempty"`
}

type OwnerInfo added in v0.2.6

type OwnerInfo struct {
	Uid int64 `json:"uid,omitempty"`
	Gid int64 `json:"gid,omitempty"`
}

type PortBinding added in v0.2.0

type PortBinding struct {
	Name     string
	Port     string
	Protocol string
	HostIP   string
	HostPort string
}

func NewPortBindingFromContainerJSON added in v0.2.0

func NewPortBindingFromContainerJSON(ctr types.ContainerJSON) ([]PortBinding, error)

type RepoInfo added in v0.2.4

type RepoInfo struct {
	URL         string `json:"url,omitempty"`
	Description string `json:"description,omitempty"`
}

type RunnerType added in v0.2.4

type RunnerType string
const (
	RunnerTypeDocker     RunnerType = "docker"
	RunnerTypeEnvdServer RunnerType = "envd-server"
)

Jump to

Keyboard shortcuts

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