Ejemplo n.º 1
0
    def start(self, env):
        import params

        env.set_params(params)
        self.configure(env)

        service("drpc", action="start")
Ejemplo n.º 2
0
 def start(self, env):
   import params
   env.set_params(params)
   self.configure(env) # FOR SECURITY
   service('jobtracker',
           action='start'
   )
Ejemplo n.º 3
0
    def start(self, env):
        import params

        env.set_params(params)
        self.configure(env)  # FOR SECURITY
        copy_tarballs_to_hdfs("mapreduce", params.mapred_user, params.hdfs_user, params.user_group)
        service("historyserver", action="start", serviceName="mapreduce")
Ejemplo n.º 4
0
  def stop(self, env):
    import params
    env.set_params(params)

    service('nodemanager',
            action='stop'
    )
Ejemplo n.º 5
0
  def start(self, env, rolling_restart=False):
    import params
    env.set_params(params)
    self.configure(env) # FOR SECURITY
    service('timelineserver', action='start')

    Links(params.new_yarn_log_path, params.yarn_log_path)
Ejemplo n.º 6
0
  def start(self, env):
    import params
    env.set_params(params)
    self.configure(env)

    service("supervisor", action="start")
    service("logviewer", action="start")
Ejemplo n.º 7
0
  def start(self, env, rolling_restart=False):
    import params
    env.set_params(params)
    self.configure(env)

    supervisord_service("supervisor", action="start")
    service("logviewer", action="start")
Ejemplo n.º 8
0
  def stop(self, env):
    import params
    env.set_params(params)

    service('jobtracker',
            action='stop'
    )
Ejemplo n.º 9
0
 def start(self, env):
   import params
   env.set_params(params)
   self.configure(env)
   service('historyserver',
           action='start'
   )
Ejemplo n.º 10
0
  def stop(self, env):
    import params
    env.set_params(params)

    service('historyserver',
            action='stop'
    )
Ejemplo n.º 11
0
  def start(self, env):
    import params

    env.set_params(params)
    self.configure(env) # FOR SECURITY
    service('resourcemanager',
            action='start'
    )
Ejemplo n.º 12
0
  def stop(self, env, rolling_restart=False):
    import params

    env.set_params(params)

    service('resourcemanager',
            action='stop'
    )
Ejemplo n.º 13
0
  def start(self, env, rolling_restart=False):
    import params

    env.set_params(params)
    self.configure(env) # FOR SECURITY
    if params.has_ranger_admin and params.is_supported_yarn_ranger:
      setup_ranger_yarn() #Ranger Yarn Plugin related calls
    service('resourcemanager', action='start')
Ejemplo n.º 14
0
  def start(self, env, rolling_restart=False):
    import params
    env.set_params(params)
    self.configure(env) # FOR SECURITY
    service('nodemanager',action='start')

    Links(params.new_yarn_nodemanager_local_dirs_path, params.yarn_nodemanager_local_dirs_paths)
    Links(params.new_yarn_nodemanager_log_dirs_path, params.yarn_nodemanager_log_dirs_paths)
    Links(params.new_yarn_log_path, params.yarn_log_path)
Ejemplo n.º 15
0
  def refreshqueues(self, env):
    import params

    self.configure(env)
    env.set_params(params)

    service('resourcemanager',
            action='refreshQueues'
    )
Ejemplo n.º 16
0
  def start(self, env, upgrade_type=None):
    import params

    env.set_params(params)
    self.configure(env) # FOR SECURITY
    if params.has_ranger_admin and params.is_supported_yarn_ranger:
      setup_ranger_yarn() #Ranger Yarn Plugin related calls

    # wait for active-dir and done-dir to be created by ATS if needed
    if params.has_ats:
      Logger.info("Verifying DFS directories where ATS stores time line data for active and completed applications.")
      self.wait_for_dfs_directories_created(params.entity_groupfs_store_dir, params.entity_groupfs_active_dir)

    service('resourcemanager', action='start')
