Exemple #1
0
    def __init__(self, agent_id, node, scheduler_config):
        """Constructor

        :param agent_id: The Mesos agent ID for the node
        :type agent_id: string
        :param node: The node model
        :type node: :class:`node.models.Node`
        :param scheduler_config: The scheduler configuration
        :type scheduler_config: :class:`scheduler.configuration.SchedulerConfiguration`
        """

        self._hostname = str(node.hostname)  # Never changes
        self._id = node.id  # Never changes

        self._agent_id = agent_id
        self._cleanup = NodeCleanup()
        self._cleanup_task = None
        self._conditions = NodeConditions(self._hostname)
        self._health_task = None
        self._is_active = node.is_active
        self._is_image_pulled = False
        self._is_initial_cleanup_completed = False
        self._is_online = True
        self._is_paused = node.is_paused
        self._is_scheduler_paused = scheduler_config.is_paused
        self._last_health_task = None
        self._last_offer_received = node.last_offer_received
        self._lock = threading.Lock()
        self._pull_task = None
        self._state = None
        self._update_state()
Exemple #2
0
    def setUp(self):
        django.setup()

        self.conditions = NodeConditions('test_node')
        self.job_exes = [job_test_utils.create_running_job_exe()]
        self.job_ids = [exe.job_id for exe in self.job_exes]