waku-org / waku-simulator

Tool to simulate a waku network with multiple nodes, traffic and users
https://simulator.waku.org
2 stars 6 forks source link

Use healthchecks in deployer #36

Closed alrevuelta closed 1 month ago

alrevuelta commented 3 months ago

Use docker healthchecks in RLN contract deployer container, so that nwaku nodes don't start until RLN contract has been deployed.

Right now, we just use a depends_on in nwaku containers, which means that nwaku nodes start as soon as contract-repo-deployer starts and that wrong. We must wait until contract-repo-deployer has finished.

stubbsta commented 2 months ago

@alrevuelta I found another way to achieve the same objective. Once the contracts have been deployed the contract-repo-deployer service stops running. It's possible to add a condition to the depends on field for the nwaku service in docker compose like this:

    depends_on:
      contract-repo-deployer:
          condition: service_completed_successfully

No other code is required. The nwaku services are not created until the contract-repo-deployer service exits/stops successfully.

Do we specifically want to use the healthchecks approach or will this method be sufficient?

alrevuelta commented 2 months ago

@stubbsta Nice, that approach looks good. As long as we can block nwaku nodes to start before the contract has been deployed, I'm ok with any way to fix it.

stubbsta commented 2 months ago

This is addressed in PR https://github.com/waku-org/waku-simulator/pull/45

alrevuelta commented 2 months ago

@stubbsta Can we split it into different PRs? healthchecks and RLNv2 are different things and RLNv2 might be blocked for a bit. So I would suggest to split it.

stubbsta commented 2 months ago

@alrevuelta I agree, I have reverted the docker-compose file to the default in PR https://github.com/waku-org/waku-simulator/pull/45 and I will create a separate PR for just this issue

alrevuelta commented 1 month ago

Closed by https://github.com/waku-org/waku-simulator/pull/48