config

package
v0.0.0-...-58c3220 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LocalBackendType  = "local"
	ConfigBackendType = "config"
)
View Source
const (
	NvidiaResourceName                      = "nvidia.com/gpu"
	RepositoryKubernetesType RepositoryType = "kubernetes"
	RepositoryVaultType      RepositoryType = "vault"
	RepositoryMemoryType     RepositoryType = "memory"
	RepositoryPostgresType   RepositoryType = "postgres"

	StoragePostgres StorageType = "postgres"
)

Variables

View Source
var (
	CfgFile string
)

Functions

func InitBasicParams

func InitBasicParams(cmd *cobra.Command)

func PanicIfError

func PanicIfError(err error)

Types

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 BatchConfig

type BatchConfig struct {
	// Kubernetes namespace, where BatchInferenceService and BatchInferenceJob will be created
	Namespace string `json:"namespace"`
	// Enable batch API/operator
	Enabled bool `json:"enabled"`
	// Node pools to run batch jobs
	NodePools []NodePool `json:"nodePools"`
	// Kubernetes tolerations for batch jobs
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
	// Timeout for full batch process
	Timeout time.Duration `json:"timeout"`
	// RClone image that will be used to sync data with object storage
	RCloneImage string `json:"rcloneImage"`
	// ODAHU tools image
	ToolsImage string `json:"toolsImage"`
	// ODAHU tools image
	ToolsSecret string `json:"toolsSecret"`
	// Specifies a ServiceAccount object that provides custom credentials for executing the TaskRun
	ServiceAccountName string `json:"serviceAccountName"`
}

func NewDefaultBatchConfig

func NewDefaultBatchConfig() BatchConfig

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"`
	// OpenID token url
	OAuthOIDCTokenEndpoint string `json:"oauthOidcTokenEndpoint"`
	// How often launch new training
	LaunchPeriod time.Duration `json:"launchPeriod"`
	// Graceful shutdown timeout
	GracefulTimeout time.Duration `json:"gracefulTimeout"`
}

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"`
	Batch          BatchConfig           `json:"batch"`
}

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 FeedbackConfig

type FeedbackConfig struct {
	Fluentd FluentdConfig `json:"fluentd"`
}

type FluentdConfig

type FluentdConfig struct {
	BaseURL string `json:"baseURL"`
}

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"`
	// Node pools to run deployments
	NodePools []NodePool `json:"nodePools"`
	// Kubernetes tolerations for model deployments
	Tolerations []corev1.Toleration        `json:"tolerations,omitempty"`
	Istio       ModelDeploymentIstioConfig `json:"istio"`
	// Default resources for deployment pods
	DefaultResources odahuflowv1alpha1.ResourceRequirements `json:"defaultResources"`
	// Custom Route prefix for model deployments
	CustomRoutePrefix string `json:"customRoutePrefix"`
}

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"`
	// Node pools to run packaging tasks on
	NodePools []NodePool `json:"nodePools"`
	// Kubernetes tolerations for model packaging pods
	Tolerations        []corev1.Toleration `json:"tolerations,omitempty"`
	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"`

	// Node pools to run training tasks on
	NodePools []NodePool `json:"nodePools"`
	// Kubernetes tolerations for model trainings pods
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
	// Node pools to run GPU training tasks on
	GPUNodePools []NodePool `json:"gpuNodePools"`
	// Kubernetes tolerations for GPU model trainings pods
	GPUTolerations []corev1.Toleration `json:"gpuTolerations,omitempty"`

	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 NodePool

type NodePool struct {
	NodeSelector map[string]string `json:"nodeSelector"`
	Tags         []string          `json:"tags"`
}

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

type ServiceCatalog

type ServiceCatalog struct {
	// Auth configures connection parameters to ODAHU API Server
	Auth AuthConfig `json:"auth"`
	// BaseURL is a prefix to service catalog web server endpoints
	BaseURL string `json:"baseUrl"`
	// FetchTimeout configures how often new events will be fetched. Default 5 seconds.
	FetchTimeout int `json:"fetchTimeout"`
	// ServiceCatalog uses EdgeURL to call MLServer by adding ModelRoute prefix to EdgeURL path
	EdgeURL string `json:"edgeURL"`
	// ServiceCatalog set EdgeHost as Host header in requests to ML servers
	EdgeHost string `json:"edgeHost"`
	// WorkersCount configures how many workers will process events. Default: 4
	WorkersCount int `json:"workersCount"`
	// enabled Debug increase logger verbosity and format. Default: false
	Debug bool `json:"debug"`
}

func NewDefaultServiceCatalogConfig

func NewDefaultServiceCatalogConfig() ServiceCatalog

type StorageType

type StorageType string

type ToolsConfig

type ToolsConfig struct {
	Auth     AuthConfig     `json:"auth"`
	Feedback FeedbackConfig `json:"feedback"`
}

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"`
	// Can be used to debug and local development. Skip TLS verification
	Insecure bool `json:"insecure"`
}

Jump to

Keyboard shortcuts

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