yaml

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceTypeNodePort = "node-port"
)

Variables

This section is empty.

Functions

func GetNetSegment added in v0.7.0

func GetNetSegment() ([]string, error)

Types

type Compute

type Compute struct {
	Resources struct {
		Cpu struct {
			Units string `yaml:"units"`
		} `yaml:"cpu"`
		Memory struct {
			Size string `yaml:"size"`
		} `yaml:"memory"`
		Storage struct {
			Size string `yaml:"size"`
		} `yaml:"storage"`
		Gpu struct {
			Model string `yaml:"model"`
			Units string `yaml:"units"`
			Size  string `yaml:"size"`
		} `yaml:"gpu"`
	} `yaml:"resources"`
}

type ConfigFile

type ConfigFile struct {
	Name string
	Path string
}

type ContainerResource

type ContainerResource struct {
	Name          string
	Count         int
	ImageName     string
	Command       []string
	Args          []string
	Env           []corev1.EnvVar
	Ports         []corev1.ContainerPort
	ResourceLimit corev1.ResourceList
	VolumeMounts  ConfigFile
	Depends       []ContainerResource
	ReadyCmd      []string
	GpuModel      string
	Models        []ModelResource
	ServiceType   string
}

func HandlerYaml

func HandlerYaml(yamlFilePath string) ([]ContainerResource, error)

type DeployYamlV2

type DeployYamlV2 struct {
	Version     string                `yaml:"version"`
	ServiceType string                `yaml:"type"`
	Services    map[string]Service    `yaml:"services"`
	Profiles    Profiles              `yaml:"profiles"`
	Deployment  map[string]Deployment `yaml:"deployment"`
}

func (*DeployYamlV2) ServiceToK8sResource

func (dy *DeployYamlV2) ServiceToK8sResource() ([]ContainerResource, error)

type Deployment

type Deployment struct {
	Akash struct {
		Profile string `yaml:"profile"`
		Count   int    `yaml:"count"`
	} `yaml:"akash"`
	Lagrange struct {
		Profile string `yaml:"profile"`
		Count   int    `yaml:"count"`
	} `yaml:"lagrange"`
}

type EthernetConfig added in v0.7.0

type EthernetConfig struct {
	DHCP4       bool     `yaml:"dhcp4,omitempty"`
	Addresses   []string `yaml:"addresses,omitempty"`
	Gateway4    string   `yaml:"gateway4,omitempty"`
	Nameservers struct {
		Addresses []string `yaml:"addresses,omitempty"`
		Search    []string `yaml:"search,omitempty"`
	} `yaml:"nameservers,omitempty"`
}

type Expose

type Expose struct {
	Port int `yaml:"port"`
	To   []struct {
		Global bool `yaml:"global"`
	} `yaml:"to"`
	As       int    `yaml:"as"`
	Protocol string `yaml:"protocol"`
}

type ModelResource

type ModelResource struct {
	Name string `yaml:"name"`
	Url  string `yaml:"url"`
	Dir  string `yaml:"dir"`
}

type NetplanConfig added in v0.7.0

type NetplanConfig struct {
	Network struct {
		Ethernets map[string]EthernetConfig `yaml:"ethernets"`
		Version   int                       `yaml:"version"`
	} `yaml:"network"`
}

type Parser

type Parser interface {
	Parse(yamlFile []byte) error
	GetConfig() interface{}
}

type ParserYamlV2

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

func (*ParserYamlV2) GetConfig

func (p *ParserYamlV2) GetConfig() interface{}

func (*ParserYamlV2) Parse

func (p *ParserYamlV2) Parse(yamlFile []byte) error

type Profiles

type Profiles struct {
	Compute map[string]Compute `yaml:"compute"`
}

type Service

type Service struct {
	Name      string
	Image     string   `yaml:"image"`
	Command   []string `yaml:"command"`
	Args      []string `yaml:"args"`
	Env       []string `yaml:"env"`
	Expose    []Expose `yaml:"expose"`
	DependsOn []string `yaml:"depends-on"`
	Config    struct {
		Name string `yaml:"name"`
		Path string `yaml:"path"`
	} `yaml:"config"`
	ReadyCmd []string        `yaml:"ready-cmd"`
	Models   []ModelResource `yaml:"models"`
}

type Version

type Version struct {
	Version string `yaml:"version"`
}

Jump to

Keyboard shortcuts

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