async def run(self, server): reporter_pb2_grpc.add_ReporterServiceServicer_to_server(self, server) gcs_addr = self._dashboard_agent.gcs_address assert gcs_addr is not None publisher = GcsAioPublisher(address=gcs_addr) await self._perform_iteration(publisher)
async def run(self, server): reporter_pb2_grpc.add_ReporterServiceServicer_to_server(self, server) if gcs_pubsub_enabled(): gcs_addr = self._dashboard_agent.gcs_address if gcs_addr is None: aioredis_client = await aioredis.create_redis_pool( address=self._dashboard_agent.redis_address, password=self._dashboard_agent.redis_password, ) gcs_addr = await aioredis_client.get("GcsServerAddress") gcs_addr = gcs_addr.decode() publisher = GcsAioPublisher(address=gcs_addr) async def publish(key: str, data: str): await publisher.publish_resource_usage(key, data) else: aioredis_client = await aioredis.create_redis_pool( address=self._dashboard_agent.redis_address, password=self._dashboard_agent.redis_password, ) async def publish(key: str, data: str): await aioredis_client.publish(key, data) await self._perform_iteration(publish)
def run(self): """Publish the port.""" thread_pool = futures.ThreadPoolExecutor(max_workers=10) server = grpc.server(thread_pool, options=(("grpc.so_reuseport", 0), )) reporter_pb2_grpc.add_ReporterServiceServicer_to_server( ReporterServer(), server) port = server.add_insecure_port("[::]:{}".format(self.port)) server.start() self.redis_client.set("REPORTER_PORT:{}".format(self.ip), port) """Run the reporter.""" while True: try: self.perform_iteration() except Exception: traceback.print_exc() pass time.sleep(ray_constants.REPORTER_UPDATE_INTERVAL_MS / 1000)
async def run(self, server): reporter_pb2_grpc.add_ReporterServiceServicer_to_server(self, server) await self._perform_iteration()
async def run(self, server): aioredis_client = await aioredis.create_redis_pool( address=self._dashboard_agent.redis_address, password=self._dashboard_agent.redis_password) reporter_pb2_grpc.add_ReporterServiceServicer_to_server(self, server) await self._perform_iteration(aioredis_client)
async def run(self, server): if server: reporter_pb2_grpc.add_ReporterServiceServicer_to_server( self, server) await self._perform_iteration(self._dashboard_agent.publisher)