Back to godoc.org

Package config

v0.0.0-...-afdeb59
Latest Go to latest

The latest major version is .

Published: Jul 3, 2020 | License: Apache-2.0 | Module: github.com/odahu/odahu-flow/packages/operator

Index

Constants

const (
	LocalBackendType  = "local"
	ConfigBackendType = "config"
)
const (
	TolerationKey      = "key"
	TolerationOperator = "operator"
	TolerationValue    = "value"
	TolerationEffect   = "effect"
)

Variables

var (
	CfgFile string
)

func InitBasicParams

func InitBasicParams(cmd *cobra.Command)

func PanicIfError

func PanicIfError(err error)

type APIBackendConfig

type APIBackendConfig struct {
	// Type of the backend. Available values:
	//    * local
	//    * config
	Type string `json:"type"`
	// Local backend
	Local APILocalBackendConfig `json:"local"`
}

type APIConfig

type APIConfig struct {
	Backend APIBackendConfig `json:"backend"`
	// API HTTP port
	Port int `json:"port"`
}

func NewDefaultAPIConfig

func NewDefaultAPIConfig() APIConfig

type APILocalBackendConfig

type APILocalBackendConfig struct {
	// Path to a dir with ODAHU CRDs
	LocalBackendCRDPath string `json:"localBackendCrdPath"`
}

type AuthConfig

type AuthConfig struct {
	// ODAHU API URL
	APIURL string `json:"apiUrl"`
	// It is a mock for the future. Currently, it is always empty.
	APIToken string `json:"apiToken"`
	// OpenID client_id credential for service account
	ClientID string `json:"clientId"`
	// OpenID client_secret credential for service account
	ClientSecret string `json:"clientSecret"`
	// OpenID token url
	OAuthOIDCTokenEndpoint string `json:"oauthOidcTokenEndpoint"`
}

type Claims

type Claims struct {
	Name  string `json:"name"`
	Email string `json:"email"`
}

type CommonConfig

type CommonConfig struct {
	// The collection of external urls, for example: metrics, edge, service catalog and so on
	ExternalURLs []ExternalUrl `json:"externalUrls"`
	// Kubernetes can consume the GPU resource in the <vendor>.com/gpu format.
	// For example, amd.com/gpu or nvidia.com/gpu.
	ResourceGPUName string `json:"resourceGpuName"`
	// Version of ODAHU platform
	Version string `json:"version"`
	// Database connection string
	DatabaseConnectionString string `json:"databaseConnectionString"`
}

func NewDefaultCommonConfig

func NewDefaultCommonConfig() CommonConfig

type Config

type Config struct {
	API            APIConfig             `json:"api"`
	Common         CommonConfig          `json:"common"`
	Users          UserConfig            `json:"users"`
	Connection     ConnectionConfig      `json:"connection"`
	Deployment     ModelDeploymentConfig `json:"deployment"`
	ServiceCatalog ServiceCatalog        `json:"serviceCatalog"`
	Trainer        TrainerConfig         `json:"trainer"`
	Packager       PackagerConfig        `json:"packager"`
	Training       ModelTrainingConfig   `json:"training"`
	Packaging      ModelPackagingConfig  `json:"packaging"`
	Operator       OperatorConfig        `json:"operator"`
}

func LoadConfig

func LoadConfig() (*Config, error)

func MustLoadConfig

func MustLoadConfig() *Config

func NewDefaultConfig

func NewDefaultConfig() *Config

func (Config) CleanupSensitiveFields

func (c Config) CleanupSensitiveFields() Config

Remove sensitive fields from config

type ConnectionConfig

type ConnectionConfig struct {
	// Enable connection API/operator
	Namespace string `json:"namespace"`
	// Connection API server and operator are enabled
	Enabled bool `json:"enabled"`
	// Storage backend for connections. Available options:
	//   * kubernetes
	//   * vault
	RepositoryType RepositoryType `json:"repositoryType"`
	// Connection Vault configuration
	Vault Vault `json:"vault"`
}

func NewDefaultConnectionConfig

func NewDefaultConnectionConfig() ConnectionConfig

type EdgeConfig

type EdgeConfig struct {
	// External model host
	Host string `json:"host"`
}

type ExternalUrl

type ExternalUrl struct {
	// Human readable name
	Name string `json:"name"`
	// Link to a resource
	URL string `json:"url"`
	// Optional link to an image which represents a type of the resource, for example the logo of Grafana
	ImageURL string `json:"imageUrl"`
}

type JWKS

type JWKS struct {
	// JWKS URL
	URL string `json:"url"`
	// Issuer claim value
	Issuer string `json:"issuer"`
	// Model authorization enabled
	Enabled bool `json:"enabled"`
}

type ModelDeploymentConfig

type ModelDeploymentConfig struct {
	// Kubernetes namespace, where model deployments will be deployed
	Namespace string `json:"namespace"`
	// Enable deployment API/operator
	Enabled  bool                          `json:"enabled"`
	Security ModelDeploymentSecurityConfig `json:"security"`
	// Default connection ID which will be used if a user doesn't specify it in a model deployment
	DefaultDockerPullConnName string     `json:"defaultDockerPullConnName"`
	Edge                      EdgeConfig `json:"edge"`
	// Kubernetes node selector for model deployments
	NodeSelector map[string]string `json:"nodeSelector"`
	// Kubernetes tolerations for model deployments
	Toleration map[string]string          `json:"toleration"`
	Istio      ModelDeploymentIstioConfig `json:"istio"`
	// Default resources for deployment pods
	DefaultResources odahuflowv1alpha1.ResourceRequirements `json:"defaultResources"`
}

func NewDefaultModelDeploymentConfig

