| 5 | | The APIs support the submission of large '''batches''' of jobs, |
| 6 | | such as parameter sweeps. |
| 7 | | The API can be used, for example, to create web interfaces for job submission, |
| 8 | | such as might be found in a science portal web site: |
| 9 | | |
| 10 | | [[Image(submit.png)]] |
| 11 | | |
| | 5 | The API supports the submission of '''batches''' of jobs. |
| | 6 | A batch could contain a single job, or many thousands of jobs. |
| 21 | | This system is coupled with new |
| 22 | | [MultiUser multi-user project features]. |
| 23 | | In particuler, users can submit jobs only if they have been given access |
| 24 | | (via a web interface) by project administrators, |
| 25 | | and admins can restrict the apps for which |
| 26 | | each user is allowed to submit jobs. |
| | 16 | The API can be used, for example, to create web interfaces for job submission, |
| | 17 | such as might be found in a science portal web site: |
| | 18 | |
| | 19 | [[Image(submit.png)]] |
| | 20 | |
| | 21 | This system is coupled with BOINC's [MultiUser multi-user project features]. |
| | 22 | This includes access control: |
| | 23 | users can submit jobs only if they have been given access by project administrators, |
| | 24 | and admins can restrict the apps for which each user is allowed to submit jobs. |
| 42 | | * '''jobs''': an array of job descriptors (see example) |
| | 40 | * '''batch_name''': a symbolic name for the batch. Need not be unique. |
| | 41 | * '''jobs''': an array of job descriptors, each of which contains |
| | 42 | * '''rsc_fpops_est''': an estimate of the FLOPs used by the job |
| | 43 | * '''command_line''': command-line arguments to the application |
| | 44 | * '''input_files''': an array of input file descriptors, each of which contains |
| | 45 | * '''source''': a URL from which the BOINC server can download the file, |
| | 46 | or the path of the file on the BOINC server |
| | 47 | * '''name''': the [BoincFiles physical name] of the file |
| 89 | | The first element is an array of objects describing batches, |
| 90 | | with the following fields: |
| 91 | | * '''batch_id''': batch ID |
| 92 | | * '''fraction_done''': a number 0..1 giving the fraction of the batch that has been completed |
| | 97 | The first element is an array of batch descriptor objects, |
| | 98 | each with the following fields: |
| | 99 | * '''id''': batch ID |
| | 100 | * '''state''': values are |
| | 101 | * 1: in progress |
| | 102 | * 2: completed (all jobs either succeeded or had fatal errors) |
| | 103 | * 3: aborted |
| | 104 | * 4: retired |
| | 105 | * '''name''': the batch name |
| | 106 | * '''app_name''': the application name |
| 106 | | The first element is an array of objects describing jobs |
| 107 | | within the batch, with the following fields: |
| 108 | | |
| 109 | | * '''job_id''': the job ID |
| 110 | | * '''canonical_instance_id''': |
| 111 | | if the job has been completed and validated, the ID of a valid instance |
| 112 | | * '''n_outfiles''': the number of output files |
| | 127 | The first element is a batch descriptor object as described above, |
| | 128 | with one additional field: |
| | 129 | * '''jobs''': an array of job descriptor objects, each one containing |
| | 130 | * '''id''': the database ID of the job's workunit record |
| | 131 | * '''canonical_instance_id''': if the job has a canonical result, its database ID |
| 123 | | The first element is an object with the following fields: |
| 124 | | * '''instances''': an array of job instance descriptors |
| 125 | | |
| 126 | | Each job instance descriptor is an object with the following fields: |
| 127 | | * '''name''': the instance's name |
| 128 | | * '''id''': the ID of the corresponding result record |
| 129 | | * '''outfile''': a list of output file descriptors, each containing |
| 130 | | * '''size''': file size in bytes |
| | 142 | The first element is a job descriptor object with the following fields: |
| | 143 | * '''instances''': an array of job instance descriptors, each containing: |
| | 144 | * '''name''': the instance's name |
| | 145 | * '''id''': the ID of the corresponding result record |
| | 146 | * '''state''': a string describing the instance's state |
| | 147 | (unsent, in progress, complete, etc.) |
| | 148 | * '''outfile''': if the instance is over, |
| | 149 | a list of output file descriptors, each containing |
| | 150 | * '''size''': file size in bytes |
| 176 | | |
| 177 | | The inputs and outputs of each function are XML documents. |
| 178 | | If an operation fails, the output is of the form |
| 179 | | {{{ |
| 180 | | <error> |
| 181 | | <message>X</message> |
| 182 | | </error> |
| 183 | | }}} |
| 184 | | where X is an error message. |
| 185 | | |
| 186 | | All operations include the authenticator of the user making the request. |
| 187 | | This user must be marked as a "job submitter" in the BOINC database. |
| 188 | | |
| 189 | | === Describing a batch === |
| 190 | | |
| 191 | | A job is described by |
| 192 | | {{{ |
| 193 | | <job> |
| 194 | | <rsc_fpops_est>X</rsc_fpops_est> |
| 195 | | [<command_line>C</command_line>] |
| 196 | | [<input_file> |
| 197 | | <source>URL or path</source> |
| 198 | | <name>physical_name</name> |
| 199 | | </input_file>] |
| 200 | | ... other input files |
| 201 | | </job> |
| 202 | | }}} |
| 203 | | |
| 204 | | Each input file is specified either by a URL accessible to the server, |
| 205 | | or by a path on the server. |
| 206 | | |
| 207 | | A batch of jobs is described by: |
| 208 | | {{{ |
| 209 | | <batch> |
| 210 | | <app_name>appname</app_name> |
| 211 | | <job> |
| 212 | | ... |
| 213 | | </job> |
| 214 | | ... more jobs |
| 215 | | </batch> |
| 216 | | }}} |
| 217 | | |
| 218 | | === Batch runtime estimation === |
| 219 | | |
| 220 | | This function estimates the completion time of a batch. |
| 221 | | Input: |
| 222 | | {{{ |
| 223 | | <batch_estimate> |
| 224 | | <authenticator>X</authenticator> |
| 225 | | <batch> ... </batch> |
| 226 | | </batch_estimate> |
| 227 | | }}} |
| 228 | | |
| 229 | | Output: |
| 230 | | {{{ |
| 231 | | <estimate> |
| 232 | | <seconds>X</seconds> |
| 233 | | </estimate> |
| 234 | | }}} |
| 235 | | |
| 236 | | === Submitting a batch === |
| 237 | | |
| 238 | | Input: |
| 239 | | {{{ |
| 240 | | <batch_submit> |
| 241 | | <authenticator>X</authenticator> |
| 242 | | <batch> ... </batch> |
| 243 | | </batch_submit> |
| 244 | | }}} |
| 245 | | |
| 246 | | Output: |
| 247 | | {{{ |
| 248 | | <batch_id>N</batch_id> |
| 249 | | }}} |
| 250 | | |
| 251 | | === Querying batches === |
| 252 | | |
| 253 | | Input: |
| 254 | | {{{ |
| 255 | | <query_batches> |
| 256 | | <authenticator>X</authenticator> |
| 257 | | </query_batches> |
| 258 | | }}} |
| 259 | | |
| 260 | | Output: |
| 261 | | {{{ |
| 262 | | <batches> |
| 263 | | <batch> |
| 264 | | <id>N</id> |
| 265 | | <completed>0|1</completed> |
| 266 | | [<fraction_done>X</fraction_done>] |
| 267 | | {<completed_time>X</completed_time>] |
| 268 | | </batch> |
| 269 | | ... |
| 270 | | </batches> |
| 271 | | }}} |
| 272 | | |
| 273 | | === Querying a batch === |
| 274 | | |
| 275 | | Input: |
| 276 | | {{{ |
| 277 | | <query_batch> |
| 278 | | <authenticator>X</authenticator> |
| 279 | | <batch_id>N</batch_id> |
| 280 | | </query_batch> |
| 281 | | }}} |
| 282 | | |
| 283 | | Output: |
| 284 | | {{{ |
| 285 | | <batch> |
| 286 | | <job> |
| 287 | | <id>N</id> |
| 288 | | <canonical_resultid>N</canonical_resultid> |
| 289 | | [<outfile>name</outfile>] |
| 290 | | ... |
| 291 | | </job> |
| 292 | | </batch> |
| 293 | | }}} |
| 294 | | |
| 295 | | === Aborting a batch === |
| 296 | | |
| 297 | | Input: |
| 298 | | |
| 299 | | {{{ |
| 300 | | <abort_batch> |
| 301 | | <authenticator>X</authenticator> |
| 302 | | <batch_id>N</batch_id> |
| 303 | | </query_batch> |
| 304 | | }}} |
| 305 | | |
| 306 | | == Implementation notes == |
| 307 | | |
| 308 | | New tables |
| 309 | | |
| 310 | | {{{ |
| 311 | | batch |
| 312 | | id |
| 313 | | create_time |
| 314 | | logical_start_time |
| 315 | | logical_end_time |
| 316 | | estimated_completion_time |
| 317 | | njobs |
| 318 | | |
| 319 | | user_submit |
| 320 | | user_id |
| 321 | | quota |
| 322 | | logical_start_time |
| 323 | | bool all_apps |
| 324 | | |
| 325 | | user_app |
| 326 | | user_id |
| 327 | | app_id |
| 328 | | }}} |
| 329 | | |