Changes between Initial Version and Version 1 of WebSubmit


Ignore:
Timestamp:
Apr 12, 2014, 2:02:07 PM (11 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WebSubmit

    v1 v1  
     1= Web-based job submission =
     2
     3This involves developing web pages, run on your BOINC server,
     4for submitting jobs.
     5These pages are application-specific,
     6since the way that users specify parameters and input files depends on the application.
     7
     8These scripts are best implemented in PHP.
     9BOINC provides a large set of PHP APIs for accessing the BOINC database,
     10staging files, and so on.
     11
     12These scripts will typically use BOINC PHP code for various purposes:
     13
     14 * '''inc/util.inc''': utility functions
     15 * '''inc/boinc_db.inc''': access to BOINC database
     16 * '''inc/submit_db.inc''': access to job-submissions parts of BOINC database
     17 * '''inc/submit_util.inc''': job submission utility functions
     18
     19== Authorizing requests ==
     20
     21Job-submissions scripts must check that the user is allowed to submit jobs.
     22You can do this as follows:
     23{{{
     24$user = get_logged_in_user();
     25$user_submit = BoincUserSubmit::lookup_userid($user->id);
     26if (!$user_submit) error_page("no submit access");
     27$app = BoincApp::lookup("name='lammps'");
     28if (!$app) error_page("no lammps app");
     29if (!$user_submit->submit_all) {
     30    $usa = BoincUserSubmitApp::lookup("user_id=$user->id and app_id=$app->id");
     31    if (!$usa) {
     32        error_page("no submit access");
     33    }
     34}
     35}}}
     36
     37== Creating batches and jobs ==
     38
     39You can create a batch as follows:
     40{{{
     41$batch_id = BoincBatch::insert(
     42    "(user_id, create_time, njobs, name, app_id, state)
     43    values ($user->id, $now, $njobs, '$batch_name', $app->id, ".BATCH_STATE_IN_PROGRESS.")"
     44);
     45}}}
     46
     47Create jobs using the [JobSubmission#creatework-tool create_work script].