config

package
v0.3.13 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CUDABaseImages []CUDABaseImage
View Source
var TFCompatibilityMatrix []TFCompatibility
View Source
var TorchCompatibilityMatrix []TorchCompatibility

Functions

func BaseDockerImageName added in v0.0.8

func BaseDockerImageName(projectDir string) string

BaseDockerImageName returns the Docker image name for base images

func CUDABaseImageFor added in v0.0.8

func CUDABaseImageFor(cuda string, cuDNN string) (string, error)

func DockerImageName added in v0.0.8

func DockerImageName(projectDir string) string

DockerImageName returns the default Docker image name for images

func GetProjectDir

func GetProjectDir(customDir string) (string, error)

Returns the project's root directory, or the directory specified by the --project-dir flag

func Validate added in v0.0.19

func Validate(yamlConfig string, version string) error

func ValidateConfig added in v0.0.19

func ValidateConfig(config *Config, version string) error

func ValidateSchema added in v0.0.19

func ValidateSchema(schemaLoader, dataLoader gojsonschema.JSONLoader) error

Types

type ArgumentType added in v0.0.8

type ArgumentType string
const (
	ArgumentTypeString ArgumentType = "str"
	ArgumentTypeInt    ArgumentType = "int"
	ArgumentTypeFloat  ArgumentType = "float"
	ArgumentTypeBool   ArgumentType = "bool"
	ArgumentTypePath   ArgumentType = "Path"
)

type Build added in v0.0.8

type Build struct {
	GPU                  bool     `json:"gpu,omitempty" yaml:"gpu"`
	PythonVersion        string   `json:"python_version,omitempty" yaml:"python_version"`
	PythonRequirements   string   `json:"python_requirements,omitempty" yaml:"python_requirements"`
	PythonExtraIndexURLs []string `json:"python_extra_index_urls,omitempty" yaml:"python_extra_index_urls"`
	PythonFindLinks      []string `json:"python_find_links,omitempty" yaml:"python_find_links"`
	PythonPackages       []string `json:"python_packages,omitempty" yaml:"python_packages"`
	Run                  []string `json:"run,omitempty" yaml:"run"`
	SystemPackages       []string `json:"system_packages,omitempty" yaml:"system_packages"`
	PreInstall           []string `json:"pre_install,omitempty" yaml:"pre_install"` // Deprecated, but included for backwards compatibility
	CUDA                 string   `json:"cuda,omitempty" yaml:"cuda"`
	CuDNN                string   `json:"cudnn,omitempty" yaml:"cudnn"`
}

type CUDABaseImage added in v0.0.8

type CUDABaseImage struct {
	Tag     string
	CUDA    string
	CuDNN   string
	IsDevel bool
	Ubuntu  string
}

func (*CUDABaseImage) ImageTag added in v0.0.8

func (i *CUDABaseImage) ImageTag() string

func (*CUDABaseImage) UnmarshalJSON added in v0.0.8

func (i *CUDABaseImage) UnmarshalJSON(data []byte) error

type Config added in v0.0.8

type Config struct {
	Build   *Build `json:"build" yaml:"build"`
	Image   string `json:"image,omitempty" yaml:"image"`
	Predict string `json:"predict,omitempty" yaml:"predict"`
}

func DefaultConfig added in v0.0.8

func DefaultConfig() *Config

func FromYAML added in v0.0.16

func FromYAML(contents []byte) (*Config, error)

func GetConfig

func GetConfig(customDir string) (*Config, string, error)

Loads and instantiates a Config object customDir can be specified to override the default - current working directory

func (*Config) CUDABaseImageTag added in v0.0.8

func (c *Config) CUDABaseImageTag() (string, error)

func (*Config) PythonPackagesForArch added in v0.0.8

func (c *Config) PythonPackagesForArch(goos string, goarch string) (packages []string, indexURLs []string, err error)

func (*Config) ValidateAndCompleteConfig added in v0.0.8

func (c *Config) ValidateAndCompleteConfig() error

type Example added in v0.0.8

type Example struct {
	Input  map[string]string `json:"input" yaml:"input"`
	Output string            `json:"output" yaml:"output"`
}

type Image added in v0.0.8

type Image struct {
	URI          string                  `json:"uri"`
	Created      time.Time               `json:"created"`
	RunArguments map[string]*RunArgument `json:"run_arguments"`
	TestStats    *Stats                  `json:"test_stats"`
	BuildFailed  bool                    `json:"build_failed"`
}

type RunArgument added in v0.0.8

type RunArgument struct {
	Type    ArgumentType `json:"type"`
	Default *string      `json:"default"`
	Min     *string      `json:"min"`
	Max     *string      `json:"max"`
	Options *[]string    `json:"options"`
	Help    *string      `json:"help"`
}

type Stats added in v0.0.8

type Stats struct {
	BootTime    float64 `json:"boot_time"`
	SetupTime   float64 `json:"setup_time"`
	RunTime     float64 `json:"run_time"`
	MemoryUsage uint64  `json:"memory_usage"`
	CPUUsage    float64 `json:"cpu_usage"`
}

type TFCompatibility added in v0.0.8

type TFCompatibility struct {
	TF           string
	TFCPUPackage string
	TFGPUPackage string
	CUDA         string
	CuDNN        string
	Pythons      []string
}

func (*TFCompatibility) UnmarshalJSON added in v0.0.8

func (compat *TFCompatibility) UnmarshalJSON(data []byte) error

type TorchCompatibility added in v0.0.8

type TorchCompatibility struct {
	Torch       string
	Torchvision string
	Torchaudio  string
	IndexURL    string
	CUDA        *string
	Pythons     []string
}

func (*TorchCompatibility) TorchVersion added in v0.0.8

func (c *TorchCompatibility) TorchVersion() string

func (*TorchCompatibility) TorchvisionVersion added in v0.0.8

func (c *TorchCompatibility) TorchvisionVersion() string

type Version added in v0.0.8

type Version struct {
	ID       string            `json:"id"`
	Config   *Config           `json:"config"`
	Created  time.Time         `json:"created"`
	BuildIDs map[string]string `json:"build_ids"`
}

Jump to

Keyboard shortcuts

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