Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure db host and port from from config file #1940

Merged
merged 4 commits into from
Sep 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions backend/src/apiserver/client_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,13 @@ import (
)

const (
minioServiceHost = "MINIO_SERVICE_SERVICE_HOST"
minioServicePort = "MINIO_SERVICE_SERVICE_PORT"

mysqlServiceHost = "MYSQL_SERVICE_HOST"
mysqlServicePort = "MYSQL_SERVICE_PORT"
mysqlUser = "DBConfig.User"
mysqlPassword = "DBConfig.Password"
mysqlDBName = "DBConfig.DBName"
minioServiceHost = "MINIO_SERVICE_SERVICE_HOST"
minioServicePort = "MINIO_SERVICE_SERVICE_PORT"
mysqlServiceHost = "DBConfig.Host"
mysqlServicePort = "DBConfig.Port"
mysqlUser = "DBConfig.User"
mysqlPassword = "DBConfig.Password"
mysqlDBName = "DBConfig.DBName"

visualizationServiceHost = "ML_PIPELINE_VISUALIZATIONSERVER_SERVICE_HOST"
visualizationServicePort = "ML_PIPELINE_VISUALIZATIONSERVER_SERVICE_PORT"
Expand All @@ -66,10 +65,9 @@ type ClientManager struct {
objectStore storage.ObjectStoreInterface
wfClient workflowclient.WorkflowInterface
swfClient scheduledworkflowclient.ScheduledWorkflowInterface
podClient v1.PodInterface
podClient v1.PodInterface
time util.TimeInterface
uuid util.UUIDGeneratorInterface

}

func (c *ClientManager) ExperimentStore() storage.ExperimentStoreInterface {
Expand Down Expand Up @@ -125,8 +123,7 @@ func (c *ClientManager) UUID() util.UUIDGeneratorInterface {
}

func (c *ClientManager) init() {
glog.Infof("Initializing client manager")

glog.Info("Initializing client manager")
db := initDBClient(common.GetDurationConfig(initConnectionTimeout))

// time
Expand Down Expand Up @@ -213,8 +210,8 @@ func initMysql(driverName string, initConnectionTimeout time.Duration) string {
mysqlConfig := client.CreateMySQLConfig(
common.GetStringConfigWithDefault(mysqlUser, "root"),
common.GetStringConfigWithDefault(mysqlPassword, ""),
common.GetStringConfig(mysqlServiceHost),
common.GetStringConfig(mysqlServicePort),
common.GetStringConfigWithDefault(mysqlServiceHost, "mysql"),
common.GetStringConfigWithDefault(mysqlServicePort, "3306"),
"")

var db *sql.DB
Expand Down