Esempio n. 1
0
    def test_kill_sleep_job(self):
        job = lsf.submit('sleep 100')

        job.kill()

        job_dict = _get_job_dict(job)
        self.assertIn('EXIT', job_dict['statuses'])
Esempio n. 2
0
    def test_kill_sleep_job(self):
        job = lsf.submit('sleep 100')

        job.kill()

        job_dict = _get_job_dict(job)
        self.assertIn('EXIT', job_dict['statuses'])
Esempio n. 3
0
 def setUpClass(cls):
     cls.job = lsf.submit(
         'ls',
         options={
             'numProcessors': 1,
             'maxNumProcessors': 1
         },
         rlimits={'threads': 1},
     )
Esempio n. 4
0
 def setUpClass(cls):
     cls.job = lsf.submit(
         'ls',
         options={
             'numProcessors': 1,
             'maxNumProcessors': 1,
             'jobGroup': '/test/job/group'
         },
         rlimits={'threads': 1},
     )
Esempio n. 5
0
    def test_kill_sleep_job(self):
        job = lsf.submit('ls && sleep 1000')

        print(job.as_dict)

        time.sleep(100)

        job.kill()

        print(job.as_dict)

        job_dict = _get_job_dict(job)
        self.assertIn('EXIT', job_dict['statuses'])
Esempio n. 6
0
    def _submit_job_to_lsf(self, child_pipe, parent_pipe, job):
        try:
            parent_pipe.close()

            job.set_user_and_groups()

            job.set_environment()

            job.set_cwd()
            job.set_umask()

            LOG.info("Submitting job (%s) to lsf", job.id,
                    extra={'jobId': job.id})
            lsf_job = lsf.submit(str(job.command), options=job.submit_options,
                          rlimits=job.rlimits)
            LOG.info("Job (%s) has lsf id [%s]", job.id, lsf_job.job_id,
                    extra={'jobId': job.id, 'lsfJobId': lsf_job.job_id})
            child_pipe.send(lsf_job.job_id)
        except Exception as e:
            LOG.exception("Error submitting job (%s) to lsf", job.id)
            child_pipe.send(str(e))

        child_pipe.close()
Esempio n. 7
0
 def setUpClass(cls):
     cls.job = lsf.submit('ls',
             options={'numProcessors': 1, 'maxNumProcessors': 1,
                 'jobGroup': '/test/job/group'},
             rlimits={'threads': 1},
             )
Esempio n. 8
0
 def setUpClass(cls):
     cls.job = lsf.submit('ls',
             options={'numProcessors': 1, 'maxNumProcessors': 1},
             rlimits={'threads': 1},
             )
Esempio n. 9
0
 def test_submit_to_illegal_queue(self):
     with self.assertRaises(lsf.exceptions.LSFBindingException):
         lsf.submit('ls', options={'queue': 'nonexistantqueuefortesting'})
Esempio n. 10
0
 def test_submit_to_default_queue(self):
     job = lsf.submit('ls')
     self.assertGreater(job.job_id, 0)
Esempio n. 11
0
 def run(self, command, options):
     job = lsf.submit(str(command), options=options)
     return job.job_id