-
Notifications
You must be signed in to change notification settings - Fork 448
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
feat(db-manager): configurable DB name with extra params #1462
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Subreptivus The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @Subreptivus. Thanks for your PR. I'm waiting for a kubeflow member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Thanks a lot for doing this @Subreptivus! We are still working on the manifest refactoring for the Katib: #1464. |
/hold for the review |
@Subreptivus: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Subreptivus I apologies for waiting so long on this PR.
Since we finish our manifest refactoring, please can you rebase your PR ?
} | ||
return nil, errors.New("Invalid DB Name") | ||
func NewKatibDBInterface() (common.KatibDBInterface, error) { | ||
return mysql.NewDBInterface() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that logic how we can support other DB interfaces, like Postgres
, MongoDB
?
@@ -8,8 +8,6 @@ spec: | |||
containers: | |||
- name: katib-db-manager | |||
env: | |||
- name: DB_NAME | |||
value: mysql |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can introduce another env variable, like DB_TYPE: mysql
, to define type of DB?
dbPasswordEnvName := common.DBPasswordEnvName | ||
dbPassword := os.Getenv(dbPasswordEnvName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can omit dbPasswordEnvName
var ?
dbPasswordEnvName := common.DBPasswordEnvName | |
dbPassword := os.Getenv(dbPasswordEnvName) | |
dbPassword := os.Getenv(common.DBPasswordEnvName) |
return "", fmt.Errorf("Timeout waiting for DB conn successfully opened") | ||
} | ||
} | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the script reach this else
since you verify an empty password here:
katib/cmd/db-manager/v1beta1/main.go
Line 78 in 3e2d6fc
if dbPassword == "" { |
case <-ticker.C: | ||
if db, err := sql.Open(dbDriver, mysqlConfig.FormatDSN()); err == nil { | ||
if _, err = db.Exec(fmt.Sprintf("CREATE DATABASE IF NOT EXISTS %s", dbName)); err == nil { | ||
mysqlConfig.DBName = dbName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to set DBName
here since you are doing this in the CreateMySQLConfig
:
katib/pkg/db/v1beta1/mysql/mysql.go
Line 48 in 3e2d6fc
DBName: dbName, |
@gaocegege @johnugeorge Please take a look at these changes. |
@andreyvelich I'll answer here to all those comments above, because it falls into single answer. |
I think the main problem is that As I point here: #1462 (comment), we probably should rename In any case, we should design Katib DB Manager to be able to support multiply DB backend, not only MySQL. What do you think @gaocegege @johnugeorge ? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it has not had recent activity. Please comment "/reopen" to reopen it. |
What this PR does / why we need it:
mysql
DB namemysql
DB name"DB_EXTRA_PARAMS": "{\"tls\": \"true\"}"
for secure connectionSpecial notes for your reviewer:
I may have left EnvVariables names as is, yet now it looks more cleaner, aligned with other names and less confusing
Release note: