def add_solution(): if app.node.is_master_node(): return bad_request() solution_file = request.files['solution'] job_id = int(request.form.get('job_id')) store_solution(app.node.conf.job_home, solution_file, job_id) return start_job_rpc_server(job_id)
def add_job(): job_name = request.form.get('job_name') solution_file = request.files['solution_file'] input_file = request.files['input_file'] job = Job(job_name) store_solution(app.node.conf.job_home, solution_file, job.id) store_input(app.node.conf.job_home, input_file, job.id) app.node.add_job(job) log.info('Job %d was scheduled. Scheduled queue size - %d.' % (job.id, app.scheduled_jobs.qsize() + 1)) app.scheduled_jobs.put(job) return render_template('add_job.html', title='Add Job')