#!/usr/bin/env bash
# ds_stop.sh TAG -- save the engine log, stop OUR container ds-TAG, drop the flat-weights dump, keep the census cells.
W=$HOME/draftersites; O=$W/out/$1
docker logs ds-$1 > $O/engine.log 2>&1; docker stop -t 60 ds-$1 >/dev/null; docker rm -f ds-$1 >/dev/null
cp $W/s3c/cells.*.json $O/ 2>/dev/null; rm -f $W/s3c/cells.*.json
rm -rf $HOME/headroute/cache/arbi-serve/flat-weights; echo "$1 stopped; root $(df --output=pcent / | tail -1 | tr -dc 0-9)%"
