Updating InterDiode
Several steps must be taken to update InterDiode to a new version. The process is as follows:
backup your files and the SQL database
at least stop the worker responsible for sending data from the black side to the red one, to avoid data loss during the update process.
update the red (internal) instance.
start the red instance and be sure that the receiving process is running, to avoid data loss during the update process.
update the black (internet) instance.
start the black instance.
Attention
In general, disable at least the transfer process on the black side before stopping the reception process on the red side, and conversely, start the reception process on the red side before restarting the transfer process on the black side.
Backup
Before updating InterDiode, performing a backup of your data as explained in the documentation in strongly recommended.
Stopping the Workers
The easiest way to stop the workers is to use the interdiode-ctl command line tool, which can be used to stop the workers gracefully, allowing them to finish their current tasks before stopping.
docker compose exec -it [CONTAINER] interdiode-ctl run remove --timeout 10
This command can be run in any InterDiode container and asks the workers to stop to process new tasks, letting them finish their current tasks.
If any task is still running after the timeout, then the command exists with the error code 11.
As soon as this command returns with the error code 0, then all workers have finished their tasks and stopped, and you can safely kill the containers and update InterDiode.
Killing directly the containers without waiting for the workers to finish their tasks may not let enough time for the workers to finish their tasks, which may lead to data loss.
You can run this command multiple times until all workers have finished their tasks and the same command exits successfully with return code 0, or you can kill the remaining tasks with the following command:
docker compose exec -it [CONTAINER] interdiode-ctl run remove --timeout 10 --kill
Stopping the workers can also be done by sending the SIGTERM signals to them (letting them to finish their tasks) or SIGQUIT (killing them as soon as possible), or even SIGKILL. Be sure that the timeout is long enough between SIGTERM and SIGQUIT/SIGKILL to let the workers finish their tasks, otherwise you may lose running tasks.
Do not forget to stop black workers first, then red workers, to avoid data loss during the update process, as the black workers are responsible for sending data from the black side to the red one, and if they are stopped after the red workers, then some data may be lost during the update process.
Updating both Instances
Once the workers are stopped, you can update both instances by using the last version of the InterDiode container images.
When images have been updated, you must run the interdiode-ctl configuration apply --no-input command in both instances to apply the new configuration.
The example compose.yaml file provided in the documentation run this command automatically when the containers are started, so you can just restart the containers to apply the new configuration, but if you have modified the compose.yaml file and removed this command, then you must run it manually in both instances as explained above.
Attention
Do not forget to run this command in the red instance first and be sure that the receiving process is running, then in the black one, to avoid data loss during the update process.