Resolve "Stop container if DMS is killed"
Description
-
Watcher Mechanism:
- Introduced a
watcher
mechanism that continuously monitors the heartbeat of the main DMS. - The
watcher
initiates cleanup if no heartbeat from the DMS is received for a specified timeout.
- Introduced a
-
Communication via Local Socket:
- Established a local TCP socket communication on
localhost:9898
between the main DMS and thewatcher
. - The main DMS sends heartbeat signals to the
watcher
through this socket.
- Established a local TCP socket communication on
-
Container Cleanup:
- Used the Docker SDK to interact with Docker and manage containers.
- Containers with a specific naming convention (
DMS_...
) are targeted for cleanup. - When a cleanup is initiated, the
watcher
stops and removes the containers following the naming convention.
Checklist
-
I have update updated the @version
string in main.go. See https://semver.org/ -
I have update CHANGELOG.md with a short description of changes. -
I have run swag init
to update the swagger docs.
Edited by khaled yasser