Esempio n. 1
0
def start_docker():

  (host,cli) = get_docker()
  log.info("Got docker as %s,%s", host, cli)

  #d = DockerExecutor(cli, host_ip=host, commit='c74b70c5cf67355073599a62ca396dd1e8eed6c3')
  #d.create_base_images()

  def framework_run():
    with cd('~/FrameworkBenchmarks'):
      command = 'python toolset/run-tests.py --install server --verbose --test haywire --runner-user tfbrunner '
      command += '--client-user root   --client-host client     --client-identity-file ~/.ssh/id_rsa '
      command += '--database-user root --database-host database --database-identity-file ~/.ssh/id_rsa '
      run(command, **shell_logger)

  with DockerExecutor(cli, host_ip=host, commit='c74b70c5cf67355073599a62ca39s6dd1e8eed6c3') as executor:
    print "Base images constructed"
    execute(framework_run, hosts=[executor.server_fab])
Esempio n. 2
0
def start_redis(port):
  (host,cli) = get_docker()
  for line in cli.pull('redis:3.0.0', stream=True):
    print line

  container = cli.create_container(image='redis:3.0.0', hostname='WebJuice')
  cid = container.get('Id')
  cli.start(cid, port_bindings={6379: port})

  log.info("Started Redis as %s", cid)
  redis_url = "redis://%s:%s/" % (host, port)
  log.info("Redis: %s", redis_url)

  with open('.env','w') as f:
    f.write("REDISCLOUD_URL=%s\n" % redis_url)

    # Setup arg flags for running webapp in development mode
    f.write("WEB_ARGS=--debug\n")
    log.info("Redis: Config written to .env")
Esempio n. 3
0
        except Exception:
          log.exception("Failed to remove %s", image)
    safe_rm(self.cimage)
    safe_rm(self.dimage)
    safe_rm(self.simage)

if __name__ == "__main__":
  c = utils.parse_log_config('../logging.yaml')
  logging.config.dictConfig(c)

  urllib3_logger = logging.getLogger('requests')
  urllib3_logger.setLevel(logging.CRITICAL)
  p_logger = logging.getLogger('paramiko')
  p_logger.setLevel(logging.INFO)

  (host_ip,client) = get_docker()

  def framework_run():
    with cd('~/FrameworkBenchmarks'):
      command = 'python toolset/run-tests.py --install server --verbose --test haywire --runner-user tfbrunner '
      command += '--client-user root   --client-host client     --client-identity-file ~/.ssh/id_rsa '
      command += '--database-user root --database-host database --database-identity-file ~/.ssh/id_rsa '
      run(command, **shell_logger)

  with DockerExecutor(client, host_ip=host_ip, commit='c74b70c5cf67355073599a62ca396dd1e8eed6c3') as executor:
    execute(framework_run, hosts=[executor.server_fab])


  # Run TFB installation inside the containers
  # executor.deploy()