Пример #1
0
    def issueBatchJob(self, jobNode):
        """
        Issues the following command returning a unique jobID. Command is the string to run, memory
        is an int giving the number of bytes the job needs to run in and cores is the number of cpus
        needed for the job and error-file is the path of the file to place any std-err/std-out in.
        """
        localID = self.handleLocalJob(jobNode)
        if localID:
            return localID
        self.checkResourceRequest(jobNode.memory, jobNode.cores, jobNode.disk)
        jobID = self.getNextJobID()
        job = ToilJob(jobID=jobID,
                      name=str(jobNode),
                      resources=ResourceRequirement(**jobNode._requirements),
                      command=jobNode.command,
                      userScript=self.userScript,
                      environment=self.environment.copy(),
                      workerCleanupInfo=self.workerCleanupInfo)
        jobType = job.resources
        log.debug("Queueing the job command: %s with job id: %s ...",
                  jobNode.command, str(jobID))

        # TODO: round all elements of resources

        self.taskResources[jobID] = job.resources
        self.jobQueues.insertJob(job, jobType)
        log.debug("... queued")
        return jobID
Пример #2
0
    def issueBatchJob(self, command, memory, cpu, disk):
        """
        Issues the following command returning a unique jobID. Command is the string to run, memory is an int giving
        the number of bytes the batchjob needs to run in and cpu is the number of cpus needed for the batchjob and error-file
        is the path of the file to place any std-err/std-out in.
        """
        # puts batchjob into job_type_queue to be run by Mesos, AND puts jobID in current_job[]
        self.checkResourceRequest(memory, cpu, disk)
        jobID = self.nextJobID
        self.nextJobID += 1

        batchjob = ToilJob(jobID=jobID,
                           resources=ResourceRequirement(memory=memory,
                                                         cpu=cpu,
                                                         disk=disk),
                           command=command,
                           userScript=self.userScript,
                           toilDistribution=self.toilDistribution)
        job_type = batchjob.resources

        log.debug(
            "Queueing the batchjob command: %s with batchjob id: %s ..." %
            (command, str(jobID)))
        self.jobQueueList[job_type].append(batchjob)
        log.debug("... queued")

        return jobID
Пример #3
0
    def _getJob(self, cores=1, memory=1000, disk=5000, preemptable=True):
        from toil.batchSystems.mesos import ResourceRequirement
        from toil.batchSystems.mesos import ToilJob

        resources = ResourceRequirement(cores=cores, memory=memory, disk=disk, preemptable=preemptable)

        job = ToilJob(jobID=str(uuid.uuid4()),
                      name=str(uuid.uuid4()),
                      resources=resources,
                      command="do nothing",
                      userScript=None,
                      environment=None,
                      workerCleanupInfo=None)
        return job
Пример #4
0
 def issueBatchJob(self, jobNode):
     """
     Issues the following command returning a unique jobID. Command is the string to run, memory
     is an int giving the number of bytes the job needs to run in and cores is the number of cpus
     needed for the job and error-file is the path of the file to place any std-err/std-out in.
     """
     self.checkResourceRequest(jobNode.memory, jobNode.cores, jobNode.disk)
     jobID = next(self.unusedJobID)
     job = ToilJob(jobID=jobID,
                   resources=ResourceRequirement(**jobNode._requirements),
                   command=jobNode.command,
                   userScript=self.userScript,
                   environment=self.environment.copy(),
                   workerCleanupInfo=self.workerCleanupInfo)
     jobType = job.resources
     log.debug("Queueing the job command: %s with job id: %s ...",
               jobNode.command, str(jobID))
     self.jobQueues[jobType].append(job)
     log.debug("... queued")
     return jobID