Exemplo n.º 1
0
    def setUp(self):
        super(TestRenderingTask, self).setUp()
        files = self.additional_dir_content([3])
        task_definition = TaskDefinition()
        task_definition.max_price = 1000
        task_definition.task_id = "xyz"
        task_definition.estimated_memory = 1024
        task_definition.full_task_timeout = 3600
        task_definition.subtask_timeout = 600
        task_definition.main_scene_file = files[1]
        task_definition.resolution = [800, 600]
        task_definition.output_file = files[2]
        task_definition.output_format = ".png"

        task = RenderingTaskMock(
            main_program_file=files[0],
            node_name="ABC",
            task_definition=task_definition,
            total_tasks=100,
            root_path=self.path,
            owner_address="10.10.10.10",
            owner_port=1023,
            owner_key_id="keyid",
        )

        dm = DirManager(self.path)
        task.initialize(dm)
        self.task = task
Exemplo n.º 2
0
 def _get_core_task_definition():
     task_definition = TaskDefinition()
     task_definition.max_price = 100
     task_definition.task_id = "xyz"
     task_definition.estimated_memory = 1024
     task_definition.timeout = 3000
     task_definition.subtask_timeout = 30
     return task_definition
Exemplo n.º 3
0
 def _get_core_task(self):
     task_definition = TaskDefinition()
     task_definition.max_price = 100
     task_definition.task_id = "xyz"
     task_definition.estimated_memory = 1024
     task_definition.full_task_timeout = 3000
     task_definition.subtask_timeout = 30
     task = CoreTask(
         src_code="src code",
         task_definition=task_definition,
         node_name="ABC",
         owner_address="10.10.10.10",
         owner_port=123,
         owner_key_id="key",
         environment="environment",
         resource_size=1024,
     )
     dm = DirManager(self.path)
     task.initialize(dm)
     return task