def Cleanup(benchmark_spec):
  master = benchmark_spec.vm_groups['master'][0]
  workers = benchmark_spec.vm_groups['workers']

  def CleanupCommon(vm):
    vm.RemoteCommand('sudo docker rm -v data')
    vm.RemoteCommand('sudo docker rmi cloudsuite/movielens-dataset')
    vm.RemoteCommand('sudo docker rmi cloudsuite/spark')

  def CleanupMaster(vm):
    vm.RemoteCommand('sudo docker stop spark-master')
    vm.RemoteCommand('sudo docker rm spark-master')
    vm.RemoteCommand('sudo docker rmi cloudsuite/in-memory-analytics')
    CleanupCommon(vm)

  def CleanupWorker(vm):
    vm.RemoteCommand('sudo docker stop spark-worker')
    vm.RemoteCommand('sudo docker rm spark-worker')
    CleanupCommon(vm)

  target_arg_tuples = ([(CleanupWorker, [vm], {}) for vm in workers] +
                       [(CleanupMaster, [master], {})])
  vm_util.RunParallelThreads(target_arg_tuples, len(target_arg_tuples))
Return port state for serialization.
dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/linux_benchmarks/cloudsuite_in_memory_analytics_benchmark.py/Cleanup--crossover with--dataset/ETHPy150Open EricssonResearch/calvin-base/calvin/actor/actorport.py/Port._state