#NEWLINE# def _SetupClient( benchmark_spec ) : #NEWLINE# #INDENT# frontend = benchmark_spec . vm_groups [ 'frontend' ] [ 0 ] #NEWLINE# backend = benchmark_spec . vm_groups [ 'backend' ] [ 0 ] #NEWLINE# client = benchmark_spec . vm_groups [ 'client' ] [ 0 ] #NEWLINE# fw = client . firewall #NEWLINE# fw . AllowPort ( client , 9980 ) #NEWLINE# CLIENT_IP = client . ip_address #NEWLINE# BACKEND_IP = backend . ip_address #NEWLINE# FRONTEND_IP = frontend . ip_address #NEWLINE# untar_command = 'cd %s && tar xzf %s' #NEWLINE# client . RemoteCommand ( ( untar_command % ( BASE_DIR , 'faban-kit-022311.tar.gz' ) ) ) #NEWLINE# client . RemoteCommand ( ( untar_command % ( BASE_DIR , 'apache-olio-php-src-0.2.tar.gz' ) ) ) #NEWLINE# client . RemoteCommand ( ( untar_command % ( BASE_DIR , 'mysql-connector-java-5.0.8.tar.gz' ) ) ) #NEWLINE# client . RemoteCommand ( ( 'cp %s/mysql-connector-java-5.0.8/mysql-connector-java-5.0.8-bin.jar %s/workload/php/trunk/lib' % ( BASE_DIR , OLIO_HOME ) ) ) #NEWLINE# copy_command2 = 'cp %s/samples/services/ApacheHttpdService/build/ApacheHttpdService.jar %s/services && cp %s/samples/services/MysqlService/build/MySQLService.jar %s/services &&cp %s/samples/services//MemcachedService/build/MemcachedService.jar %s/services' #NEWLINE# client . RemoteCommand ( ( copy_command2 % ( FABAN_HOME , FABAN_HOME , FABAN_HOME , FABAN_HOME , FABAN_HOME , FABAN_HOME ) ) ) #NEWLINE# client . RemoteCommand ( ( 'cd %s/workload/php/trunk &&cp build.properties.template build.properties' % OLIO_HOME ) ) #NEWLINE# client . RemoteCommand ( ( 'perl -pi -e "s/\\/export\\/home\\/faban/%s/g" %s/workload/php/trunk/build.properties' % ( re . escape ( FABAN_HOME ) , OLIO_HOME ) ) ) #NEWLINE# client . RemoteCommand ( ( 'perl -pi -e "s/host.sfbay/localhost/g" %s/workload/php/trunk/build.properties' % OLIO_HOME ) ) #NEWLINE# build_command = 'cd %s && %s/ant deploy.jar' #NEWLINE# client . RemoteCommand ( ( build_command % ( OLIO_BUILD , ANT_HOME ) ) ) #NEWLINE# client . RemoteCommand ( ( 'cp %s/workload/php/trunk/build/OlioDriver.jar %s/benchmarks' % ( OLIO_HOME , FABAN_HOME ) ) ) #NEWLINE# set_java = 'export JAVA_HOME=%s && %s/master/bin/startup.sh' #NEWLINE# client . RemoteCommand ( ( set_java % ( JAVA_HOME , FABAN_HOME ) ) ) #NEWLINE# client . Install ( 'curl' ) #NEWLINE# client . RemoteCommand ( ( 'curl http://%s:9980/' % CLIENT_IP ) ) #NEWLINE# client . RemoteCommand ( ( 'cd %s && wget parsa.epfl.ch/cloudsuite/software/perfkit/web_serving/webservingfiles.tgz && tar xzf webservingfiles.tgz' % BASE_DIR ) ) #NEWLINE# client . RobustRemoteCommand ( ( 'cd %s && cp -f %s/run.sh . && cp -f %s/run.xml . && cp -f %s/driver.policy . && cp -rf %s/build . && mkdir -p lib_olio && cp -rf %s/* lib_olio/ && cp -rf %s/resources build/ && export FABAN_HOME=%s  ' % ( FABAN_HOME , BASE_DIR , BASE_DIR , BASE_DIR , OLIO_BUILD , OLIO_BUILD , OLIO_BUILD , FABAN_HOME ) ) ) #NEWLINE# client . RemoteCommand ( ( 'perl -pi -e "s/CLIENT_IP/%s/g" %s/run.xml' % ( CLIENT_IP , FABAN_HOME ) ) ) #NEWLINE# client . RemoteCommand ( ( 'perl -pi -e "s/FRONTEND_IP/%s/g" %s/run.xml' % ( FRONTEND_IP , FABAN_HOME ) ) ) #NEWLINE# client . RemoteCommand ( ( 'perl -pi -e "s/MYSQL_DIR/%s/g" %s/run.xml' % ( re . escape ( MYSQL_HOME ) , FABAN_HOME ) ) ) #NEWLINE# client . RemoteCommand ( ( 'perl -pi -e "s/OUTPUT_DIR/%s/g" %s/run.xml' % ( re . escape ( OUTPUT_DIR ) , FABAN_HOME ) ) ) #NEWLINE# filestore = posixpath . join ( frontend . GetScratchDir ( ) , 'filestore' ) #NEWLINE# client . RemoteCommand ( ( 'perl -pi -e "s/FILESTORE_DIR/%s/g" %s/run.xml' % ( re . escape ( filestore ) , FABAN_HOME ) ) ) #NEWLINE# client . RemoteCommand ( ( 'perl -pi -e "s/BACKEND_IP/%s/g" %s/run.xml' % ( BACKEND_IP , FABAN_HOME ) ) )