Skip to content

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

Merged
shumkov merged 9 commits into
v1.0-devfrom
feat/dashmate/scale-dapi
Jan 12, 2024
Merged

fix(dashmate): dapi kills host machine on container stop#1670
shumkov merged 9 commits into
v1.0-devfrom
feat/dashmate/scale-dapi

Conversation

@shumkov

@shumkov shumkov commented Jan 12, 2024

Copy link
Copy Markdown
Collaborator

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
@shumkov
shumkov deleted the feat/dashmate/scale-dapi branch January 12, 2024 16:54

@markin-io markin-io left a comment

Copy link
Copy Markdown
Contributor

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.

2 participants