chore: notify user if docker-compose fails #2064
Labels
E:3.2: Basic DoS protection in production
See https://github.com/waku-org/pm/issues/70 for details
enhancement
New feature or request
Background
Currently we instruct the users to use nwaku-compose by using the following command:
docker-compose up -d
.In addition, we run the
docker-compose
services withrestart: on-failure
configuration.This means that if the run fails during setup because of a missing or invalid input, the user won't see any error in the terminal because of being on detached mode, and the faulty container will keep restarting itself in the background indefinitely as per the restart policy.
Details
This scenario will become usual with the addition of RLN, as the user is required to provide an Ethereum node URL and might try running
docker-compose
without having set up an address.Because we instruct to run on detached mode, the terminal will notify that the containers successfully started running but won't show or throw any error during setup because it has already detached.
After some investigation, I found two main ways to approach this problem:
1- Not instruct the users to run on detached mode and possibly use a flag such as
--abort-on-container-exit
to stop the whole run if a component fails.2- Create a wrapper script that runs
docker-compose
on detached mode and checks after a certain amount of seconds that everything is properly up. If everything is ok by then, exits anddocker-compose
continues its detached run.In this case, if an error happens mid-run the user won't be notified but it will help the user in common scenarios of missing or invalid inputs.
We can also improve the restart policy to allow a maximum amount of failures in a time window, and prevent the case that the container keeps restarting itself indefinitely because of a wrong input. That would mean that after failing and restarting N amount of times during certain timespan, the container gives up and exits.
cc @Ivansete-status @vpavlin @alrevuelta @rymnc
Acceptance criteria
The text was updated successfully, but these errors were encountered: