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

feat: remove flyway as init container and deploy it as a separate task #22

Merged
merged 4 commits into from
Dec 20, 2024

Conversation

mishraomp
Copy link
Collaborator

@mishraomp mishraomp commented Dec 20, 2024

currently. flyway is deployed as init container. it works but impacts auto scaling as it takes around a minute(image pulling, scheduling et..) for flyway container to be provisioned and complete.

this change would remove flyway from init container and will only execute during rollout.

this will make sure that when autoscaler kicks in it is only executing node api container and ready to server incoming traffic within 10 to 20 seconds.

successful deployment: https://github.com/bcgov/quickstart-aws-containers/actions/runs/12437101568/job/34726315097
and flyway task is executed successfully.

here is the sample that it takes around a minute

aws_ecs_task_definition.flyway_task (local-exec): Flyway task started with ARN: arn:aws:ecs:ca-central-1:374306708947:task/ecs-cluster-node-api-dev/bb39ef3c3e704b7695f5c505a085fe4d at Fri Dec 20 23:23:20 UTC 2024.
aws_ecs_task_definition.flyway_task (local-exec): Waiting for Flyway task to complete...
aws_ecs_task_definition.flyway_task: Still creating... [10s elapsed]
aws_ecs_task_definition.flyway_task: Still creating... [20s elapsed]
aws_ecs_task_definition.flyway_task: Still creating... [30s elapsed]
aws_ecs_task_definition.flyway_task: Still creating... [40s elapsed]
aws_ecs_task_definition.flyway_task: Still creating... [50s elapsed]
aws_ecs_task_definition.flyway_task (local-exec): Flyway task completed, at Fri Dec 20 23:24:17 UTC 2024.
aws_ecs_task_definition.flyway_task (local-exec): Flyway task status: STOPPED at Fri Dec 20 23:24:18 UTC 2024.

Copy link
Member

@DerekRoberts DerekRoberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this SO MUCH better! Transparency. Great job. :)

@mishraomp
Copy link
Collaborator Author

I like this SO MUCH better! Transparency. Great job. :)

I think we should port it back to quickstart openshift, and run flyway as a job during rollout to avoid init container, and api rollout will depend on flyway rollout, thoughts?

@DerekRoberts
Copy link
Member

Agreed. The challenge is how to structure that for k8s where init pattern, which I hate, is the recommended path. Deployments are generally supposed to happen simultaneously.

@DerekRoberts
Copy link
Member

Well, should. We're going to deviate!

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.

2 participants