Ejemplo n.º 17
0
def main():
        
        config = ConfigParser.SafeConfigParser()
        config.read('/opt/raumServiceDeamon/src/deamon.cfg')
        
        dataPool = {'security': {'motion': False, 'door': False, 'motion_C': "CLOSED"}, 'weather': {'out': 0.0, 'rain': False, 'in': 0.0}}

        checkRRD(config)
        
        signal.signal(signal.SIGINT, kill_signal_handler)
        signal.signal(signal.SIGTERM, kill_signal_handler)
        
        #fillDummyData(dataPool) # DEBUG
        
        t = UploadDeamon(config, dataPool)
        t.start()

        tem = temperatur(config, dataPool)
        tem.start()
        
        sec = security(config, dataPool, t)
        sec.start()
        
        gra = graph(config)
        gra.start()
        
        global ser
        ser = service(dataPool)
        ser.start()
Ejemplo n.º 18
0
  def start(self, env, rolling_restart=False):
    import params
    env.set_params(params)
    self.configure(env) # FOR SECURITY

    if params.hdp_stack_version_major and compare_versions(params.hdp_stack_version_major, '2.2.0.0') >= 0:
      # MC Hammer said, "Can't touch this"
      resource_created = copy_to_hdfs("mapreduce", params.user_group, params.hdfs_user)
      resource_created = copy_to_hdfs("tez", params.user_group, params.hdfs_user) or resource_created
      if resource_created:
        params.HdfsResource(None, action="execute")
    else:
      # In HDP 2.1, tez.tar.gz was copied to a different folder in HDFS.
      install_tez_jars()

    service('historyserver', action='start', serviceName='mapreduce')
Ejemplo n.º 19
0
 def _channelInfoRequest(self):
     requestInfo = dict(part = "contentDetails,snippet,statistics")
     
     if self.mine:           requestInfo['mine'] = True
     elif self.channelId:    requestInfo['id'] = self.channelId
     else:                   requestInfo['forUsername'] = self.username
     
     request = service.service().channels().list(**requestInfo)
     return request 
Ejemplo n.º 20
0
    def start(self, env):
        import params

        env.set_params(params)
        install_yarn()
        self.configure(env)  # FOR SECURITY
        if params.enable_ranger_yarn and params.is_supported_yarn_ranger:
            setup_ranger_yarn()  #Ranger Yarn Plugin related calls

        # wait for active-dir and done-dir to be created by ATS if needed
        if params.has_ats:
            Logger.info(
                "Verifying DFS directories where ATS stores time line data for active and completed applications."
            )
            self.wait_for_dfs_directories_created(
                params.entity_groupfs_store_dir,
                params.entity_groupfs_active_dir)

        service('resourcemanager', action='start')
Ejemplo n.º 21
0
    def start(self, env, rolling_restart=False):
        import params
        env.set_params(params)
        self.configure(env)  # FOR SECURITY

        if params.hdp_stack_version_major and compare_versions(
                params.hdp_stack_version_major, '2.2.0.0') >= 0:
            # MC Hammer said, "Can't touch this"
            resource_created = copy_to_hdfs("mapreduce", params.user_group,
                                            params.hdfs_user)
            resource_created = copy_to_hdfs(
                "tez", params.user_group, params.hdfs_user) or resource_created
            if resource_created:
                params.HdfsResource(None, action="execute")
        else:
            # In HDP 2.1, tez.tar.gz was copied to a different folder in HDFS.
            install_tez_jars()

        service('historyserver', action='start', serviceName='mapreduce')
Ejemplo n.º 22
0
 def getUpdateRequest(self):
     request = service.service().playlistItems().list(part="snippet", playlistId=self.id, maxResults=self.limit)
     
     def callback(request_id, response, exception):
         if exception is not None:
             raise ValueError('Exception thrown in update playlist videos http request from batch. Request ID: %s \nException: %s' %(request_id,exception))
         else:
             self._processUpdateResponse(response)
             
     return (request, callback)
Ejemplo n.º 23
0
    def start(self, env, upgrade_type=None):
        import params
        env.set_params(params)
        self.configure(env)  # FOR SECURITY

        # MC Hammer said, "Can't touch this"
        resource_created = copy_to_hdfs("mapreduce",
                                        params.user_group,
                                        params.hdfs_user,
                                        skip=params.host_sys_prepped)
        resource_created = copy_to_hdfs(
            "slider",
            params.user_group,
            params.hdfs_user,
            skip=params.host_sys_prepped) or resource_created
        if resource_created:
            params.HdfsResource(None, action="execute")

        service('historyserver', action='start', serviceName='mapreduce')
