示例#1
0
            log(ex)
        return list()

    def run(self):
        run_pipeline(self.pipeline, self.pipelinetype, self.job, self.owner)

    def complete(self):
        status = jobs.get_job_status(str(self.job), util.conn_string)
        return status['status'] == jobs.COMPLETED or status[
            'status'] == jobs.WARNING or status['status'] == jobs.FAILURE


if __name__ == "__main__":
    owner = "tester"
    p_id = "11469"
    the_job_id = data_access.create_new_job(
        data_access.NlpJob(job_id=-1,
                           name="Test Phenotype",
                           description="Test Phenotype",
                           owner=owner,
                           status=data_access.STARTED,
                           date_ended=None,
                           phenotype_id=int(p_id),
                           pipeline_id=-1,
                           date_started=datetime.datetime.now(),
                           job_type='PHENOTYPE'), util.conn_string)
    luigi.run([
        'PhenotypeTask', '--phenotype', p_id, '--job',
        str(the_job_id), '--owner', 'tester'
    ])
            task = registered_pipelines[str(self.pipelinetype)]
            matches = [task(pipeline=self.pipeline, job=self.job, start=n, solr_query=self.solr_query, batch=n)
                       for n in ranges]

            return matches
        except Exception as ex:
            traceback.print_exc(file=sys.stderr)
            jobs.update_job_status(str(self.job), util.conn_string, jobs.WARNING, ''.join(traceback.format_stack()))
            print(ex)
        return list()

    def run(self):
        run_pipeline(self.pipeline, self.pipelinetype, self.job, self.owner)

    def complete(self):
        status = jobs.get_job_status(str(self.job), util.conn_string)
        return status['status'] == jobs.COMPLETED or status['status'] == jobs.WARNING or status[
            'status'] == jobs.FAILURE


if __name__ == "__main__":
    owner = "tester"
    p_id = "1000"
    the_job_id = data_access.create_new_job(
        data_access.NlpJob(job_id=-1, name="Test Phenotype", description="Test Phenotype",
                           owner=owner, status=data_access.STARTED, date_ended=None,
                           phenotype_id=int(p_id), pipeline_id=-1, date_started=datetime.datetime.now(),
                           job_type='PHENOTYPE'), util.conn_string)
    luigi.run(['PhenotypeTask', '--phenotype', p_id, '--job', str(the_job_id), '--owner', 'tester'])