def passRetrieveCondition(self):
        """
        _passRetrieveCondition_
        Return true if the component can proceed with fetching work.
        False if the component should skip pulling work this cycle.

        For now, it only checks whether the agent is in drain mode or
        MAX_JOBS_PER_OWNER is reached or if the condor schedd is overloaded.
        """

        passCond = "OK"
        myThread = threading.currentThread()
        if isDrainMode(self.config):
            passCond = "No work will be pulled: Agent is in drain"
        elif availableScheddSlots(myThread.dbi) <= 0:
            passCond = "No work will be pulled: schedd slot is maxed: MAX_JOBS_PER_OWNER"
        elif self.condorAPI.isScheddOverloaded():
            passCond = "No work will be pulled: schedd is overloaded"
        else:
            subscriptions = self.listSubsWithoutJobs.execute()
            if subscriptions:
                passCond = "No work will be pulled: "
                passCond += "JobCreator hasn't created jobs for subscriptions %s" % subscriptions

        return passCond
    def passRetrieveCondition(self):
        """
        _passRetrieveCondition_
        Return true if the component can proceed with fetching work.
        False if the component should skip pulling work this cycle.

        For now, it only checks whether the agent is in drain mode or
        MAX_JOBS_PER_OWNER is reached or if the condor schedd is overloaded.
        """

        passCond = "OK"
        myThread = threading.currentThread()
        if isDrainMode(self.config):
            passCond = "No work will be pulled: Agent is in drain"
        elif availableScheddSlots(myThread.dbi) <= 0:
            passCond = "No work will be pulled: schedd slot is maxed: MAX_JOBS_PER_OWNER"
        elif self.condorAPI.isScheddOverloaded():
            passCond = "No work will be pulled: schedd is overloaded"
        else:
            subscriptions = self.listSubsWithoutJobs.execute()
            if subscriptions:
                passCond = "No work will be pulled: "
                passCond += "JobCreator hasn't created jobs for subscriptions %s" % subscriptions

        return passCond
示例#3
0
    def passSubmitConditions(self):
        """
        _passSubmitConditions_

        Check whether the component is allowed to submit jobs to condor.

        Initially it has only one condition, which is the total number of
        jobs we can have in condor (pending + running) per schedd, set by
        MAX_JOBS_PER_OWNER.
        """

        myThread = threading.currentThread()
        freeSubmitSlots = availableScheddSlots(dbi=myThread.dbi, logger=logging,
                                               condorFraction=self.condorFraction)
        self.maxJobsThisCycle = min(freeSubmitSlots, self.maxJobsPerPoll)

        return (self.maxJobsThisCycle > 0)
示例#4
0
    def passSubmitConditions(self):
        """
        _passSubmitConditions_

        Check whether the component is allowed to submit jobs to condor.

        Initially it has only one condition, which is the total number of
        jobs we can have in condor (pending + running) per schedd, set by
        MAX_JOBS_PER_OWNER.
        """

        myThread = threading.currentThread()
        freeSubmitSlots = availableScheddSlots(dbi=myThread.dbi, logger=logging,
                                               condorFraction=self.condorFraction)
        self.maxJobsThisCycle = min(freeSubmitSlots, self.maxJobsPerPoll)

        return (freeSubmitSlots > 0)
    def passRetrieveCondition(self):
        """
        _passRetrieveCondition_
        Return true if the component can proceed with fetching work.
        False if the component should skip pulling work this cycle.

        For now, it only checks whether the agent is in drain mode or
        MAX_JOBS_PER_OWNER is reached or if the condor schedd is overloaded.
        """

        passCond = "OK"
        myThread = threading.currentThread()
        if isDrainMode(self.config):
            passCond = "No work will be pulled: Agent is in drain"
        elif availableScheddSlots(myThread.dbi) <= 0:
            passCond = False
            passCond = "No work will be pulled: schedd slot is maxed: MAX_JOBS_PER_OWNER"
        elif self.condorAPI.isScheddOverloaded():
            passCond = "No work will be pulled: shedd is overloaded"

        return passCond
    def passRetrieveCondition(self):
        """
        _passRetrieveCondition_
        Return true if the component can proceed with fetching work.
        False if the component should skip pulling work this cycle.

        For now, it only checks whether the agent is in drain mode or
        MAX_JOBS_PER_OWNER is reached or if the condor schedd is overloaded.
        """

        passCond = "OK"
        myThread = threading.currentThread()
        if isDrainMode(self.config):
            passCond = "No work will be pulled: Agent is in drain"
        elif availableScheddSlots(myThread.dbi) <= 0:
            passCond = False
            passCond = "No work will be pulled: schedd slot is maxed: MAX_JOBS_PER_OWNER"
        elif self.condorAPI.isScheddOverloaded():
            passCond = "No work will be pulled: shedd is overloaded"

        return passCond