示例#1
0
 def get_stderr(self, wf_id, job_id, job_instance_id):
     try:
         workflow = queries.WorkflowInfo(self.__get_wf_db_url(), wf_id)
         stderr = workflow.get_stderr(job_id, job_instance_id)
         return stderr
     finally:
         Dashboard.close(workflow)
示例#2
0
    def plots_time_chart(self, wf_id, time_filter='hour'):
        try:
            workflow = queries.WorkflowInfo(self.__get_wf_db_url(), wf_id)
            details = workflow.get_workflow_information()

            workflow_plots = stampede_statistics.StampedeStatistics(
                self.__get_wf_db_url()
            )
            workflow_plots.initialize(details.wf_uuid)

            workflow_plots.set_job_filter('nonsub')
            workflow_plots.set_time_filter(time_filter)
            workflow_plots.set_transformation_filter(
                exclude=['condor::dagman']
            )

            job, invocation = workflow_plots.get_jobs_run_by_time(
            ), workflow_plots.get_invocation_by_time()

            for j in job:
                j.date_format *= 3600

            for i in invocation:
                i.date_format *= 3600

            return job, invocation

        finally:
            Dashboard.close(workflow)
            Dashboard.close(workflow_plots)
示例#3
0
 def get_sub_workflows(self, wf_id):
     try:
         workflow = queries.WorkflowInfo(self.__get_wf_db_url(), wf_id=wf_id)
         sub_workflows = workflow.get_sub_workflows()
         return sub_workflows
     finally:
         Dashboard.close(workflow)
示例#4
0
 def get_failed_job_invocation(self, wf_id, job_id, job_instance_id):
     try:
         workflow = queries.WorkflowInfo(self.__get_wf_db_url(), wf_id)
         failed_invocations = workflow.get_failed_job_invocations(
             job_id, job_instance_id)
         return failed_invocations
     finally:
         Dashboard.close(workflow)
示例#5
0
 def get_invocation_information(self, wf_id, job_id, job_instance_id, invocation_id):
     try:
         workflow = queries.WorkflowInfo(self.__get_wf_db_url(), wf_id)
         invocation = workflow.get_invocation_information(
             job_id, job_instance_id, invocation_id
         )
         return invocation
     finally:
         Dashboard.close(workflow)
示例#6
0
 def get_failing_jobs(self, wf_id, **table_args):
     try:
         workflow = queries.WorkflowInfo(self.__get_wf_db_url(), wf_id=wf_id)
         total_count, filtered_count, failed_jobs = workflow.get_failing_jobs(
             **table_args
         )
         return total_count, filtered_count, failed_jobs
     finally:
         Dashboard.close(workflow)
示例#7
0
 def get_job_states(self, wf_id, job_id, job_instance_id):
     """
     Get information about the job states that a job has gone through.
     """
     try:
         workflow = queries.WorkflowInfo(self.__get_wf_db_url(), wf_id)
         job_states = workflow.get_job_states(job_id, job_instance_id)
         return job_states
     finally:
         Dashboard.close(workflow)
示例#8
0
 def get_invocation_information(self, wf_id, job_id, job_instance_id,
                                invocation_id):
     try:
         workflow = queries.WorkflowInfo(self.__get_wf_db_url(), wf_id)
         invocation = workflow.get_invocation_information(
             job_id, job_instance_id, invocation_id)
         invocation.start_time = strftime("%a, %d %b %Y %H:%M:%S",
                                          localtime(invocation.start_time))
         return invocation
     finally:
         Dashboard.close(workflow)
示例#9
0
 def get_job_instances(self, wf_id, job_id):
     """
     Get a list of all job instances for a given job
     """
     try:
         workflow = queries.WorkflowInfo(self.__get_wf_db_url(), wf_id)
         job_instances = workflow.get_job_instances(job_id)
         return job_instances
     except NoResultFound:
         return None
     finally:
         Dashboard.close(workflow)
示例#10
0
 def get_job_information(self, wf_id, job_id, job_instance_id):
     """
     Get job specific information. This is when user click on a job link, on the workflow details page.
     Returns a Job object.
     """
     try:
         workflow = queries.WorkflowInfo(self.__get_wf_db_url(), wf_id)
         job_details = workflow.get_job_information(job_id, job_instance_id)
         return job_details
     except NoResultFound:
         return None
     finally:
         Dashboard.close(workflow)
示例#11
0
    def get_workflow_details(self, wf_id=None, wf_uuid=None):
        """
        Get workflow specific information. This is when user click on a workflow link.
        Returns a workflow object.
        """
        try:
            if not wf_id and not wf_uuid:
                raise ValueError('Workflow ID or Workflow UUID is required')

            workflow = None
            workflow = queries.WorkflowInfo(
                self.__get_wf_db_url(), wf_id=wf_id, wf_uuid=wf_uuid
            )

            details = self._get_workflow_details(workflow)

            return details

        finally:
            Dashboard.close(workflow)
示例#12
0
    def plots_transformation_statistics(self, wf_id):
        try:
            workflow = queries.WorkflowInfo(self.__get_wf_db_url(), wf_id)
            details = workflow.get_workflow_information()

            workflow_plots = stampede_statistics.StampedeStatistics(
                self.__get_wf_db_url()
            )
            workflow_plots.initialize(details.wf_uuid)

            workflow_plots.set_job_filter("nonsub")
            workflow_plots.set_time_filter("hour")
            workflow_plots.set_transformation_filter(exclude=["condor::dagman"])

            dist = workflow_plots.get_transformation_statistics()

            return dist

        finally:
            Dashboard.close(workflow)
            Dashboard.close(workflow_plots)
示例#13
0
    def get_workflow_information(self, wf_id=None, wf_uuid=None):
        """
        Get workflow specific information. This is when user click on a workflow link.
        Returns a workflow object.
        """
        try:
            if not wf_id and not wf_uuid:
                raise ValueError('Workflow ID or Workflow UUID is required')

            workflow = None
            workflow_statistics = None
            workflow = queries.WorkflowInfo(
                self.__get_wf_db_url(), wf_id=wf_id, wf_uuid=wf_uuid
            )

            details = self._get_workflow_details(workflow)
            job_counts = self._get_workflow_job_counts(workflow)

            #workflow_statistics = stampede_statistics.StampedeStatistics(self.__get_wf_db_url(), expand_workflow=(details.root_wf_id ==  details.wf_id))
            workflow_statistics = stampede_statistics.StampedeStatistics(
                self.__get_wf_db_url(), expand_workflow=True
            )
            workflow_statistics.initialize(details.wf_uuid)

            statistics = {}

            statistics.update(
                self._get_workflow_summary_times(workflow_statistics)
            )

            #if details.root_wf_id ==  details.wf_id:
            statistics.update(
                self._get_workflow_summary_counts(workflow_statistics)
            )

            return job_counts, details, statistics

        finally:
            Dashboard.close(workflow)
            Dashboard.close(workflow_statistics)
示例#14
0
    def plots_time_chart(self, wf_id, time_filter="hour"):
        try:
            workflow = queries.WorkflowInfo(self.__get_wf_db_url(), wf_id)
            details = workflow.get_workflow_information()

            workflow_plots = stampede_statistics.StampedeStatistics(
                self.__get_wf_db_url()
            )
            workflow_plots.initialize(details.wf_uuid)

            workflow_plots.set_job_filter("nonsub")
            workflow_plots.set_time_filter(time_filter)
            workflow_plots.set_transformation_filter(exclude=["condor::dagman"])

            job, invocation = (
                workflow_plots.get_jobs_run_by_time(),
                workflow_plots.get_invocation_by_time(),
            )

            return job, invocation

        finally:
            Dashboard.close(workflow)
            Dashboard.close(workflow_plots)