示例#1
0
 def excute_benchmarks(self):
     ssh_priv_key = self.config.globals.ssh_priv_key
     ssh_username = self.config.globals.ssh_username
     reservations = list()   
     if self.reservations:
         reservations = self.reservations
     else:
         for cloud in self.clouds:
             reservations = cloud.conn.get_all_instances()
     for reservation in reservations:
         for instance in reservation.instances:
             if self.database.check_benchmark(self.benchmark.name, instance.id):
                 cmds = list()
                 cmds.append("sed -i '5c input='y'' ~/BioPerf/Scripts/Run-scripts/CleanOutputs.sh")
                 cmds.append("sed -i '13c rm -f $BIOPERF/Outputs/log' ~/BioPerf/Scripts/Run-scripts/CleanOutputs.sh")
                 cmds.append("sed -i '21c #' ~/BioPerf/Scripts/Run-scripts/run-bioperf.sh")
                 cmds.append("sed -i '26c #' ~/BioPerf/Scripts/Run-scripts/run-bioperf.sh")
                 cmds.append("sed -i '10c arch='X'' ~/BioPerf/Scripts/Run-scripts/run-bioperf.sh")
                 cmds.append("sed -i '71c input3='A'' ~/BioPerf/Scripts/Run-scripts/run-bioperf.sh")
                 cmds.append("sed -i '134c input='A'' ~/BioPerf/Scripts/Run-scripts/run-bioperf.sh")
                 cmds.append("sed -i '145c user1='y'' ~/BioPerf/Scripts/Run-scripts/run-bioperf.sh")
                 cmds.append("./BioPerf/Scripts/Run-scripts/CleanOutputs.sh")
                 cmds.append("echo 'Y' 'Y'|./BioPerf/Scripts/Run-scripts/run-bioperf.sh > ~/BioPerf/Outputs/log")
                 
                 for c in cmds:
                     command = RemoteCommand(instance.public_dns_name, ssh_priv_key, c)
                     command_return = command.execute()
                     if command_return !=0:
                         LOG.error("Excute_benchmarks: "+command.stdout)
                         LOG.error("Excute_benchmarks: "+command.stderr)
示例#2
0
 def deploy_software(self):
     ssh_priv_key = self.config.globals.ssh_priv_key
     ssh_username = self.config.globals.ssh_username
     ssh_timeout = int(self.config.globals.ssh_timeout)
     reservations = list()   
     not_available = 0;
     if self.reservations:
         reservations = self.reservations
     else:
         for cloud in self.clouds:
             reservations = cloud.conn.get_all_instances()
     for reservation in reservations:
         for instance in reservation.instances:
             if self.database.check_benchmark(self.benchmark.name, instance.id):
                 if not check_port_status(instance.ip_address, 22, ssh_timeout):
                     LOG.error("Deploy_software: the port 22 is not available right now. please try it later")
                     continue   
                 cmds = list()
                 cmds.append("wget %s" % (self.url))
                 #cmds.append("apt-get update")
                 #cmds.append("apt-get install unzip")
                 cmds.append("unzip BioPerf.zip")
                 cmds.append("sed -i 's/read BIOPERF/#read BIOPERF/g' install-BioPerf.sh")
                 cmds.append("./install-BioPerf.sh")
                 for c in cmds:
                     command = RemoteCommand(instance.public_dns_name, ssh_priv_key, c)
                     command_return = command.execute()
                     if command_return !=0:
                         LOG.error("Deploy_software: "+command.stdout)
                         LOG.error("Deploy_software error: "+command.stderr)