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

  def PrepareCommon(vm):
    if not docker.IsInstalled(vm):
      vm.Install('docker')
    vm.RemoteCommand('sudo docker pull cloudsuite/spark')
    vm.RemoteCommand('sudo docker pull cloudsuite/movielens-dataset')
    vm.RemoteCommand('sudo docker create --name data '
                     'cloudsuite/movielens-dataset')

  def PrepareMaster(vm):
    PrepareCommon(vm)
    vm.RemoteCommand('sudo docker pull cloudsuite/in-memory-analytics')
    start_master_cmd = ('sudo docker run -d --net host -e SPARK_MASTER_IP=%s '
                        '--name spark-master cloudsuite/spark master' %
                        master.internal_ip)
    vm.RemoteCommand(start_master_cmd)

  def PrepareWorker(vm):
    PrepareCommon(vm)
    start_worker_cmd = ('sudo docker run -d --net host --volumes-from data '
                        '--name spark-worker cloudsuite/spark worker '
                        'spark://%s:7077' % master.internal_ip)
    vm.RemoteCommand(start_worker_cmd)

  target_arg_tuples = ([(PrepareWorker, [vm], {}) for vm in workers] +
                       [(PrepareMaster, [master], {})])
  vm_util.RunParallelThreads(target_arg_tuples, len(target_arg_tuples))
Indicates whether this code is being run in devappserver2.
dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/linux_benchmarks/cloudsuite_in_memory_analytics_benchmark.py/Prepare--crossover with--dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/api/backends/backends.py/_is_dev2_environment