config

package
v0.0.0-...-c641a3c Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2019 License: Apache-2.0 Imports: 11 Imported by: 43

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"

	// LearnerKubeServiceAccount is the key to find the K8S ServiceAccount that learners will use in order to be assigned a PodSecurityPolicy (ICP)
	LearnerKubeServiceAccount = "learner.kube.serviceaccount"

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

	// TODO this a duplication witht 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"

	TrainerServiceName     = "trainer.service.name"
	LCMServiceName         = "lcm.service.name"
	RatelimiterServiceName = "ratelimiter.service.name"
	TDSServiceName         = "tds.service.name"

	// If this is true, the LCM will use the non-split configuration,
	// and will use the host mount on the nodes for logs and emetrics
	// (and control data), and will launch fluentd on each node.
	// Will be DLAAS_LCM_FLUENT_EMETRICS_ENABLE in environment.
	LcmFluentdEmetricsEnable = "lcm.fluentd.emetrics.enable"

	// If this is true, the log collectors will still push to
	// the tds.  If it is false, the emetrics 1.0 will not be pushed
	// to the tds, and the 1.0 files will not be written to the
	// user's COS.  The emetrics 2.0.0 files will be written in
	// in either case, for pickup by the fluentd collectors on
	// each node.
	// Will be DLAAS_LOGCOLLECTOR_EMETRICS_TDS_PUSH_ENABLED in environment.
	LogcollectorEmetricsTdsPushEnabled = "logcollector.emetrics.tds.push.enabled"

	// The serviceaccount that LCM and jobmonitor uses, which has permissions to get pods
	LCMServiceAccount = "lcm.serviceaccount"

	// Secret name for LCM secrets
	LCMSecretName = "lcm.secret"

	// Secret name for LCM secrets
	SSLSecretName = "ssl.secret"

	// FfDLExtendedEnabled tells if we should be using FfDL extended learner mechanism
	FfDLExtendedEnabled = "ffdl.extended"
)

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 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 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 GetLCMSecret

func GetLCMSecret() string

GetLCMSecret ...

func GetLCMServiceAccount

func GetLCMServiceAccount() string

GetLCMServiceAccount ...

func GetLCMServiceName

func GetLCMServiceName() string

GetLCMServiceName ...

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 GetLearnerServiceAccount

func GetLearnerServiceAccount() string

GetLearnerServiceAccount gets the serviceaccount that learners will use to be assigned a PodSecurityPolicy (ICP)

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 GetRatelimiterServiceName

func GetRatelimiterServiceName() string

GetRatelimiterServiceName ...

func GetResourceLimit

func GetResourceLimit() int

GetResourceLimit ...

func GetResourceLimitQuerySize

func GetResourceLimitQuerySize() int

GetResourceLimitQuerySize ...

func GetSSLSecret

func GetSSLSecret() string

GetSSLSecret ...

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 GetTDSServiceName

func GetTDSServiceName() string

GetTDSServiceName ...

func GetTrainerServiceName

func GetTrainerServiceName() string

GetTrainerServiceName ...

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 IsFfDLExtendedEnabled

func IsFfDLExtendedEnabled() bool

func IsTLSEnabled

func IsTLSEnabled() bool

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

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