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

fix(dashmate): dapi kills host machine on container stop #1670

Merged
merged 9 commits into from
Jan 12, 2024

Conversation

shumkov
Copy link
Member

@shumkov shumkov commented Jan 12, 2024

Issue being fixed or feature implemented

To scale (run multiple instances) DAPI we currently using PM2 (process manager based on Node.JS custer) inside Docker container. It starts multiple processes inside one container.
This approach has multiple downsides:

  1. Killing host machine on container stop
  2. Additional layer of balancing while we already have Envoy as a load balancer
  3. Violate Docker philosophy: 1 container - 1 process
  4. ...

What was done?

  • Use Docker Compose deploy replicas functionality to start multiple containers with dashmate
  • Added platform.dapi.api.docker.deploy.replicas option to configure the number of DAPI instances (1 by default)
  • Ignored .env that invalidates docker build cache
  • Moved migration test to the proper location (according to the source directory)

Fixed already-known flaky issues to make CI green:

  • Fixed --wait-for-readiness not waiting for DAPI availability
  • Fixed Core RPC timeout on start
  • Fixed DAPI connection handling with Tenderdash

How Has This Been Tested?

With local network

Breaking Changes

None

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@shumkov shumkov added this to the v1.0.0 milestone Jan 12, 2024
@shumkov shumkov changed the title feat(dashmate): scale DAPI instances feat(dashmate): scale DAPI services Jan 12, 2024
@shumkov shumkov changed the title feat(dashmate): scale DAPI services fix(dashmate): DAPI services kills host machine on container stop Jan 12, 2024
@shumkov shumkov changed the title fix(dashmate): DAPI services kills host machine on container stop fix(dashmate): DAPI kills host machine on container stop Jan 12, 2024
@shumkov shumkov changed the title fix(dashmate): DAPI kills host machine on container stop fix(dashmate): dapi kills host machine on container stop Jan 12, 2024
@shumkov shumkov merged commit d320578 into v1.0-dev Jan 12, 2024
32 checks passed
@shumkov shumkov deleted the feat/dashmate/scale-dapi branch January 12, 2024 16:54
Copy link
Contributor

@markin-io markin-io left a comment

Choose a reason for hiding this comment

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

utACK

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.

None yet

2 participants