notebook

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MountRelativePathNotebook      = "notebook"
	MountRelativePathWorkspaceData = "data"
)
View Source
const (
	GPUVendorUnknown = "Unknown"
	GPUVendorNvidia  = "Nvidia"
	GPUVendorAMD     = "AMD"   // not support
	GPUVendorIntel   = "Intel" // not support
)
View Source
const (
	NotebookFileExt = ".ipynb"
)

Variables

This section is empty.

Functions

func GetGPUVendor

func GetGPUVendor(model string) string

func ResourceQuantityStringToInt64HookFunc

func ResourceQuantityStringToInt64HookFunc(f, t reflect.Type, data interface{}) (interface{}, error)

ResourceQuantityStringToInt64HookFunc converts resource.Quantity format string to int64.

Types

type GPU

type GPU struct {
	Model  string  `json:"model" mapstructure:"model"`
	Card   float64 `json:"card" mapstructure:"card"` // float is for mgpu
	Memory int64   `json:"memory" mapstructure:"memory"`
}

func (*GPU) Vendor

func (g *GPU) Vendor() string

type Image

type Image struct {
	Name        string    `json:"name" mapstructure:"name"`
	Version     string    `json:"version" mapstructure:"version"`
	Description string    `json:"description" mapstructure:"description"`
	Image       string    `json:"image" mapstructure:"image"`
	UpdateTime  time.Time `json:"updateTime" mapstructure:"updateTime"`
}

type JupyterhubConfig

type JupyterhubConfig struct {
	Endpoint   string                  `json:"endpoint" mapstructure:"endpoint"`
	AdminToken string                  `json:"adminToken" mapstructure:"adminToken"`
	Kubernetes *jupyterhubInKubeConfig `json:"kubernetes" mapstructure:"kubernetes"`
}

type Options

type Options struct {
	OfficialImages   []Image          `json:"officialImages" mapstructure:"officialImages"`
	ResourceSizes    []ResourceOption `json:"resourceOptions" mapstructure:"resourceOptions"`
	StaticJupyterhub JupyterhubConfig `json:"staticJupyterhub" mapstructure:"staticJupyterhub"`
}

func NewOptions

func NewOptions() *Options

func (*Options) AddFlags

func (o *Options) AddFlags(fs *pflag.FlagSet)

func (*Options) ListOfficialImages

func (o *Options) ListOfficialImages() []string

func (*Options) ListResourceSizes

func (o *Options) ListResourceSizes() []ResourceSize

func (*Options) Validate

func (o *Options) Validate() error

type ResourceOption

type ResourceOption struct {
	ResourceSize `json:",inline" mapstructure:",squash"`
	NodeSelector map[string]string `json:"nodeSelector,omitempty" mapstructure:"nodeSelector"`
}

type ResourceSize

type ResourceSize struct {
	CPU    float64 `json:"cpu" mapstructure:"cpu"`
	Memory int64   `json:"memory" mapstructure:"memory"`
	Disk   int64   `json:"disk" mapstructure:"disk"`
	GPU    *GPU    `json:"gpu,omitempty" mapstructure:"gpu"`
}

func (*ResourceSize) String

func (r *ResourceSize) String() string

func (*ResourceSize) UnmarshalJSON

func (r *ResourceSize) UnmarshalJSON(b []byte) error

func (*ResourceSize) UnmarshalYAML

func (r *ResourceSize) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

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