Пример #1
0
    def deploy_ipython_cluster(self):
        try:
            for num in range(self.num_vm):
                print self.hostname + " " + str(util.ssh_endpoint(num))
#                self.ssh.connect(self.hostname, util.ssh_endpoint(num), self.username, self.password)
                self.connect(util.ssh_endpoint(num))
                if num == 0:
                    self.exec_command("ipython profile create nbserver")
                    self.create_config(self.profile_dir_server, self.username, self.hostname)
                    self.create_ipcontroller_client(self.profile_dir_server)
                    self.create_ipcontroller_engine(self.profile_dir_server)
                    self.exec_multi_command("nohup ipcontroller --profile=nbserver --reuse &", '\n')
                    self.exec_multi_command("nohup ipython notebook --profile=nbserver &", '\n')
                    self.ssh.close()
                else:
                    self.exec_command("ipython profile create nbclient")
                    # Just write the engine_file to the engine
                    #self.engine_file_to_client(self.profile_dir_client)
                    # scp the file from controller to the engine
                    self.exec_command(self.scp_command)
                    self.exec_multi_command("nohup ipengine --profile=nbclient &", '\n')
                    self.ssh.close()

        except Exception as e:
            print "Failed: " + self.hostname
            print e
        print "\nIt's ready on: https://%s:%s" %(self.hostname, self.endpoint)
        print "Happy IPython!"
Пример #2
0
    def deploy_ipython_cluster(self):
        try:
            for num in range(self.num_vm):
                print self.hostname + " " + str(util.ssh_endpoint(num))
                #                self.ssh.connect(self.hostname, util.ssh_endpoint(num), self.username, self.password)
                self.connect(util.ssh_endpoint(num))
                if num == 0:
                    self.exec_command("ipython profile create nbserver")
                    self.create_config(self.profile_dir_server, self.username,
                                       self.hostname)
                    self.create_ipcontroller_client(self.profile_dir_server)
                    self.create_ipcontroller_engine(self.profile_dir_server)
                    self.exec_multi_command(
                        "nohup ipcontroller --profile=nbserver --reuse &",
                        '\n')
                    self.exec_multi_command(
                        "nohup ipython notebook --profile=nbserver &", '\n')
                    self.ssh.close()
                else:
                    self.exec_command("ipython profile create nbclient")
                    # Just write the engine_file to the engine
                    #self.engine_file_to_client(self.profile_dir_client)
                    # scp the file from controller to the engine
                    self.exec_command(self.scp_command)
                    self.exec_multi_command(
                        "nohup ipengine --profile=nbclient &", '\n')
                    self.ssh.close()

        except Exception as e:
            print "Failed: " + self.hostname
            print e
        print "\nIt's ready on: https://%s:%s" % (self.hostname, self.endpoint)
        print "Happy IPython!"
 def install_multi_sw(self):
     pool = workerpool.WorkerPool(size = self.workerpool_size)
     for num in range(self.num_vm):
         self.hostname = self.service_name + ".cloudapp.net"
         self.ssh_endpoint = util.ssh_endpoint(num)
         job = InstallSW(self.hostname, self.ssh_endpoint, self.username, self.password)
         pool.put(job)
     pool.shutdown()
     pool.wait()
Пример #4
0
 def install_multi_sw(self):
     pool = workerpool.WorkerPool(size=self.workerpool_size)
     for num in range(self.num_vm):
         self.hostname = self.service_name + ".cloudapp.net"
         self.ssh_endpoint = util.ssh_endpoint(num)
         job = InstallSW(self.hostname, self.ssh_endpoint, self.username,
                         self.password)
         pool.put(job)
     pool.shutdown()
     pool.wait()
Пример #5
0
 def config_network(self, is_controller):
     self.network = ConfigurationSet()
     self.network.configuration_set_type = 'NetworkConfiguration'
     if is_controller:
         for endpoint in self.endpoint_list:
             self.network.input_endpoints.input_endpoints.append(ConfigurationSetInputEndpoint(endpoint[0], endpoint[1], endpoint[2], endpoint[3]))
     else:
             self.network.input_endpoints.input_endpoints.append(ConfigurationSetInputEndpoint("ssh", 'TCP', str(util.ssh_endpoint(self.num)), '22'))