Ejemplo n.º 24
0
    def start(self, env, rolling_restart=False):
        import params
        env.set_params(params)
        self.configure(env)  # FOR SECURITY

        if params.version and compare_versions(
                format_hdp_stack_version(params.version), '2.2.0.0') >= 0:
            params.HdfsResource(
                InlineTemplate(params.mapreduce_tar_destination).get_content(),
                type="file",
                action="create_on_execute",
                source=params.mapreduce_tar_source,
                owner=params.hdfs_user,
                group=params.user_group,
                mode=0444,
            )
            params.HdfsResource(None, action="execute")

        service('historyserver', action='start', serviceName='mapreduce')
Ejemplo n.º 25
0
def fetch():    
    request = service.service().guideCategories().list(part='snippet', regionCode=regionCode)
    response = request.execute()
    
    categories = []
        
    for item in response['items']:
        category = Category.fromCategoryList(item)
        categories.append(category)
        
    return categories
Ejemplo n.º 26
0
    def getInitialRequest(self):
        request = service.service().playlists().list(part = "snippet", id=self.id)
        
        def callback(request_id, response, exception):
            if exception is not None:
                raise ValueError(str.format('Exception thrown in initial playlist info http request from batch. \nRequest ID: {0}. Playlist ID: {1}. \nException: {2}', request_id, self.id, exception))
            else:
                self._processInitialResponse(response)
                

        return (request, callback)
Ejemplo n.º 27
0
  def start(self, env, rolling_restart=False):
    import params

    env.set_params(params)
    self.configure(env) # FOR SECURITY
    if params.is_supported_yarn_ranger:
      setup_ranger_yarn() #Ranger Yarn Plugin related calls 
    if not Script.is_hdp_stack_greater_or_equal("2.2"):
      install_tez_jars()
    else:
      # will work only for stack versions >=2.2
      params.HdfsResource(InlineTemplate(params.tez_tar_destination).get_content(),
                          type="file",
                          action="create_on_execute",
                          source=params.tez_tar_source,
                          group=params.user_group,
                          owner=params.hdfs_user
      )
      params.HdfsResource(None, action="execute")
    service('resourcemanager', action='start')
Ejemplo n.º 28
0
def fetch():
    request = service.service().guideCategories().list(part='snippet',
                                                       regionCode=regionCode)
    response = request.execute()

    categories = []

    for item in response['items']:
        category = Category.fromCategoryList(item)
        categories.append(category)

    return categories
Ejemplo n.º 29
0
def init(adapter):
    c = adapter.getCommunicator()
    logging.trace("Tartarus.Time",
                  "Initializing...",
                  log_to=c,
                  cond="Tartarus.Time.trace")
    #d = c.getProperties().getPropertyAsInt('Tartarus.Time.deploy')

    adapter.add(service.service(), c.stringToIdentity("Service/Time"))
    loc = auth.SrvLocator()
    loc.add_object(TimeI.TimeI(), c.stringToIdentity("Time/Server"))
    adapter.addServantLocator(loc, "Time")
Ejemplo n.º 30
0
	def service(self,
		action, service_name, rule, log_prefix, rule_comment, act=True
	):
		if action not in ("in", "out"):
			return self.error(act)

		if act:
			return service(self._controller,
				action, service_name, rule, log_prefix, rule_comment
			)
		else:
			return "service({}, {}, {})".format(action, service_name, rule)
Ejemplo n.º 31
0
def runService(request):
    print("[+] Starting service")
    thisSwitch = Switch
    thisSwitch.startService()

    #service functions
    global Service
    Service = service(thisSwitch)
    Service.runThread()

    status = thisSwitch.retStatus()
    html = loader.get_template('frontend/index.html')
    backupCards = backupFolder.objects.all()
    context = {'status': status.upper(), 'backupCards': backupCards}
    return HttpResponse(html.render(context, request))
