Beispiel #1
0
    def add_description(self, name, remote_ip='127.0.0.1'):
        # Trick to handle json structure (last coma of the line)
        if 'nodename' not in self.completion[remote_ip]:
            self.completion[remote_ip]['last'] = name + '.log'
            self.completion[remote_ip]['nodename'] = remote_ip
            self.completion[remote_ip]['server_ip'] = utils.get_local_ip()

        else:
            self.completion[remote_ip]['logfiles'].append({'name': name + '.log'})

        return self.completion
Beispiel #2
0
    def add_description(self, name, remote_ip='127.0.0.1'):
        # Trick to handle json structure (last coma of the line)
        if 'nodename' not in self.completion[remote_ip]:
            self.completion[remote_ip]['last'] = name + '.log'
            self.completion[remote_ip]['nodename'] = remote_ip
            self.completion[remote_ip]['server_ip'] = utils.get_local_ip()

        else:
            self.completion[remote_ip]['logfiles'].append(
                {'name': name + '.log'})

        return self.completion
Beispiel #3
0
    def run(self, port=4000, public_ip=False):
        # Make sure no dashboard is already running
        self.shutdown()

        #NOTE run() in 'controller' role = local() ?
        #TODO with fabric.cd()
        with hide('output'):
            log.info(blue('Cleaning up previous layout'))
            local('cd {} && rake cleanup'.format(self.dashboard_path))
            log.info(blue('Populating database'))
            local('cd {} && rake custom_populate'.format(self.dashboard_path))
            log.info(blue('Running server'))
            local('cd {} && rails server -p {} -b {} &'.format(
                self.dashboard_path, port, utils.get_local_ip(public=public_ip)))
Beispiel #4
0
    def run(self, port=4000, public_ip=False):
        # Make sure no dashboard is already running
        self.shutdown()

        #NOTE run() in 'controller' role = local() ?
        #TODO with fabric.cd()
        with hide('output'):
            log.info(blue('Cleaning up previous layout'))
            local('cd {} && rake cleanup'.format(self.dashboard_path))
            log.info(blue('Populating database'))
            local('cd {} && rake custom_populate'.format(self.dashboard_path))
            log.info(blue('Running server'))
            local('cd {} && rails server -p {} -b {} &'.format(
                self.dashboard_path, port,
                utils.get_local_ip(public=public_ip)))
Beispiel #5
0
 def _run_harvester(self):
     #time.sleep(10)
     #NOTE I could run it on local as well to inspect report files
     #run('rm /home/xavier/.quantrade/log/*')
     if env.host == utils.get_local_ip():
         local('cp {}/{}-harvester.conf /home/{}/.log.io/harvester.conf'.format(
             self.templates_path, env.host, env.user))
         is_running(local, 'log.io-harvester', kill=True)
         with shell_env(NODE_PATH=self.node_path):
             with hide('output'):
                 local('log.io-harvester')
     else:
         local('scp {}/{}-harvester.conf {}@{}:.log.io/harvester.conf'.format(
             self.templates_path, env.host, env.user, env.host))
         is_running(run, 'log.io-harvester', kill=True)
         with shell_env(NODE_PATH=self.node_path):
             with hide('output'):
                 run('log.io-harvester')
Beispiel #6
0
 def _run_harvester(self):
     #time.sleep(10)
     #NOTE I could run it on local as well to inspect report files
     #run('rm /home/xavier/.quantrade/log/*')
     if env.host == utils.get_local_ip():
         local('cp {}/{}-harvester.conf /home/{}/.log.io/harvester.conf'.
               format(self.templates_path, env.host, env.user))
         is_running(local, 'log.io-harvester', kill=True)
         with shell_env(NODE_PATH=self.node_path):
             with hide('output'):
                 local('log.io-harvester')
     else:
         local(
             'scp {}/{}-harvester.conf {}@{}:.log.io/harvester.conf'.format(
                 self.templates_path, env.host, env.user, env.host))
         is_running(run, 'log.io-harvester', kill=True)
         with shell_env(NODE_PATH=self.node_path):
             with hide('output'):
                 run('log.io-harvester')