Changes between Version 57 and Version 58 of RemoteJobs
- Timestamp:
- Mar 2, 2017, 11:59:59 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
RemoteJobs
v57 v58 2 2 3 3 = RPCs for remote job submission = 4 This document describes APIs for remotely submitting, monitoring, and controlling jobs on a BOINC server. The APIs supports the submission of '''batches''' of jobs, which may contain a single job or many thousands of jobs. Currently, the API has two restrictions: 4 This document describes APIs for remotely submitting, monitoring, and controlling jobs on a BOINC server. 5 The APIs supports the submission of '''batches''' of jobs, which may contain a single job or many thousands of jobs. 6 Currently, the API has two restrictions: 5 7 6 8 * All jobs in a batch must use the same application. 7 9 * There can be no dependencies between jobs. 8 10 9 At the bottom level, the interface consists of Web RPCs. BOINC provides client-side bindings in PHP, C++, and Python. These bindings differ slightly; they expose different details of the Web RPCs. 10 11 Interfaces for [wiki:RemoteInputFiles staging input files] and [wiki:RemoteOutputFiles fetching output files] are described separately. 12 13 There are various options for managing input files. If you use [wiki:RemoteInputFiles#Job-basedfilemanagement Job-based file management], which maintains batch/file associations, the order of operations is: 11 At the bottom level, the interface consists of Web RPCs. BOINC provides client-side bindings in PHP, C++, and Python. 12 These bindings differ slightly; they expose different details of the Web RPCs. 13 14 Interfaces for [wiki:RemoteInputFiles staging input files] and [wiki:RemoteOutputFiles fetching output files] 15 are described separately. 16 17 There are various options for managing input files. 18 If you use [wiki:RemoteInputFiles#Job-basedfilemanagement Job-based file management], 19 which maintains batch/file associations, the order of operations is: 14 20 15 21 * Create a batch (initially empty); returns the batch ID. … … 24 30 * '''Abort''' the batch (if you see errors, or if enough jobs have been finished) using abort_jobs() or abort_batch(). 25 31 * [wiki:RemoteOutputFiles download output files]. 26 * '''Retire''' the batch using retire_batch(). This tells the server to clean up the files and job records associated with the batch, and to mark the batch as "retired"; retired batches are normally not shown in the web interface. 32 * '''Retire''' the batch using retire_batch(). 33 This tells the server to clean up the files and job records associated with the batch, 34 and to mark the batch as "retired"; retired batches are normally not shown in the web interface. 27 35 28 36 == PHP interface == 29 The following functions are provided in the PHP file [/trac/browser/trunk/boinc/html/inc/submit.inc submit.inc], which is independent of other BOINC PHP code. The file html/user/submit_test.php has code to exercise and test these functions. 37 The following functions are provided in the PHP file [/trac/browser/trunk/boinc/html/inc/submit.inc submit.inc], 38 which is independent of other BOINC PHP code. 39 The file html/user/submit_test.php has code to exercise and test these functions. 30 40 31 41 === boinc_submit_batch() === … … 37 47 * '''authenticator''': the user's authenticator 38 48 * '''app_name''': the name of the application for which jobs are being submitted 39 * '''batch_name''': a symbolic name for the batch. Must be unique. If omitted, a name of the form "batch_unixtime" will be used. 49 * '''batch_name''': a symbolic name for the batch. 50 Must be unique. 51 If omitted, a name of the form "batch_unixtime" will be used. 40 52 * '''workunit_template_file''': an optional [wiki:JobTemplates input template file name]. 41 53 * '''result_template_file''': an optional [wiki:JobTemplates output template file name]. … … 43 55 * '''rsc_fpops_est''': an estimate of the FLOPs used by the job 44 56 * '''command_line''': command-line arguments to the application 45 * '''wu_template''': optional; the [http://boinc.berkeley.edu/trac/wiki/JobTemplates#Inputtemplates input template] to use for this job, as an XML string. 46 * '''result_template''': optional; the [http://boinc.berkeley.edu/trac/wiki/JobTemplates#Outputtemplates output template] to use for this job, as an XML string. 57 * '''wu_template''': optional; the [http://boinc.berkeley.edu/trac/wiki/JobTemplates#Inputtemplates input template] 58 to use for this job, as an XML string. 59 * '''result_template''': optional; the [http://boinc.berkeley.edu/trac/wiki/JobTemplates#Outputtemplates output template] 60 to use for this job, as an XML string. 47 61 * '''input_files''': an array of input file descriptors, each of which contains 48 62 * '''mode''': "local", "semilocal", "local_staged", "inline", or "remote" (see below). … … 64 78 Input files can be supplied in any of the following ways: 65 79 66 * '''local''': the file is on the BOINC server and is not [wiki:JobStage staged]. It's specified by its full path. 67 * '''local_staged''': the filed has been [wiki:JobStage staged] on the BOINC server. It's specified by its physical name. 68 * '''semilocal''': the file is on a data server that's accessible to the BOINC server but not necessarily to the outside world. The file is specified by its URL. It will be downloaded by the BOINC server during job submission, and served to clients from the BOINC server. 69 * '''inline''': the file is included in the job submission request XML message. It will be served to clients from BOINC server. 70 * '''remote''': the file is on a data server other than the BOINC server, and will be served to clients from that data server. It's specified by the URL, the file size, and the file MD5. 80 * '''local''': the file is on the BOINC server and is not [wiki:JobStage staged]. 81 It's specified by its full path. 82 * '''local_staged''': the filed has been [wiki:JobStage staged] on the BOINC server. 83 It's specified by its physical name. 84 * '''semilocal''': the file is on a data server that's accessible to the BOINC server but not necessarily to the outside world. 85 The file is specified by its URL. 86 It will be downloaded by the BOINC server during job submission, 87 and served to clients from the BOINC server. 88 * '''inline''': the file is included in the job submission request XML message. 89 It will be served to clients from BOINC server. 90 * '''remote''': the file is on a data server other than the BOINC server, 91 and will be served to clients from that data server. 92 It's specified by the URL, the file size, and the file MD5. 71 93 72 94 The following mode has been proposed but is not implemented yet: 73 95 74 * '''sandbox''': the file is in the user's [wiki:RemoteInputFiles#Per-userfilesandbox sandbox], and is specified by its name in the sandbox. 96 * '''sandbox''': the file is in the user's [wiki:RemoteInputFiles#Per-userfilesandbox sandbox], 97 and is specified by its name in the sandbox. 75 98 76 99 The following example submits a 10-job batch: … … 139 162 * '''nerror_jobs''': the number of jobs that had fatal errors 140 163 * '''completion_time''': when the batch was completed 141 * '''credit_estimate''': BOINC's initial estimate of the credit that would be granted to complete the batch, including replication 164 * '''credit_estimate''': BOINC's initial estimate of the credit that would be granted to complete the batch, 165 including replication 142 166 * '''credit_canonical''': the actual credit granted to canonical instances 143 167 * '''credit_total''': the actual credit granted to all instances … … 150 174 * '''project''' and '''authenticator''': as above 151 175 * '''batch_id''': specifies a batch. 152 * '''get_cpu_time''' (optional): if nonzero, get CPU time of batch. This includes all job instances, and doesn't include GPU time, so it may not be meaningful. 176 * '''get_cpu_time''' (optional): if nonzero, get CPU time of batch. 177 This includes all job instances, and doesn't include GPU time, so it may not be meaningful. 153 178 * '''get_job_details''' (optional): if nonzero, return job details (see below). 154 179 155 Result: a 2-element array. The first element is a batch descriptor object as described above, with one additional field: 180 Result: a 2-element array. 181 The first element is a batch descriptor object as described above, with an additional element: 156 182 157 183 * '''jobs''': an array of job descriptor objects, each one containing 158 184 * '''id''': the database ID of the job's workunit record 159 * '''canonical_instance_id''': if the job has a canonical result, its database ID185 * '''canonical_instance_id''': if the job has a canonical instance, its database ID 160 186 161 187 If '''get_job_details''' was set, the job descriptors also contain: 162 188 163 * '''status''': " unsent", "in_progress", "error", or "done".164 * '''cpu_time''': if done, the CPU time 189 * '''status''': "queued", "in_progress", "error", or "done". 190 * '''cpu_time''': if done, the CPU time of canonical instance. 165 191 * '''exit_status''': if error, the exit status of one of the error instances. 166 192 … … 175 201 * '''job_id''': specifies a job. 176 202 177 Result: a 2-element array. The first element is a job descriptor object with the following fields: 203 Result: a 2-element array. 204 The first element is a job descriptor object with the following fields: 178 205 179 206 * '''instances''': an array of job instance descriptors, each containing: … … 417 444 }}} 418 445 === query_batch_set() === 419 Return the status of the jobs in a given set of batches. This is used by the Condor interface; it's probably not useful outside of that. 446 Return the status of the jobs in a given set of batches. 447 This is used by the Condor interface; it's probably not useful outside of that. 420 448 421 449 {{{ … … 440 468 }}} 441 469 == Python binding == 442 The file tools/submit_api.py contains a Python binding of some of above RPCs. For examples of its use, see tools/submit_api_test.py. 470 The file tools/submit_api.py contains a Python binding of some of above RPCs. 471 For examples of its use, see tools/submit_api_test.py. 443 472 444 473 To build a description of a batch of jobs, use the BATCH_DESC, JOB_DESC, and FILE_DESC classes: … … 531 560 * jobs (list of JOB_DESC) 532 561 533 Available functions are listed below. Each function takes a request object whose attributes include at least project and authenticator. 562 Available functions are listed below. 563 Each function takes a request object whose attributes include at least project and authenticator. 534 564 535 565 abort_batch(req):: req attributes: batch_id … … 546 576 547 577 == HTTP/XML interface == 548 At a lower level, the APIs are accessed by sending a POST request, using HTTP or HTTPS, to PROJECT_URL/submit_rpc_handler.php. The inputs and outputs of each function are XML documents. The format of the request and reply XML documents can be inferred from user/submit_rpc_handler.php. 578 At a lower level, the APIs are accessed by sending a POST request, using HTTP or HTTPS, 579 to PROJECT_URL/submit_rpc_handler.php. 580 The inputs and outputs of each function are XML documents. 581 The format of the request and reply XML documents can be inferred from user/submit_rpc_handler.php. 549 582 550 583 == Example web interface == 551 An example of a web interface for job submission and control, based on this API, can be found here: http://boinc.berkeley.edu/trac/browser/trunk/boinc/html/user/submit_example.php 552 553 This example is functional and it shows how to use the API. However, you will have to modify it heavily for your particular applications and web site. 584 An example of a web interface for job submission and control, 585 based on this API, can be found here: 586 http://boinc.berkeley.edu/trac/browser/trunk/boinc/html/user/submit_example.php 587 588 This example is functional and it shows how to use the API. 589 However, you will have to modify it for your particular applications and web site.