Ejemplo n.º 32
0
  def start(self, env, upgrade_type=None):
    import params
    env.set_params(params)
    self.configure(env) # FOR SECURITY

    if params.stack_version_formatted_major and check_stack_feature(StackFeature.COPY_TARBALL_TO_HDFS, params.stack_version_formatted_major):
      # MC Hammer said, "Can't touch this"
      resource_created = copy_to_hdfs(
        "mapreduce",
        params.user_group,
        params.hdfs_user,
        skip=params.sysprep_skip_copy_tarballs_hdfs)
      resource_created = copy_to_hdfs(
        "tez",
        params.user_group,
        params.hdfs_user,
        skip=params.sysprep_skip_copy_tarballs_hdfs) or resource_created
      if resource_created:
        params.HdfsResource(None, action="execute")
    else:
      # In stack versions before copy_tarball_to_hdfs support tez.tar.gz was copied to a different folder in HDFS.
      install_tez_jars()

    service('historyserver', action='start', serviceName='mapreduce')
Ejemplo n.º 33
0
  def start(self, env, upgrade_type=None):
    import params

    env.set_params(params)
    self.configure(env) # FOR SECURITY
    if params.enable_ranger_yarn and params.is_supported_yarn_ranger:
      setup_ranger_yarn() #Ranger Yarn Plugin related calls

    # wait for active-dir and done-dir to be created by ATS if needed
    if params.has_ats:
      Logger.info("Verifying DFS directories where ATS stores time line data for active and completed applications.")
      self.wait_for_dfs_directories_created(params.entity_groupfs_store_dir, params.entity_groupfs_active_dir)

    if params.stack_version_formatted_major and check_stack_feature(StackFeature.COPY_TARBALL_TO_HDFS, params.stack_version_formatted_major):
      # MC Hammer said, "Can't touch this"
      resource_created = copy_to_hdfs(
        "yarn",
        params.user_group,
        params.hdfs_user,
        skip=params.sysprep_skip_copy_tarballs_hdfs) or resource_created
      if resource_created:
        params.HdfsResource(None, action="execute")

    service('resourcemanager', action='start')
Ejemplo n.º 34
0
    def run(self):
        while True:
            try:
                msg_received = self.connection.recv(1024).decode()
                service_ans = sv.service(msg_received, self.cache)

                #Connection check
                if self.allow == False:
                    if service_ans == sv.CONNECT_FLAG:  #CONNECT Command
                        print("CONNECT command sent by: " + str(self.addr) +
                              " [Connection allowed]")
                        self.allow = True
                        self.connection.send("CONNECT: OK".encode())
                        continue
                    elif service_ans == sv.EXIT_FLAG:  #EXIT Command
                        print("EXIT command sent by: " + str(self.addr))
                        self.connection.send("EXIT: OK".encode())
                        break
                    else:  #Client not connected sent a command
                        self.connection.send("FAILURE: REFUSED".encode())
                        continue
                else:  #Client already connected sent a CONNECT
                    if service_ans == sv.CONNECT_FLAG:
                        self.connection.send(
                            "FAILURE: ALREADY_CONNECTED".encode())
                        continue

                if service_ans == sv.EXIT_FLAG:
                    self.allow = False
                    print("EXIT command sent by: " + str(self.addr))
                    self.connection.send("EXIT: OK".encode())
                    break
                elif service_ans == sv.KILL_FLAG:  #WARNING: This could be a security hole
                    print("KILL command sent by: " + str(self.addr))
                    self.connection.send("KILL: OK".encode())
                    sys.exit()
                elif service_ans == sv.FAILURE_FLAG:
                    self.connection.send("FAILURE: PARSING_ERROR".encode())
                else:
                    self.connection.send(service_ans.encode())
            except:
                break
        print("Disconnected: " + str(self.addr))
        self.connection.close()
        sv.merge_cache(self.cache)
Ejemplo n.º 35
0
def ui(path, **kwargs):
  tpath = os.path.join('templates', path)
  service_dec = service.service(**kwargs)
  def decorator(f):
    f = service_dec(f)
    def wrapper(self):
      def pre_hook():
        self.facebook = facebook.FacebookSupport(self)
        self.template.stability_level = str(system.getSystem().stability_level)
        self.template.current_version_id = os.environ.get('CURRENT_VERSION_ID')
        self.template.cache_stats = memcache.Client().get_stats()
        if self.account.trusted:
          self.template.delete_return_url = self.request.url
          self.template.draft_page = browse.PageSpecifier(mode='draft')
          self.template.my_page = browse.PageSpecifier(mode='recent',
                                                       account=self.account)
      tmpl = service.Template()
      f(self, template=tmpl, pre_hook=pre_hook)
      if self.status == 200:
        self.response.out.write(template.render(tpath, tmpl.__dict__, debug=True))
    return wrapper
  return decorator
