Skip to content

feat: dockerfile for building migration runner image#9417

Merged
Gnanasundari24 merged 9 commits intomainfrom
migration-runner-docker
Oct 1, 2025
Merged

feat: dockerfile for building migration runner image#9417
Gnanasundari24 merged 9 commits intomainfrom
migration-runner-docker

Conversation

@Shailesh-714
Copy link
Contributor

@Shailesh-714 Shailesh-714 commented Sep 17, 2025

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Adding a new dockerfile for building a hyperswitch-migration-runner image.
This dockerfile, docker/migration-runner.Dockerfile, contains the respective router version's:

  1. Migration files
  2. diesel.toml
    along with diesel cli installed. This helps us run db migrations inside air-gapped clusters without the need to pull the migration files from github.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

When deploying hyperswitch helm charts in Kubernetes cluster, we use a init pod to pull the migration files from the github and run db migrations. But in case of an air-gapped cluster, which doesn't have access to internet, this process is not feasible.

Building and releasing the migration-runner image for each stable release along with the other standalone builds will solve this issue.

How did you test it?

  1. Built image locally:
Screenshot 2025-09-17 at 3 20 20 PM
  1. Run the image with local pg url, and migrations ran successfully:
Screenshot 2025-09-17 at 3 33 42 PM

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@Shailesh-714 Shailesh-714 requested a review from a team as a code owner September 17, 2025 10:10
@semanticdiff-com
Copy link

semanticdiff-com bot commented Sep 17, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  docker-compose.yml  39% smaller
  docker-compose-development.yml  8% smaller
  docker/migration-runner.Dockerfile Unsupported file format
  scripts/migration_runner_entrypoint.sh Unsupported file format

pixincreate
pixincreate previously approved these changes Sep 22, 2025
@Shailesh-714
Copy link
Contributor Author

shouldn't we include the migration files in the router docker image itself and run the migration when the docker image is initialized?
cc: @SanchithHegde

@SanchithHegde
Copy link
Member

shouldn't we include the migration files in the router docker image itself and run the migration when the docker image is initialized? cc: @SanchithHegde

Nope, I would not prefer doing this, to prevent destructive queries from being run automatically.

@Shailesh-714 Shailesh-714 requested a review from a team as a code owner September 24, 2025 14:20
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Oct 1, 2025
Merged via the queue into main with commit 46c434e Oct 1, 2025
33 of 45 checks passed
@Gnanasundari24 Gnanasundari24 deleted the migration-runner-docker branch October 1, 2025 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants