Problem
There is no automated cleanup mechanism. The start_cluster() finally block only closes SSH/SFTP connections — it does not remove containers, volumes, networks, routes, or deployed files. After a failed run, manual cleanup on every node is required.
File: src/initialize.py
Fix
Add a teardown_cluster() method and expose it via CLI flags with the following behavior:
| Existing deployment? |
--redeploy? |
Behavior |
| No |
N/A |
Fresh deploy (current) |
| Yes |
No |
Abort with clear message |
| Yes |
Yes |
Teardown → fresh deploy |
Teardown per node:
docker swarm leave --force
docker rm -f $(docker ps -aq)
docker volume rm $(docker volume ls -q)
docker network rm superset-network docker_gwbridge
rm -rf /opt/superset-cluster /opt/*.pyc
- For mgmt nodes: remove keepalived routes and VIP address
Acceptance Criteria
Problem
There is no automated cleanup mechanism. The
start_cluster()finallyblock only closes SSH/SFTP connections — it does not remove containers, volumes, networks, routes, or deployed files. After a failed run, manual cleanup on every node is required.File:
src/initialize.pyFix
Add a
teardown_cluster()method and expose it via CLI flags with the following behavior:--redeploy?Teardown per node:
docker swarm leave --forcedocker rm -f $(docker ps -aq)docker volume rm $(docker volume ls -q)docker network rm superset-network docker_gwbridgerm -rf /opt/superset-cluster /opt/*.pycAcceptance Criteria
teardown_cluster()method implemented that removes containers, volumes, networks, routes, and deployed files on all nodes./superset-cluster --cleanup --mgmt-nodes ... --mysql-nodes ...--redeployflag triggers teardown then fresh deploy