Ejemplo n.º 36
0
  def start(self, env, rolling_restart=False):
    import params
    env.set_params(params)
    self.configure(env)

    service("drpc", action="start")
Ejemplo n.º 37
0
  def stop(self, env, rolling_restart=False):
    import params
    env.set_params(params)

    service("drpc", action="stop")
 def stop(self, env):
     import params
     env.set_params(params)
     service('timelineserver', action='stop')
Ejemplo n.º 39
0
 def status(self, env):
     service('nodemanager', action='status')
Ejemplo n.º 40
0
  def start(self, env, upgrade_type=None):
    import params
    env.set_params(params)
    self.configure(env)

    service("drpc", action="start")
Ejemplo n.º 41
0
 def main(self):
     service() # insert the def you want to run
Ejemplo n.º 42
0
    def stop(self, env, upgrade_type=None):
        import params

        env.set_params(params)

        service('resourcemanager', action='stop')
Ejemplo n.º 43
0
 def stop(self, env, rolling_restart=False):
     import params
     env.set_params(params)
     service('timelineserver', action='stop')
Ejemplo n.º 44
0
 def start(self, env):
   import params
   env.set_params(params)
   self.configure(env) # FOR SECURITY
   service('historyserver', action='start', serviceName='mapreduce')
Ejemplo n.º 45
0
 def start(self, env, upgrade_type=None):
   import params
   env.set_params(params)
   self.configure(env) # FOR SECURITY
   service('nodemanager',action='start')
Ejemplo n.º 46
0
    def stop(self, env, upgrade_type=None):
        import params
        env.set_params(params)

        supervisord_service("supervisor", action="stop")
        service("logviewer", action="stop")
Ejemplo n.º 47
0
    def start(self, env, upgrade_type=None):
        import params

        env.set_params(params)
        self.configure(env)  # FOR SECURITY
        service('resourcemanager', action='start')
Ejemplo n.º 48
0
    def start(self, env):
        import params
        env.set_params(params)
        self.configure(env)

        service("rest_api", action="start")
Ejemplo n.º 49
0
 def start(self, env, rolling_restart=False):
     import params
     env.set_params(params)
     self.configure(env)  # FOR SECURITY
     service('timelineserver', action='start')
Ejemplo n.º 50
0
    def stop(self, env):
        import params
        env.set_params(params)

        service("rest_api", action="stop")
Ejemplo n.º 51
0
 def status(self, env):
     service('timelineserver', action='status')
Ejemplo n.º 52
0
 def start(self, env):
     import params
     env.set_params(params)
     self.configure(env)
     service('resourcemanager', action='start')
Ejemplo n.º 53
0
 def stop(self, env, upgrade_type=None):
     import params
     env.set_params(params)
     service("ui", action="stop")
Ejemplo n.º 54
0
 def status(self, env):
     service('resourcemanager', action='status')
Ejemplo n.º 55
0
 def status(self, env):
   service('nodemanager', action='status')
Ejemplo n.º 56
0
 def start(self, env, rolling_restart=False):
     import params
     env.set_params(params)
     self.configure(env)
     setup_ranger_storm()
     service("nimbus", action="start")
Ejemplo n.º 57
0
 def stop(self, env):
   import params
   env.set_params(params)
   service('historyserver', action='stop', serviceName='mapreduce')
Ejemplo n.º 58
0
    def start(self, env, upgrade_type=None):
        import params
        env.set_params(params)
        self.configure(env)

        service("drpc", action="start")
Ejemplo n.º 59
0
  def stop(self, env, upgrade_type=None):
    import params
    env.set_params(params)

    service("drpc", action="stop")
 def stop(self, env, upgrade_type=None):
     import params
     env.set_params(params)
     service('timelineserver', action='stop')