yaml

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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
}

func HandlerYaml

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

type DeployYamlV2

type DeployYamlV2 struct {
	Version    string                `yaml:"version"`
	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 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 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