示例#1
0
    def run(self, **jobargs):
        """
        Creates the :class:`JobPack` for the worker using
        :meth:`disco.worker.Worker.jobdict`,
        :meth:`disco.worker.Worker.jobenvs`,
        :meth:`disco.worker.Worker.jobhome`,
        :meth:`disco.task.jobdata`, and attempts to submit it.  This
        method executes on the client submitting a job to be run.
        More information on how job inputs are specified is available
        in :meth:`disco.worker.Worker.jobdict`.  The default worker
        implementation is called ``classic``, and is implemented by
        :class:`disco.worker.classic.worker`.

        :type  jobargs: dict
        :param jobargs: runtime parameters for the job.               \
                        Passed to the :class:`disco.worker.Worker`    \
                        methods listed above, along with the job      \
                        itself.  The interpretation of the jobargs is \
                        performed by the worker interface             \
                        in :class:`disco.worker.Worker` and the class \
                        implementing that interface (which defaults   \
                        to :class:`disco.worker.classic.worker`).

        :raises: :class:`disco.error.JobError` if the submission fails.
        :return: the :class:`Job`, with a unique name assigned by the master.
        """
        jobpack = JobPack(self.worker.jobpack_version,
                          self.worker.jobdict(self, **jobargs),
                          self.worker.jobenvs(self, **jobargs),
                          self.worker.jobhome(self, **jobargs),
                          task.jobdata(self, jobargs))
        self.name = self.disco.submit(jobpack.dumps())
        return self
示例#2
0
文件: job.py 项目: Cheng--Li/disco
    def run(self, **jobargs):
        """
        Creates the :class:`JobPack` for the worker using
        :meth:`disco.worker.Worker.jobdict`,
        :meth:`disco.worker.Worker.jobenvs`,
        :meth:`disco.worker.Worker.jobhome`,
        :meth:`disco.task.jobdata`, and attempts to submit it.  This
        method executes on the client submitting a job to be run.
        More information on how job inputs are specified is available
        in :meth:`disco.worker.Worker.jobdict`.  The default worker
        implementation is called ``classic``, and is implemented by
        :class:`disco.worker.classic.worker`.

        :type  jobargs: dict
        :param jobargs: runtime parameters for the job.               \
                        Passed to the :class:`disco.worker.Worker`    \
                        methods listed above, along with the job      \
                        itself.  The interpretation of the jobargs is \
                        performed by the worker interface             \
                        in :class:`disco.worker.Worker` and the class \
                        implementing that interface (which defaults   \
                        to :class:`disco.worker.classic.worker`).

        :raises: :class:`disco.error.JobError` if the submission fails.
        :return: the :class:`Job`, with a unique name assigned by the master.
        """
        jobpack = JobPack(self.worker.jobpack_version,
                          self.worker.jobdict(self, **jobargs),
                          self.worker.jobenvs(self, **jobargs),
                          self.worker.jobhome(self, **jobargs),
                          task.jobdata(self, jobargs))
        self.name = self.disco.submit(jobpack.dumps())
        return self
示例#3
0
文件: job.py 项目: Dieterbe/disco
    def run(self, **jobargs):
        """
        Creates the :class:`JobPack` for the worker using
        :meth:`disco.worker.Worker.jobdict`,
        :meth:`disco.worker.Worker.jobenvs`,
        :meth:`disco.worker.Worker.jobhome`,
        :meth:`disco.task.jobdata`,
        and attempts to submit it.

        :type  jobargs: dict
        :param jobargs: runtime parameters for the job.
                        Passed to the :class:`disco.worker.Worker`
                        methods listed above, along with the job itself.

        :raises: :class:`disco.error.JobError` if the submission fails.
        :return: the :class:`Job`, with a unique name assigned by the master.
        """
        jobpack = JobPack(self.worker.jobdict(self, **jobargs),
                          self.worker.jobenvs(self, **jobargs),
                          self.worker.jobhome(self, **jobargs),
                          task.jobdata(self, jobargs))
        self.name = self.disco.submit(jobpack.dumps())
        return self
示例#4
0
文件: job.py 项目: pranjal5215/disco
    def run(self, **jobargs):
        """
        Creates the :class:`JobPack` for the worker using
        :meth:`disco.worker.Worker.jobdict`,
        :meth:`disco.worker.Worker.jobenvs`,
        :meth:`disco.worker.Worker.jobhome`,
        :meth:`disco.task.jobdata`,
        and attempts to submit it.

        :type  jobargs: dict
        :param jobargs: runtime parameters for the job.
                        Passed to the :class:`disco.worker.Worker`
                        methods listed above, along with the job itself.

        :raises: :class:`disco.error.JobError` if the submission fails.
        :return: the :class:`Job`, with a unique name assigned by the master.
        """
        jobpack = JobPack(self.worker.jobdict(self, **jobargs),
                          self.worker.jobenvs(self, **jobargs),
                          self.worker.jobhome(self, **jobargs),
                          task.jobdata(self, jobargs))
        self.name = self.disco.submit(jobpack.dumps())
        return self