def testSchedulerProvisionsIngest(self): """ Ensure that the scheduler correcly coordinates ingest onto the Cluster and into the Buffer Returns ------- """ pipelines = {"continuum": {"demand": 5}} observation = Observation('planner_observation', OBS_START_TME, OBS_DURATION, OBS_DEMAND, OBS_WORKFLOW, type="continuum", data_rate=2) ready_status = self.scheduler.check_ingest_capacity( observation, pipelines) observation.status = RunStatus.WAITING status = self.env.process( self.scheduler.allocate_ingest(observation, pipelines)) self.env.run(until=1) self.assertEqual(5, len(self.cluster.available_resources)) # After 1 timestep, data in the HotBuffer should be 2 self.assertEqual(498, self.buffer.hot.current_capacity) self.env.run(until=11) self.assertEqual(10, len(self.cluster.available_resources)) self.assertEqual(5, len(self.cluster.finished_tasks)) self.assertEqual(480, self.buffer.hot.current_capacity)
def setUp(self): self.env = simpy.Environment() sched_algorithm = FifoAlgorithm() self.planner = Planner(self.env, PLAN_ALGORITHM, MACHINE_CONFIG) self.cluster = Cluster(self.env, CLUSTER_CONFIG) # self.buffer = Buffer(self.env, self.cluster) # self.algorithms = Scheduler(self.env, # sched_algorithm, self.buffer, self.cluster) self.observation = Observation('planner_observation', OBS_START_TME, OBS_DURATION, OBS_DEMAND, OBS_WORKFLOW) pass
def setUp(self): self.env = simpy.Environment() self.cluster = Cluster(self.env, CLUSTER_CONFIG) self.planner = Planner(self.env, PLAN_ALGORITHM, self.cluster) self.observation = Observation('planner_observation', OBS_START_TME, OBS_DURATION, OBS_DEMAND, OBS_WORKFLOW, type=None, data_rate=None)
def setUp(self) -> None: self.env = simpy.Environment() self.cluster = Cluster(env=self.env, spec=CLUSTER_CONFIG) self.observation = Observation( 'planner_observation', OBS_START_TME, OBS_DURATION, OBS_DEMAND, OBS_WORKFLOW, type=None, data_rate=None )
def process_telescope_config(telescope_config): observations = [] infile = open(telescope_config) config = pd.read_csv(infile) # config. # Format is name, start, duration, demand, filename for i in range(len(config)): obs = config.iloc[i, :] observation = Observation(obs['name'], int(obs['start']), int(obs['duration']), int(obs['demand']), obs['filename']) observations.append(observation) infile.close() return observations
def setUp(self): self.env = simpy.Environment() self.cluster = Cluster(env=self.env, spec=CLUSTER_CONFIG) self.buffer = Buffer(env=self.env, cluster=self.cluster, config=BUFFER_CONFIG) self.planner = Planner(self.env, PLAN_ALGORITHM, self.cluster) self.observation = Observation('scheduler_observation', OBS_START_TME, OBS_DURATION, OBS_DEMAND, OBS_WORKFLOW, type='continuum', data_rate=2)
def setUp(self): self.env = simpy.Environment() sched_algorithm = FifoAlgorithm() self.planner = Planner(self.env, test_data.planning_algorithm, test_data.machine_config) self.cluster = Cluster(self.env, CLUSTER_CONFIG) self.buffer = Buffer(self.env, self.cluster, BUFFER_CONFIG) self.observations = [ Observation('scheduler_observation', OBS_START_TME, OBS_DURATION, OBS_DEMAND, OBS_WORKFLOW, type='continuum', data_rate=5) ] telescopemax = 36 # maximum number of antennas self.telescope = Telescope(self.env, OBSERVATION_CONFIG, self.scheduler, self.planner) self.scheduler = Scheduler(self.env, sched_algorithm, self.buffer, self.cluster)
def setUp(self): """ Returns ------- """ """ setup the buffer and do config stuff :return: Nothing """ self.env = simpy.Environment() self.cluster = Cluster(self.env, CLUSTER_CONFIG) self.buffer = Buffer(self.env, self.cluster, BUFFER_CONFIG) self.observation = Observation( name='test_observation', start=OBS_START_TME, duration=OBS_DURATION, demand=OBS_DEMAND, workflow=OBS_WORKFLOW, type='continuum', data_rate=5, )
def testSchdulerCheckIngestReady(self): """ Check the return status of check_ingest_capacity is correct """ pipelines = {"continuum": {"demand": 5}} observation = Observation('planner_observation', OBS_START_TME, OBS_DURATION, OBS_DEMAND, OBS_WORKFLOW, type="continuum", data_rate=2) # There should be capacity self.assertEqual(0.0, self.env.now) ret = self.scheduler.check_ingest_capacity(observation, pipelines) self.assertTrue(ret) # Let's remove capacity to check it returns false tmp = self.cluster.available_resources self.cluster.available_resources = self.cluster.available_resources[:3] ret = self.scheduler.check_ingest_capacity(observation, pipelines) self.assertFalse(ret) self.cluster.available_resources = tmp self.assertEqual(10, len(self.cluster.available_resources))