How to use the xenon.jobs.JobDescription function in xenon

To help you get started, we’ve selected a few xenon examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MD-Studio / cerise / cerise / back_end / xenon_job_runner.py View on Github external
def start_job(self, job_id):
        """Get a job from the job store and start it on the compute resource.

        Args:
            job_id (str): The id of the job to start.
        """
        self._logger.debug('Starting job ' + job_id)
        with self._job_store:
            job = self._job_store.get_job(job_id)
            # submit job
            xenon_jobdesc = xenon.jobs.JobDescription()
            xenon_jobdesc.setWorkingDirectory(job.remote_workdir_path)
            xenon_jobdesc.setExecutable(self._remote_cwlrunner)
            args = [
                    job.remote_workflow_path,
                    job.remote_input_path
                    ]
            xenon_jobdesc.setArguments(args)
            xenon_jobdesc.setStdout(job.remote_stdout_path)
            xenon_jobdesc.setStderr(job.remote_stderr_path)
            xenon_jobdesc.setMaxTime(60)
            xenon_jobdesc.setProcessesPerNode(4)
            xenon_jobdesc.setStartSingleProcess(True)
            print("Starting job: " + str(xenon_jobdesc))
            xenon_job = self._x.jobs().submitJob(self._sched, xenon_jobdesc)
            job.remote_job_id = xenon_job.getIdentifier()
            self._logger.debug('Job submitted')