config

package
v0.0.0-...-18f9a63 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: Apache-2.0, CC-BY-4.0, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PortKey is a key for looking up the Port setting in the viper config.
	PortKey = "port"
	// ObjectStoreKey is a key for looking up the ObjectStore setting in the viper config.
	ObjectStoreKey = "objectstore"
	// LogLevelKey is a key for looking up the LogLevel setting in the viper config.
	LogLevelKey = "loglevel"
	// EnvKey is a key for looking up the Environment setting in the viper config.
	EnvKey = "env"
	// DNSServerKey is a key for looking up the DNS server setting in the viper config.
	DNSServerKey = "dns_server"
	// ETCDEndpoints ...
	ETCDEndpoints = "etcd.address"
	//ETCDUsername ...
	ETCDUsername = "etcd.username"
	//ETCDPassword ...
	ETCDPassword = "etcd.password"
	//ETCDPrefix ...
	ETCDPrefix = "etcd.prefix"

	// TLSKey is the config key for looking up whether TLS is enabled.
	TLSKey = "tls"
	// ServerCertKey is the config key for the TLS server certificate.
	ServerCertKey = "server_cert"
	// ServerPrivateKey is the config key for the TLS server private key.
	ServerPrivateKey = "server_private_key"
	// ServerNameKey is the config key for the TLS cert server name.
	ServerNameKey = "server_name"
	// CACertKey is the config key for the TLS cert authority.
	CACertKey = "ca_cert"

	// DLaaS image tag key is the config key that indicates which DLAAS images to use
	DLaaSImageTagKey = "image_tag"

	// ServiceTagKey is the config key that indicates the namespace under which the services are deployed.
	ServicesTagKey = "image_tag"

	// LearnerTagKey is the config key that indicates which learner images to use.
	LearnerTagKey = "learner_tag"

	// DataBrokerTagKey is the config key that indicates which data broker images to use.
	DataBrokerTagKey = "databroker_tag"

	// IBMDockerRegistryKey is the config key for the docker registry to use for hybrid deployments.
	IBMDockerRegistryKey = "ibm_docker_registry"

	// LearnerRegistryKey is the config key for the docker registry to use.
	LearnerRegistryKey = "learner_registry"

	// LearnerImagePullSecretKey is the config key for docker registry pull secret
	LearnerImagePullSecretKey = "learner_image_pull_secret"

	//Use by LCM to know where it is deployed
	LCMDeploymentKey = "lcm_deployment"

	// HybridEnv denotes a hybrid deployment on minikube and remote cluster. Used by LCM only
	HybridEnv = "hybrid"
	// LocalEnv denotes the value for the "local" environment configuration (non-Softlayer)
	LocalEnv = "local"
	// DevelopmentEnv denotes the value for the "development" SL environment configuration
	DevelopmentEnv = "development"
	// StagingEnv denotes the value for the "staging" SL environment configuration
	StagingEnv = "staging"
	// ProductionEnv denotes the value for the "production" SL environment configuration
	ProductionEnv = "production"

	LoggingType = "logging_type"

	LoggingTypeJson = "json"
	LoggingTypeText = "text"

	//PushMetricsEnabled whether push based metrics is enabled
	PushMetricsEnabled = "push_metrics_enabled"

	PodName = "pod.name"

	// PodNamespaceKey is the key to find the K8S namespace a pod is running in.
	PodNamespaceKey = "pod.namespace"

	// LearnerNamespaceKey is the key to find the K8S namespace learners are supposed to run in.
	LearnerKubeNamespaceKey = "learner.kube.namespace"

	// This is temporary until we support specifying storage requirements in the manifest.
	VolumeSize = "external_volume_size"

	// TODO this a duplication with the storage package - needs to align
	UsernameKey = "user_name"
	PasswordKey = "password"
	AuthURLKey  = "auth_url"
	DomainKey   = "domain_name"
	RegionKey   = "region"
	ProjectKey  = "project_id"
	StorageType = "type"

	DebugLearnerOptions = "learner.debug"
	// possible value for DebugLearnerOptions
	// learner pods should not be cleaned up
	NoCleanup = "nocleanup"

	DlaasResourceLimit          = "resource.limit"
	DlaasResourceLimitQuerySize = "resource.limit.query.size"

	// FfDL Change: next 5 lines
	ImagePullPolicy = "image_pull_policy"

	SharedVolumeStorageClassKey = "shared_volume_storage_class"
)

Variables

This section is empty.

Functions

func CheckPushGatewayEnabled

func CheckPushGatewayEnabled() bool

CheckPushGatewayEnabled ... for sending out metrics

func DisableDNSServer

func DisableDNSServer()

DisableDNSServer disables the DNS server in the global config. This is usefule for testing.

func FatalOnAbsentKey

func FatalOnAbsentKey(key string)

FatalOnAbsentKey fails if the key is absent.

func FatalOnAbsentKeyInMap

func FatalOnAbsentKeyInMap(key string, conf map[string]string)

