-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(deployment): add option to deploy mysql in KFP standalone #9855
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
Conversation
part of #9813 |
/test kubeflow-pipeline-e2e-test |
dbHost: postgres | ||
dbPort: "5432" |
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.
Can we avoid reusing the same variable name for both mysql config and postgresql config?
In the installs/generic/pipeline-install-config.yaml
file, you defined mysqlHost
, so we can use the same approach to name postgresqlConfigDbName
or something similar.
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.
Thank you for catching this. I should have added the postgres counterpart for the db config. The original parameters dbType
and dbHost
are kept for now because the v2 images these manifests use still call for them. They should be removed after we release the new images.
dbHost: mysql # relic to be removed after release | ||
dbPort: "3306" # relic to be removed after release | ||
dbType: mysql | ||
mysqlHost: 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.
NIT: Do we want to name the new mysqlPort
key to be something similar to the definition in
"DBName": "mlpipeline", |
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.
Sorry, I'm not sure understand. Did you mean to name it something like DBConfig.MySQLConfig.Port
?
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.
That is right, because it is a configmap, you can call it like dbconfig_mysqlconfig_port
.
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.
I'm not sure about this. The rest of the variable names are not consistent with their counterparts in config.json
either. If we change all of them, this might lead to more backward compatibility issues.
secretKeyRef: | ||
name: postgres-secret | ||
key: username | ||
optional: true |
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.
If postgresql is chosen as the driver DB, the flags here are not optional, but the mysql flags are optional.
Maybe consider using a patch to include postgresql flag in the platform-agnostic-postgresql overlay?
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.
Thank you, I didn't think of this idea. I have changed the code so the mysql parameters are only required in default deployment, and postgres parameters are only required when postgres is used. I will commit after the local test passes.
/test kubeflow-pipeline-e2e-test |
/test kubeflow-pipeline-e2e-test |
@@ -11,7 +11,7 @@ data: | |||
until the changes take effect. A quick way to restart all deployments in a | |||
namespace: `kubectl rollout restart deployment -n <your-namespace>`. | |||
appName: pipeline | |||
appVersion: 2.0.0 | |||
appVersion: 2.0.1 |
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.
It seems that we should still use 2.0.0
for the consistency across repo.
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.
This was changed due to version 2.0.1 was released yesterday, see #9899.
bases: | ||
- ../metadata-writer | ||
resources: | ||
- ml-pipeline-apiserver-deployment.yaml |
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.
Using patches in kustomization.yaml can make this file much simpler: https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/patches/
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
- ../metadata-writer
- ../
patches:
- ml-pipeline-apiserver-deployment-patch.yaml
ml-pipeline-apiserver-deployment-patch.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: ml-pipeline
spec:
template:
spec:
containers:
- name: DB_DRIVER_NAME
valueFrom:
configMapKeyRef:
name: pipeline-install-config
key: dbType
# PostgreSQL Config
- name: DBCONFIG_POSTGRESQLCONFIG_USER
valueFrom:
secretKeyRef:
name: postgres-secret
key: username
- name: DBCONFIG_POSTGRESQLCONFIG_PASSWORD
valueFrom:
secretKeyRef:
name: postgres-secret
key: password
- name: DBCONFIG_POSTGRESQLCONFIG_DBNAME
valueFrom:
configMapKeyRef:
name: pipeline-install-config
key: pipelineDb
- name: DBCONFIG_POSTGRESQLCONFIG_HOST
valueFrom:
configMapKeyRef:
name: pipeline-install-config
key: postgresHost
- name: DBCONFIG_POSTGRESQLCONFIG_PORT
valueFrom:
configMapKeyRef:
name: pipeline-install-config
key: postgresPort
# end of PostgreSQL variables
name: ml-pipeline-api-server
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.
They are still slightly different, because ml-pipeline-apiserver-deployment.yaml
in the parent folder also includes some MySQL specific parameters, which are not needed in a PostgreSQL deployment.
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.
/lgtm
Awesome work Lingqing! Pending for test to pass and remaining comments to address.
/lgtm Thank you so much Lingqing! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: zijianjoy The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…low#9855) * add option to deploy mysql * fix deployment errors * remove temp code in development * keep mysql deployment path same as before * change the generic folder * manifest error * revert default cache path * address comments
…low#9855) * add option to deploy mysql * fix deployment errors * remove temp code in development * keep mysql deployment path same as before * change the generic folder * manifest error * revert default cache path * address comments
Description of your changes:
After merging this PR, users who deploy KFP standalone with MySQL will use the same commands as before:
With PostgreSQL, the command is slightly different:
Using this method instead of letting user change their config in pipeline-install-config.yaml, because Kustomize does not allow conditional deployment (as far as I can find).
To-Do:
ml-pipeline-apiserver-deployment.yaml
Checklist: