| | 2 | |
| | 3 | For a file to be used as an input file of a BOINC job, |
| | 4 | it must be available to BOINC clients via HTTP. |
| | 5 | The standard way to do this is put the file |
| | 6 | in the project's "download directory" on the project server. |
| | 7 | |
| | 8 | For projects that use [RemoteJobs remote job submission], |
| | 9 | job submitters don't have login access to the server, |
| | 10 | so they can't store files there directly. |
| | 11 | Instead, BOINC provides two mechanisms that allow |
| | 12 | job submitters to place files on the BOINC server. |
| | 13 | |
| | 14 | Each of these mechanisms deals with two issues: |
| | 15 | |
| | 16 | * '''File immutability''': BOINC requires that a file |
| | 17 | of a given name can never be changed. |
| | 18 | Job submitters can't be expected to obey this rule: |
| | 19 | they must be able to submit one job with an input file |
| | 20 | of a given name, and a second job with an input file of |
| | 21 | the same name but different contents. |
| | 22 | * File cleanup: There must be some way to clean up |
| | 23 | files on the server when they are no longer needed. |
| | 27 | This system is used by the [CondorBoinc Condor/BOINC interface]. |
| | 28 | If may be useful for other systems as well. |
| | 29 | In this system, the name of a file on the BOINC server |
| | 30 | is based on its MD5 hash; thus file immutability is automatic. |
| | 31 | |
| | 32 | File cleanup is based on file/batch associations. |
| | 33 | Each file can be associated with one or more batches. |
| | 34 | Files that are no longer associated with an active batch are |
| | 35 | automatically deleted from the server. |
| | 36 | |
| | 37 | The system uses two Web RPCs. |
| | 38 | These are implemented as XML sent via HTTP POST; |
| | 39 | the RPC handler is html/user/job_files.php. |
| | 40 | |
| | 41 | The following C++ interfaces are provided |
| | 42 | (in samples/condor/job_rpc.cpp). |
| | 43 | This is to be called on the job submission host; |
| | 44 | the files must exist on that host, |
| | 45 | and their MD5s must have already been computed. |
| | 57 | Inputs: |
| | 58 | * '''project_url''': the project's master URL |
| | 59 | * '''authenticator''': the job submitter's authenticator |
| | 60 | * '''paths''': a list of file paths on the calling host. |
| | 61 | * '''md5s''': a list of the MD5s of the files. |
| | 62 | * '''batch_id''': the ID of a batch whose jobs will reference the files |
| | 63 | (these jobs need not exist yet). |
| | 64 | |
| | 65 | Action: for each file, see if it exists on the server. |
| | 66 | If it does, create an association to the given batch. |
| | 67 | |
| | 68 | Output: |
| | 69 | * return value: nonzero on error |
| | 70 | * '''absent_files''': a list of files not present on the server |
| | 71 | (represented as indices into the file vector). |
| | 72 | |
| | 73 | {{{ |
| | 83 | Inputs: |
| | 84 | * '''project_url, authenticator, batch_id''': as above. |
| | 85 | * '''paths''': a list of paths of files to be uploaded |
| | 86 | * '''md5s''': a list of MD5 hashes of these files |
| | 87 | * '''batch_id''': the ID of a batch with which the files are associated |
| | 88 | |
| | 89 | Action: Upload the files, and create associations to the given batch. |
| | 90 | |
| | 91 | Output: |
| | 92 | * return value: nonzero on error |
| | 93 | |
| | 94 | If you use this system, periodically run the script |
| | 95 | '''html/ops/delete_job_files'''. |
| | 96 | This will delete files that are no longer associated |
| | 97 | with an active batch. |
| | 98 | |