FatalOnAbsentKeyInMap fails if the key is absent in the conf map.

func FatalOnAbsentKeysets

func FatalOnAbsentKeysets(keyset1 []string, keyset2 []string)

FatalOnAbsentKeysets fatals if either set of keys is not set correctly. (i.e., keys of `keyset1` xor `keyset2` are not set)

func GetCAKey

func GetCAKey() string

GetCAKey gets the CA certificate file name for clients to use

func GetCurrentLearnerConfigLocation

func GetCurrentLearnerConfigLocation(name string, version string) string

func GetCurrentLearnerConfigLocationFromCombination

func GetCurrentLearnerConfigLocationFromCombination(nameversion string) string

func GetDataStoreConfig

func GetDataStoreConfig() map[string]string

GetDataStoreConfig returns the configuration for the internal data store used to store model configuration, trained models, etc. TODO rename this config to data_store later

func GetDataStoreType

func GetDataStoreType() string

GetDataStoreType returns the configuration type for the internal data store.

func GetDebugLearnerOptions

func GetDebugLearnerOptions() string

GetDebugLearnerOptions returns comma separated list of options for debugging learners

func GetDevicePlugin

func GetDevicePlugin() bool

func GetEtcdCertLocation

func GetEtcdCertLocation() string

GetEtcdCertLocation ...

func GetEtcdEndpoints

func GetEtcdEndpoints() []string

GetEtcdEndpoints ...

func GetEtcdPassword

func GetEtcdPassword() string

GetEtcdPassword ...

func GetEtcdPrefix

func GetEtcdPrefix() string

GetEtcdPrefix ...

func GetEtcdUsername

func GetEtcdUsername() string

GetEtcdUsername ...

func GetFileContents

func GetFileContents(filename string) string

Return the contents of a file. Return an empty string if the file doesn't exist or can't be read.

func GetFloat64

func GetFloat64(key string) float64

GetFloat64 returns the float64 value for the config key.

func GetInt

func GetInt(key string) int

GetInt returns the int value for the config key.

func GetInt64

func GetInt64(key string) int64

GetInt64 returns the int64 value for the config key.

func GetLearnerKubeCAFile

func GetLearnerKubeCAFile() string

GetLearnerKubeCAFile ...

func GetLearnerKubeCertFile

func GetLearnerKubeCertFile() string

GetLearnerKubeCertFile ...

func GetLearnerKubeKeyFile

func GetLearnerKubeKeyFile() string

GetLearnerKubeKeyFile ...

func GetLearnerKubeToken

func GetLearnerKubeToken() string

GetLearnerKubeToken ...

func GetLearnerKubeTokenFile

func GetLearnerKubeTokenFile() string

GetLearnerKubeTokenFile ...

func GetLearnerKubeURL

func GetLearnerKubeURL() string

GetLearnerKubeURL ...

func GetLearnerNamespace

func GetLearnerNamespace() string

GetLearnerNamespace gets the namespace where the learners should run.

func GetLogCollectorMemInMB

func GetLogCollectorMemInMB() int

func GetLogCollectorMilliCPU

func GetLogCollectorMilliCPU() int

func GetMongoCertLocation

func GetMongoCertLocation() string

GetMongoCertLocation ...

func GetPodName

func GetPodName() string

func GetPodNamespace

func GetPodNamespace() string

GetPodNamespace gets the namespace of a POD or returns the default one.

func GetPodNamespaceForPrometheus

func GetPodNamespaceForPrometheus() string

func GetPushgatewayURL

func GetPushgatewayURL() string

GetPushgatewayURL ...

func GetResourceLimit

func GetResourceLimit() int

GetResourceLimit ...

func GetResourceLimitQuerySize

func GetResourceLimitQuerySize() int

GetResourceLimitQuerySize ...

func GetServerCert

func GetServerCert() string

GetServerCert gets the server's TLS certificate file name.

func GetServerName

func GetServerName() string

GetServerName gets the server name that is encoded in the TLS certificate.

func GetServerPrivateKey

func GetServerPrivateKey() string

GetServerPrivateKey gets the private key file name of the server.

func GetString

func GetString(key string) string

GetString returns the string value for the config key.

func GetTrainingDataMemInMB

func GetTrainingDataMemInMB() int

func GetValue

func GetValue(key string) string

GetValue returns the value associated with the given config key.

func GetVolumeSize

func GetVolumeSize() int64

GetVolumeSize returns the size (in bytes) of the external volume to use. If 0, don't use an external volume.

func InitViper

func InitViper()

InitViper is initializing the configuration system

func IsTLSEnabled

func IsTLSEnabled() bool

IsTLSEnabled is true if the microservices should all use TLS for communiction, otherwise it is false.

func LogStackTrace

func LogStackTrace()

func SetDefault

func SetDefault(key string, value interface{})

SetDefault sets the default value for the config key.

Types

This section is empty.

Jump to

Keyboard shortcuts

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