def METHOD_NAME(benchmark_spec):
  """Stop and remove docker containers. Remove images.
  Args:
    benchmark_spec: The benchmark specification. Contains all data that is
        required to run the benchmark.
  """
  master = benchmark_spec.vm_groups['master'][0]
  workers = benchmark_spec.vm_groups['workers']
  def CleanupCommon(vm):
    vm.RemoteCommand('sudo docker rm -v data')
  def CleanupMaster(vm):
    vm.RemoteCommand('sudo docker stop spark-master')
    vm.RemoteCommand('sudo docker rm spark-master')
    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], {})])
  background_tasks.RunParallelThreads(target_arg_tuples, len(target_arg_tuples))