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

#1717 - Segregate db migrations deployment - Part 1 #1932

Merged
merged 103 commits into from
May 17, 2023

Conversation

guru-aot
Copy link
Collaborator

@guru-aot guru-aot commented May 9, 2023

Create a separate process to deploy the DB migrations before all the applications;

  • The db migration run as a separate job after the checkout and Login to openshift steps is successful, else it will exit nicely with an error message 'Failed to log in to OpenShift. Please check the credentials and connection details.'.
  • If the db migration is successful it will continue the deployment of SIMS-API, Workers, Queues, and Web/Frontend steps in parallel.
  • If the db migration is not successful for 5 min(300sec) it will throw an error and exit nicely with and error message 'Failed to run DB Migrations.'.

Change the applications to be built and deployed in parallel, and only if the DB migrations deployment was successful.

The github branch name is not created properly as to make the testing of deployments easy from local

Additionally added horizontalPodAutoScaler for all the applications for a max of 80 percent CPU utilization. It helps ensure that your application has enough resources to handle varying levels of workload and maintain optimal performance.
Also added distruptionBudget for minimum replica needed during updating or deleting pods. It helps ensure the high availability of your applications during maintenance activities, such as rolling updates or node evictions.

Analysis on DB migration rollback will be taken part of next PR

image image

@guru-aot guru-aot temporarily deployed to DEV May 16, 2023 15:47 — with GitHub Actions Inactive
@guru-aot guru-aot temporarily deployed to DEV May 16, 2023 15:56 — with GitHub Actions Inactive
@guru-aot guru-aot temporarily deployed to DEV May 16, 2023 16:05 — with GitHub Actions Inactive
@guru-aot guru-aot temporarily deployed to DEV May 16, 2023 16:43 — with GitHub Actions Inactive
@guru-aot guru-aot temporarily deployed to DEV May 16, 2023 17:25 — with GitHub Actions Inactive
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@github-actions
Copy link

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 18.11% ( 2040 / 11266 )
Methods: 8.19% ( 119 / 1453 )
Lines: 20.94% ( 1792 / 8557 )
Branches: 10.27% ( 129 / 1256 )

@github-actions
Copy link

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 33.02% ( 177 / 536 )
Methods: 22.08% ( 17 / 77 )
Lines: 40.1% ( 158 / 394 )
Branches: 3.08% ( 2 / 65 )

@github-actions
Copy link

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 68.32% ( 371 / 543 )
Methods: 57.97% ( 40 / 69 )
Lines: 70.47% ( 327 / 464 )
Branches: 40% ( 4 / 10 )

@github-actions
Copy link

E2E SIMS API Coverage Report

Totals Coverage
Statements: 41.54% ( 2918 / 7025 )
Methods: 34.76% ( 317 / 912 )
Lines: 46.8% ( 2455 / 5246 )
Branches: 16.84% ( 146 / 867 )

deployCamundaDefinitions:
if: ${{ github.event.inputs.deployCamundaDefinitions == 'true' }}
name: Deploy BPMNs and DMNs to Camunda
needs:
- deploy
- deploy-sims-api
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should needs consider workers also?

Copy link
Collaborator

Choose a reason for hiding this comment

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

May be queue consumers also.

Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot May 16, 2023

Choose a reason for hiding this comment

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

It is a good point. Maybe we can wait for all the deployments to be successful before deploying definitions.
We can take care of it in an upcoming PR when we can also extend the conversation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If I am not wrong, they do not have any dependencies with any of the deployments. We can deploy it parallel if the inputs are checked. What you say?? @dheepak-aot @andrewsignori-aot @andrepestana-aot @sh16011993

Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot May 16, 2023

Choose a reason for hiding this comment

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

For Camunda definitions, assuming that we have a new worker task that will need an additional input parameter, the new worker app will need to be compatible with current and new versions of the bpmn, but the opposite may be not be right, when a new Camunda bpmn will not be compatible if the worker is not updated.
My point is, maybe forms can be dependent on the API, and Camunda definitions may be dependent on workers.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also deploying Camunda definitions could be dependent on Queue consumers, where the structure of payload to start workflow instance or something like that may have changed and could be in sync with bpmn updates.

But we can discuss this in upcoming PR.

Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot left a comment

Choose a reason for hiding this comment

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

Great work and thanks for doing the changes 👍

Copy link
Collaborator

@andrepestana-aot andrepestana-aot left a comment

Choose a reason for hiding this comment

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

Great job! Looks good!

Copy link
Collaborator

@dheepak-aot dheepak-aot left a comment

Choose a reason for hiding this comment

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

Great work @guru-aot . Thanks for making the changes.

Copy link
Collaborator

@sh16011993 sh16011993 left a comment

Choose a reason for hiding this comment

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

LGTM @guru-aot 👍

@guru-aot guru-aot merged commit 79efd85 into main May 17, 2023
@guru-aot guru-aot temporarily deployed to DEV May 17, 2023 15:16 — with GitHub Actions Inactive
@guru-aot guru-aot deleted the Segregate_DB_Migrations_Deployment branch May 17, 2023 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Devops Devops
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants