Beispiel #1
0
 def setUpClass(cls):
     # do the first one to build up hosts
     # so we don't repeatedly copy the jar
     # have to make sure base_port is the same on both!
     print "base_port:", base_port
     h2o_os_util.check_port_group(base_port)
     start = time.time()
     # writes it's own flatfile
     h2o_hosts.build_cloud_with_hosts(node_count, base_port=base_port, 
         use_flatfile=True, java_heap_GB=1)
     print "jar/flatfile copied and Cloud of", len(h2o.nodes), "built in", time.time()-start, "seconds"
     # have to remember total # of nodes for the next class. it will stay the same
     # when we tear down the cloud, we zero the nodes list
     global totalNodes
     totalNodes = len(h2o.nodes)
     check_cloud_and_setup_next()
Beispiel #2
0
    def __init__(self, *args, **kwargs):
        super(LocalH2O, self).__init__(*args, **kwargs)
        self.rc = None
        # FIX! no option for local /home/username ..always the sandbox (LOG_DIR)
        self.ice = tmp_dir('ice.')
        self.flatfile = flatfile_pathname()
        # so we can tell if we're remote or local. Apparently used in h2o_import.py
        self.remoteH2O = False 

        h2o_os_util.check_port_group(self.port)
        h2o_os_util.show_h2o_processes()

        if self.node_id is not None:
            logPrefix = 'local-h2o-' + str(self.node_id)
        else:
            logPrefix = 'local-h2o'

        spawn = spawn_cmd(logPrefix, cmd=self.get_args(), capture_output=self.capture_output)
        self.ps = spawn[0]
    def __init__(self, *args, **kwargs):
        super(LocalH2O, self).__init__(*args, **kwargs)
        self.rc = None
        # FIX! no option for local /home/username ..always the sandbox (LOG_DIR)
        self.ice = tmp_dir('ice.')
        self.flatfile = flatfile_pathname()
        # so we can tell if we're remote or local. Apparently used in h2o_import.py
        self.remoteH2O = False

        h2o_os_util.check_port_group(self.port)
        h2o_os_util.show_h2o_processes()

        if self.node_id is not None:
            logPrefix = 'local-h2o-' + str(self.node_id)
        else:
            logPrefix = 'local-h2o'

        # see https://docs.python.org/2/library/subprocess.html#subprocess.Popen
        # for why I'm using shlex to split the cmd string into a sequence
        # confusing issues, especially when thinking about windows too
        # OS/build     | os.name | platform.system()
        # -------------+---------+-----------------------
        # Win32 native | nt      | Windows
        # Win32 cygwin | posix   | CYGWIN_NT-5.1*
        # Win64 native | nt      | Windows
        # Win64 cygwin | posix   | CYGWIN_NT-6.1-WOW64*
        # Linux        | posix   | Linux

        # make it a string if cygwin or windows
        # in unix, the args was created with split by space. (assumption is no pathname has space)
        # need to pass string in windows..doesn't seem to assemble string from args list correctly
        # could make unix use shell and pass string?
        pf = platform.system()
        print "System is %s" % pf
        cmd = self.get_args()
        if re.match('win', pf, re.IGNORECASE):  # covers cygwin and windows
            cmd = " ".join(cmd)
        spawn = spawn_cmd(logPrefix,
                          cmd=cmd,
                          capture_output=self.capture_output)
        self.ps = spawn[0]
Beispiel #4
0
    def __init__(self, *args, **kwargs):
        super(LocalH2O, self).__init__(*args, **kwargs)
        self.rc = None
        # FIX! no option for local /home/username ..always the sandbox (LOG_DIR)
        self.ice = tmp_dir('ice.')
        self.flatfile = flatfile_pathname()
        # so we can tell if we're remote or local. Apparently used in h2o_import.py
        self.remoteH2O = False

        h2o_os_util.check_port_group(self.port)
        h2o_os_util.show_h2o_processes()

        if self.node_id is not None:
            logPrefix = 'local-h2o-' + str(self.node_id)
        else:
            logPrefix = 'local-h2o'

        spawn = spawn_cmd(logPrefix,
                          cmd=self.get_args(),
                          capture_output=self.capture_output)
        self.ps = spawn[0]
Beispiel #5
0
    def __init__(self, *args, **kwargs):
        super(LocalH2O, self).__init__(*args, **kwargs)
        self.rc = None
        # FIX! no option for local /home/username ..always the sandbox (LOG_DIR)
        self.ice = tmp_dir('ice.')
        self.flatfile = flatfile_pathname()
        # so we can tell if we're remote or local. Apparently used in h2o_import.py
        self.remoteH2O = False 

        h2o_os_util.check_port_group(self.port)
        h2o_os_util.show_h2o_processes()

        if self.node_id is not None:
            logPrefix = 'local-h2o-' + str(self.node_id)
        else:
            logPrefix = 'local-h2o'

        # see https://docs.python.org/2/library/subprocess.html#subprocess.Popen
        # for why I'm using shlex to split the cmd string into a sequence
        # confusing issues, especially when thinking about windows too
        # OS/build     | os.name | platform.system() 
        # -------------+---------+-----------------------
        # Win32 native | nt      | Windows
        # Win32 cygwin | posix   | CYGWIN_NT-5.1*
        # Win64 native | nt      | Windows
        # Win64 cygwin | posix   | CYGWIN_NT-6.1-WOW64*
        # Linux        | posix   | Linux

        # make it a string if cygwin or windows
        # in unix, the args was created with split by space. (assumption is no pathname has space)
        # need to pass string in windows..doesn't seem to assemble string from args list correctly
        # could make unix use shell and pass string?
        pf = platform.system()
        print "System is %s" % pf
        cmd = self.get_args()
        if re.match('win', pf, re.IGNORECASE): # covers cygwin and windows
            cmd = " ".join(cmd)
        spawn = spawn_cmd(logPrefix, cmd=cmd, capture_output=self.capture_output)
        self.ps = spawn[0]
Beispiel #6
0
    def __init__(self, *args, **kwargs):
        super(LocalH2O, self).__init__(*args, **kwargs)
        self.rc = None
        # FIX! no option for local /home/username ..always the sandbox (LOG_DIR)
        self.ice = tmp_dir('ice.')
        self.flatfile = flatfile_pathname()
        # so we can tell if we're remote or local. Apparently used in h2o_import.py
        self.remoteH2O = False 

        h2o_os_util.check_port_group(self.port)
        h2o_os_util.show_h2o_processes()

        if self.node_id is not None:
            logPrefix = 'local-h2o-' + str(self.node_id)
        else:
            logPrefix = 'local-h2o'

        # see https://docs.python.org/2/library/subprocess.html#subprocess.Popen
        # for why I'm using shlex to split the cmd string into a sequence
        # confusing issues, especially when thinking about windows too
        cmd = " ".join(self.get_args())
        cmdSplit = shlex.split(cmd)
        spawn = spawn_cmd(logPrefix, cmd=cmdSplit, capture_output=self.capture_output)
        self.ps = spawn[0]