def setUp(self): # Start a Plasma store. self.store_name, self.p2 = plasma.start_plasma_store( use_valgrind=USE_VALGRIND) # Start a Redis server. self.redis_address = services.address("127.0.0.1", services.start_redis()[0]) # Start a PlasmaManagers. manager_name, self.p3, self.port1 = plasma.start_plasma_manager( self.store_name, self.redis_address, use_valgrind=USE_VALGRIND) # Connect a PlasmaClient. self.client = plasma.PlasmaClient(self.store_name, manager_name) # Store the processes that will be explicitly killed during tearDown so # that a test case can remove ones that will be killed during the test. self.processes_to_kill = [self.p2, self.p3]
def setUp(self): # Start one Redis server and N pairs of (plasma, local_scheduler) node_ip_address = "127.0.0.1" redis_port, self.redis_process = services.start_redis(cleanup=False) redis_address = services.address(node_ip_address, redis_port) # Create a Redis client. self.redis_client = redis.StrictRedis(host=node_ip_address, port=redis_port) # Start one global scheduler. self.p1 = global_scheduler.start_global_scheduler( redis_address, use_valgrind=USE_VALGRIND) self.plasma_store_pids = [] self.plasma_manager_pids = [] self.local_scheduler_pids = [] self.plasma_clients = [] self.local_scheduler_clients = [] for i in range(NUM_CLUSTER_NODES): # Start the Plasma store. Plasma store name is randomly generated. plasma_store_name, p2 = plasma.start_plasma_store() self.plasma_store_pids.append(p2) # Start the Plasma manager. # Assumption: Plasma manager name and port are randomly generated by the # plasma module. manager_info = plasma.start_plasma_manager(plasma_store_name, redis_address) plasma_manager_name, p3, plasma_manager_port = manager_info self.plasma_manager_pids.append(p3) plasma_address = "{}:{}".format(node_ip_address, plasma_manager_port) plasma_client = plasma.PlasmaClient(plasma_store_name, plasma_manager_name) self.plasma_clients.append(plasma_client) # Start the local scheduler. local_scheduler_name, p4 = local_scheduler.start_local_scheduler( plasma_store_name, plasma_manager_name=plasma_manager_name, plasma_address=plasma_address, redis_address=redis_address, static_resource_list=[10, 0]) # Connect to the scheduler. local_scheduler_client = local_scheduler.LocalSchedulerClient( local_scheduler_name, NIL_WORKER_ID, NIL_ACTOR_ID, False) self.local_scheduler_clients.append(local_scheduler_client) self.local_scheduler_pids.append(p4)
def setUp(self): # Start two PlasmaStores. store_name1, self.p2 = plasma.start_plasma_store( use_valgrind=USE_VALGRIND) store_name2, self.p3 = plasma.start_plasma_store( use_valgrind=USE_VALGRIND) # Start a Redis server. redis_address = services.address("127.0.0.1", services.start_redis()) # Start two PlasmaManagers. manager_name1, self.p4, self.port1 = plasma.start_plasma_manager( store_name1, redis_address, use_valgrind=USE_VALGRIND) manager_name2, self.p5, self.port2 = plasma.start_plasma_manager( store_name2, redis_address, use_valgrind=USE_VALGRIND) # Connect two PlasmaClients. self.client1 = plasma.PlasmaClient(store_name1, manager_name1) self.client2 = plasma.PlasmaClient(store_name2, manager_name2) # Store the processes that will be explicitly killed during tearDown so # that a test case can remove ones that will be killed during the test. # NOTE: If this specific order is changed, valgrind will fail. self.processes_to_kill = [self.p4, self.p5, self.p2, self.p3]