Skip to content

Conversation

@kaikaila
Copy link
Contributor

Overview

This PR adds Makefile targets and helper scripts to provision and tear down development databases (PostgreSQL or MySQL) via Helm, streamlining both local development and CI testing.

Key Changes

  1. Scripts

    • backend/scripts/start-dev-db.sh
      • Deploys Bitnami PostgreSQL or MySQL based on DB_TYPE (default: postgres).
      • Uses DB_NAMESPACE (default: <DB_TYPE>-test) to isolate resources.
      • Waits for pods labeled app.kubernetes.io/instance=<release> to become ready.
    • backend/scripts/stop-dev-db.sh
      • Uninstalls the Helm release and deletes the namespace.
  2. Makefile Targets

    .PHONY: start-dev-db stop-dev-db
    
    start-dev-db:
    	@./scripts/start-dev-db.sh
    
    stop-dev-db:
    	@./scripts/stop-dev-db.sh
    
  3. Helm Chart Metadata
    • Added backend/helm-charts/postgresql/Chart.yaml with apiVersion, name, and version.
    • Retained values.yaml for custom PostgreSQL settings.

  4. Documentation
    • Updated backend/README.md with a Local Database Deployment section.
    • Usage details are covered there—please refer to the README.

Next Steps

  • CI pipelines can invoke make start-dev-db → run tests → make stop-dev-db for both DB_TYPE=postgres and DB_TYPE=mysql.
  • Later, once PostgreSQL is promoted upstream, the local helm-charts directory can be removed in favor of the Central Chart Repo.

kaikaila and others added 6 commits July 15, 2025 17:47
This commit migrates the entire ORM layer of the Kubeflow Pipelines backend
from github.com/jinzhu/gorm (v1) to gorm.io/gorm (v2). It covers all core
model definitions under backend/src/apiserver/, as well as full migration
of the Execution Cache system under backend/src/cache/.

Key changes:
- Updated struct tags to GORM v2 conventions (e.g., primaryKey, type, uniqueIndex).
- GORM size tags are replaced with type tag to be more semantic.
- The indexed columns are explicitly limited in length in order to be indexable in MySQL.
- Replaced deprecated AddForeignKey() with `constraint` tags
- Dropped AddIndex() and AddUniqueIndex() in favor of declarative tags
- Migrated DropIndex, ModifyColumn via GORM v2 Migrator interface
- Introduced helper for composite unique constraints

Other fixes:
- Replaced sql.NullInt64 with int64 to match NOT NULL tag schema
- Removed deprecated NewRecord() check; replaced with Create().Scan()

Co-authored-by: Humair Khan <[email protected]>
Signed-off-by: kaikaila <[email protected]>
Signed-off-by: kaikaila <[email protected]>
This commit migrates the entire ORM layer of the Kubeflow Pipelines backend
from github.com/jinzhu/gorm (v1) to gorm.io/gorm (v2). It covers all core
model definitions under backend/src/apiserver/, as well as full migration
of the Execution Cache system under backend/src/cache/.

Key changes:
- Updated struct tags to GORM v2 conventions (e.g., primaryKey, type, uniqueIndex)
- Replaced deprecated AddForeignKey() with `constraint` tags
- Dropped AddIndex() and AddUniqueIndex() in favor of declarative tags
- Migrated DropIndex, ModifyColumn via GORM v2 Migrator interface
- Introduced helper for composite unique constraints

Other fixes:
- Replaced sql.NullInt64 with int64 to match NOT NULL tag schema
- Removed deprecated NewRecord() check; replaced with Create().Scan()

This sets the foundation for schema portability, cross-DB testing, and future
PostgreSQL support.

Signed-off-by: kaikaila <[email protected]>
Co-authored-by: Humair Khan <[email protected]>
Signed-off-by: Yunkai Li <[email protected]>
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign humairak for approval. For more information see the Kubernetes Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow
Copy link

Hi @kaikaila. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@github-actions
Copy link

🚫 This command cannot be processed. Only organization members or owners can use the commands.

@kaikaila kaikaila changed the title feat(backend): add Make & scripts for automated dev DB deployment [WIP]feat(backend): add Make & scripts for automated dev DB deployment Jul 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant