implement cleanup
Kubeface writes a bunch of stuff to the bucket. After a computation has succeeded, we'll usually want to get rid of these.
The user should call client.cleanup() after their script has completed successfully. This should:
- delete task input bucket items
- delete task output buket items
- rename the job status page from
active:xxxtocompleted:xxx - delete all kubernetes pods that were created by the client (they are in a "completed" state and do not show up if you just run
kubectl get podswithout the-aflag)
Rationale for not doing this automatically is that the script may crash later on, and we want to pick up and use previously run tasks in that case. Only the user knows if the overall script has completed successfully.
Additionally, we should implement a kubeface-cleanup command that takes a job name (or cache key?) and does the cleanup for it.
Finally, we should maybe implement a __del__ method in the Client that prints out a message if the client is garbage collected without doing a cleanup, telling the user the kubeface-cleanup command to run to do the cleanup.
We should also cleanup broadcasts