loader

package
v0.0.0-...-f0fce53 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PackageConfDir = "data/binaries-conf"
	BaseAppConfDir = "manifests/init-data"
)

Variables

This section is empty.

Functions

func GenAppsYml

func GenAppsYml(pkgsDir string) error

GenAppsYml 在部署包路径上生成Apps.yml

func LoadApps

func LoadApps(categories Categories, path string) error

LoadApps 读取指定路径上的Apps.yml并生成app信息保存到数据库中, 加载应用时会将所有相同Category的应用先置为Enabled: false, 再根据Apps.yml存在的应用置为Enabled: true, 因此每次执行时会更新所有相同Category的应用

func LoadPkgs

func LoadPkgs(categories Categories, pkgsDir string) error

LoadPkgs 从部署包路径中加载应用

Types

type App

type App struct {
	Name              string        `yaml:"name"`
	ShortName         string        `yaml:"short_name"`
	Desc              string        `yaml:"desc"`
	Increment         bool          `yaml:"increment"`
	Version           string        `yaml:"version"`
	Platform          string        `yaml:"platform"`
	Category          string        `yaml:"category"`
	SupportActions    []string      `yaml:"support_actions"`
	SupportMediaTypes []string      `yaml:"support_media_types"`
	SupportGpuModels  []string      `yaml:"support_gpu_models"`
	PkgRef            string        `yaml:"pkg_ref"`
	DashboardId       string        `yaml:"dashboardid"`
	LivenessProbe     LivenessProbe `yaml:"liveness_probe"`
	Modules           []Module      `yaml:"modules"`
	Global            Global        `yaml:"global"`
}

type Apps

type Apps []App

type Arg

type Arg struct {
	Name       string      `yaml:"name"`
	ShortName  string      `yaml:"short_name"`
	Desc       string      `yaml:"desc"`
	Type       string      `yaml:"type"`
	Format     string      `yaml:"format"`
	Enum       []string    `yaml:"enum"`
	HostLimits HostLimits  `yaml:"host_limits"`
	Default    interface{} `yaml:"default"`
	Required   bool        `yaml:"required"`
	Modifiable bool        `yaml:"modifiable"`
	Readonly   bool        `yaml:"readonly"`
}

type Categories

type Categories []string

type Global

type Global struct {
	Args        []Arg    `yaml:"args"`
	Configs     []string `yaml:"configs"`
	HostAliases []string `yaml:"host_aliases"`
}

type HostLimits

type HostLimits struct {
	Max int `yaml:"max"`
	Min int `yaml:"min"`
}

type LivenessProbe

type LivenessProbe struct {
	InitialDelaySeconds int `yaml:"initial_delay_seconds"`
	PeriodSeconds       int `yaml:"period_seconds"`
	TimeoutSeconds      int `yaml:"timeout_seconds"`
}

type Module

type Module struct {
	Name              string                 `yaml:"name"`
	Desc              string                 `yaml:"desc"`
	SkipUpgrade       bool                   `yaml:"skip_upgrade"`
	Notes             string                 `yaml:"notes"`
	Args              []Arg                  `yaml:"args"`
	Configs           []string               `yaml:"configs"`
	Required          bool                   `yaml:"required"`
	EnableLogging     bool                   `yaml:"enable_logging"`
	EnablePurgeData   bool                   `yaml:"enable_purge_data"`
	Replication       bool                   `yaml:"replication"`
	Resources         Resources              `yaml:"resources"`
	HostLimits        HostLimits             `yaml:"host_limits"`
	IncludeRoles      []string               `yaml:"include_roles"`
	ExtraVars         map[string]interface{} `yaml:"extra_vars"`
	HostAliases       []string               `yaml:"host_aliases"`
	AdditionalConfigs v1.AdditionalConfigs   `yaml:"additional_configs"`
}

type Resources

type Resources struct {
	AlgorithPlugin                bool   `yaml:"algorithm_plugin"`
	SupportAlgorithmPluginsRegexp string `yaml:"support_algorithm_plugins_regexp"`
}

Jump to

Keyboard shortcuts

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