func NewDefaultModelDeploymentConfig() ModelDeploymentConfig

type ModelDeploymentIstioConfig

type ModelDeploymentIstioConfig struct {
	// Istio ingress gateway service name
	ServiceName string `json:"serviceName"`
	// Istio ingress gateway namespace
	Namespace string `json:"namespace"`
}

type ModelDeploymentSecurityConfig

type ModelDeploymentSecurityConfig struct {
	JWKS JWKS `json:"jwks"`
	// Deprecated
	RoleName string `json:"roleName"`
}

type ModelPackagingConfig

type ModelPackagingConfig struct {
	// Kubernetes namespace, where model trainings will be deployed
	Namespace                     string `json:"namespace"`
	PackagingIntegrationNamespace string `json:"packagerIntegrationNamespace"`
	// Enable packaging API/operator
	Enabled            bool   `json:"enabled"`
	ServiceAccount     string `json:"serviceAccount"`
	OutputConnectionID string `json:"outputConnectionID"`
	// Kubernetes node selectors for model packaging pods
	NodeSelector map[string]string `json:"nodeSelector"`
	// Kubernetes tolerations for model packaging pods
	Toleration         map[string]string `json:"toleration"`
	ModelPackagerImage string            `json:"modelPackagerImage"`
	// Timeout for full training process
	Timeout time.Duration `json:"timeout"`
	// Default resources for packaging pods
	DefaultResources odahuflowv1alpha1.ResourceRequirements `json:"defaultResources"`

	// Storage backend for packaging integrations. Available options:
	//   * kubernetes
	//   * postgres
	PackagingIntegrationRepositoryType RepositoryType `json:"packagingIntegrationRepositoryType"`
}

func NewDefaultModelPackagingConfig

func NewDefaultModelPackagingConfig() ModelPackagingConfig

type ModelTrainingConfig

type ModelTrainingConfig struct {
	// Kubernetes namespace, where model trainings will be deployed
	Namespace                     string `json:"namespace"`
	ToolchainIntegrationNamespace string `json:"toolchainIntegrationNamespace"`
	// Enable deployment API/operator
	Enabled            bool              `json:"enabled"`
	ServiceAccount     string            `json:"serviceAccount"`
	OutputConnectionID string            `json:"outputConnectionID"`
	NodeSelector       map[string]string `json:"nodeSelector"`
	// Kubernetes tolerations for model trainings pods
	Toleration      map[string]string `json:"toleration"`
	GPUNodeSelector map[string]string `json:"gpuNodeSelector"`
	// Kubernetes tolerations for GPU model trainings pods
	GPUToleration     map[string]string `json:"gpuToleration"`
	MetricURL         string            `json:"metricUrl"`
	ModelTrainerImage string            `json:"modelTrainerImage"`
	// Timeout for full training process
	Timeout time.Duration `json:"timeout"`
	// Default resources for training pods
	DefaultResources odahuflowv1alpha1.ResourceRequirements `json:"defaultResources"`

	// Storage backend for toolchain integrations. Available options:
	//   * kubernetes
	//   * postgres
	ToolchainIntegrationRepositoryType RepositoryType `json:"toolchainIntegrationRepositoryType"`
}

func NewDefaultModelTrainingConfig

func NewDefaultModelTrainingConfig() ModelTrainingConfig

type OperatorConfig

type OperatorConfig struct {
	Auth AuthConfig `json:"auth"`
	// Operator HTTP monitoring port
	MonitoringPort int `json:"monitoringPort"`
}

func NewDefaultOperatorConfig

func NewDefaultOperatorConfig() OperatorConfig

type PackagerConfig

type PackagerConfig struct {
	Auth AuthConfig `json:"auth"`
	// The path to the configuration file for a user packager.
	MPFile string `json:"mpFile"`
	// ID of the model packaging
	ModelPackagingID string `json:"modelTrainingId"`
	// The path to the dir when a user packager will save their result.
	OutputDir string `json:"outputDir"`
}

func NewDefaultPackagerConfig

func NewDefaultPackagerConfig() PackagerConfig

type RepositoryType

type RepositoryType string
const (
	NvidiaResourceName                      = "nvidia.com/gpu"
	RepositoryKubernetesType RepositoryType = "kubernetes"
	RepositoryVaultType      RepositoryType = "vault"
	RepositoryPostgresType   RepositoryType = "postgres"
)

type ServiceCatalog

type ServiceCatalog struct {
	BaseURL string `json:"baseUrl"`
}

func NewDefaultServiceCatalogConfig

func NewDefaultServiceCatalogConfig() ServiceCatalog

type TrainerConfig

type TrainerConfig struct {
	Auth AuthConfig `json:"auth"`
	// The path to the configuration file for a user trainer.
	MTFile string `json:"mtFile"`
	// ID of the model training
	ModelTrainingID string `json:"modelTrainingId"`
	// The path to the dir when a user trainer will save their result.
	OutputDir string `json:"outputDir"`
}

func NewDefaultTrainerConfig

func NewDefaultTrainerConfig() TrainerConfig

type UserConfig

type UserConfig struct {
	Claims Claims `json:"claims"`
	// The sign out endpoint logs out the authenticated user.
	SignOutURL string `json:"signOutUrl"`
}

func NewDefaultUserConfig

func NewDefaultUserConfig() UserConfig

type Vault

type Vault struct {
	// Vault URL
	URL string `json:"url"`
	// Vault secret engine path where connection will be stored
	SecretEnginePath string `json:"secretEnginePath"`
	// Vault role for access to the secret engine path
	Role string `json:"role"`
	// Optionally. Token for access to the vault server
	// If it is empty then client will use the k8s auth
	Token string `json:"token"`
}

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier