Beispiel #1
0
def kill_run(run):
    tasks = BPJobTask.select_by_run(run)
    jobs = {}
    for task in tasks:
        if task.job.job_id not in jobs:
            jobs[task.job.job_id] = []
        jobs[task.job.job_id].append(task.batch_array_task.task_id)
    for job_id, task_ids in jobs.items():
        bputilities.kill_tasks(job_id, task_ids)
    with bpcursor() as cursor:
        for task in tasks:
            BPTaskStatus.create(cursor, task, JS_ABORTED)
Beispiel #2
0
def kill_run(run):
    tasks = BPJobTask.select_by_run(run)
    jobs = {}
    for task in tasks:
        if task.job.job_id not in jobs:
            jobs[task.job.job_id] = []
        jobs[task.job.job_id].append(task.batch_array_task.task_id)
    for job_id, task_ids in jobs.items():
        bputilities.kill_tasks(job_id, task_ids)
    with bpcursor() as cursor:
        for task in tasks:
            BPTaskStatus.create(cursor, task, JS_ABORTED)
Beispiel #3
0
from bpformdata import *
import cgi
import os
import subprocess
import sys

job_id = BATCHPROFILER_VARIABLES[JOB_ID]
task_id = BATCHPROFILER_VARIABLES[TASK_ID]
batch_id = BATCHPROFILER_VARIABLES[BATCH_ID]
if job_id is not None:
    job = RunBatch.BPJob.select_by_job_id(job_id)
    if job is None:
        if task_id is None:
            bputilities.kill_job(job_id)
        else:
            bputilities.kill_tasks(job_id, [task_id])
    elif task_id is None:
        RunBatch.kill_job(job)
    else:
        task = RunBatch.BPJobTask.select_by_task_id(job, task_id)
        RunBatch.kill_task(task)
    print """
    <html><head><title>Job %(job_id)d killed</title></head>
    <body>Job %(job_id)d killed
    </body>
    </html>
""" % (
        globals()
    )
elif batch_id is not None:
    RunBatch.kill_batch(batch_id)
from bpformdata import *
import cgi
import os
import subprocess
import sys

job_id = BATCHPROFILER_VARIABLES[JOB_ID]
task_id = BATCHPROFILER_VARIABLES[TASK_ID]
batch_id = BATCHPROFILER_VARIABLES[BATCH_ID]
if job_id is not None:
    job = RunBatch.BPJob.select_by_job_id(job_id)
    if job is None:
        if task_id is None:
            bputilities.kill_job(job_id)
        else:
            bputilities.kill_tasks(job_id, [task_id])
    elif task_id is None:
        RunBatch.kill_job(job)
    else:
        task = RunBatch.BPJobTask.select_by_task_id(job, task_id)
        RunBatch.kill_task(task)
    print"""
    <html><head><title>Job %(job_id)d killed</title></head>
    <body>Job %(job_id)d killed
    </body>
    </html>
"""%(globals())
elif batch_id is not None:
    RunBatch.kill_batch(batch_id)
    
    url = "ViewBatch.py?batch_id=%d"%(batch_id)