def Prepare(benchmark_spec):
  """Install Redis on one VM and memtier_benchmark on another.

  Args:
    benchmark_spec: The benchmark specification. Contains all data that is
        required to run the benchmark.
  """
  vms = benchmark_spec.vms
  redis_vm = vms[0]
  # Install latest redis on the 1st machine.
  redis_vm.Install('redis_server')

  sed_cmd = (r"sed -i -e '/save 900/d' -e '/save 300/d' -e '/save 60/d' -e 's/#"
             "   save \"\"/save \"\"/g' %s/redis.conf")
  redis_vm.RemoteCommand(sed_cmd % redis_server.REDIS_DIR)

  for i in range(redis_vm.num_cpus * FLAGS.redis_numprocesses):
    port = FIRST_PORT + i
    redis_vm.RemoteCommand(
        'cp %s/redis.conf %s/redis-%d.conf' %
        (redis_server.REDIS_DIR, redis_server.REDIS_DIR, port))
    redis_vm.RemoteCommand(
        r'sed -i -e "s/port 6379/port %d/g" %s/redis-%d.conf' %
        (port, redis_server.REDIS_DIR, port))
    redis_vm.RemoteCommand(
        'nohup sudo %s/src/redis-server %s/redis-%d.conf &> /dev/null &' %
        (redis_server.REDIS_DIR, redis_server.REDIS_DIR, port))

  args = [((vm,), {}) for vm in vms[1:]]
  vm_util.RunThreaded(PrepareLoadgen, args)
dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/linux_benchmarks/redis_benchmark.py/Prepare/original