Changes between Version 3 and Version 4 of VolunteerStorage
- Timestamp:
- Jul 15, 2011, 12:01:45 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
VolunteerStorage
v3 v4 1 1 [[PageOutline]] 2 2 3 = Distributed filemanagement =3 = Distributed data management = 4 4 5 BOINC allows you to explicitly manage files on client hosts. 6 This might be used, e.g., to implement a high-latency distributed file system. 5 BOINC provides features for implementing distributed data management systems. 7 6 8 == Retrieving file lists == 7 Such a system is implemented as several components: 9 8 10 To instruct a host to send a list of all persistent files, use the function 9 * A "plug-in" to the BOINC scheduler, which is called on each scheduler RPC; 10 * A daemon program that handles timeouts; 11 * Interface programs, for example, programs allowing users to submit and retrieve files. 12 13 Note: to use these features, you must include 11 14 {{{ 12 request_file_list(int host_id) 15 <msg_to_host/> 13 16 }}} 14 or the command line program (run from the project root directory) 17 in your config.xml. 18 19 == Sending files to hosts == 20 21 From an interface program or daemon, call 22 15 23 {{{ 16 request_file_list [ -host_id X ] 24 int send_file(int host_id, const char* file_name) 17 25 }}} 18 If -host_id is absent, get file lists for all hosts. A message is created for the specific host (or all hosts) and added to the msg_to_host table in the database. The upload message included in the next RPC reply to the host.19 26 20 The file list will be included in the next scheduler RPC request. You must modify the scheduler to parse and store it. 27 or use the command line program 21 28 29 {{{ 30 send_file --host_id X --file_name Y 31 }}} 22 32 33 From the scheduler plugin, call 34 35 {{{ 36 int send_file_sched(const char* filename); 37 }}} 23 38 24 39 == Retrieving files == 25 40 26 A persistent file can be retrieved from a specific host. This can be done using the function 41 From an interface program or daemon, call 27 42 28 43 {{{ 29 get_file(int host_id, const char* file_name)44 int get_file(int host_id, const char* file_name) 30 45 }}} 31 46 32 or the command line program (run in the project root dir)47 or use the command line program 33 48 34 49 {{{ 35 get_file - host_id X-file_name Y50 get_file --host_id X --file_name Y 36 51 }}} 37 52 38 This program must be run in the project's root directory. get_file() creates a result with a name of the form: 53 54 From the scheduler plugin, call 39 55 40 56 {{{ 41 get_FILENAME_HOSTID_TIME 57 int get_file_sched(const char* filename); 42 58 }}} 43 Example: get_test.mpg_34_123456789 is a result representing the upload of test.mpg from host number 34 at time 1234567891.44 45 An upload message is created for the specific host and added to the msg_to_host table in the database. This message instructs the client to upload the file and acknowledge a successful upload. The upload message included in the next RPC reply to the host. The message has the form:46 47 {{{48 <app>49 <name>FILE_MOVER</name>50 </app>51 <app_version>52 <app_name>FILE_MOVER</app_name>53 <version_num>BOINC_MAJOR_VERSION</version_num>54 </app_version>55 <file_info>56 <name>file_name</name>57 <url>upload_dir</url>58 <max_nbytes>1e10</max_nbytes>59 <upload_when_present/>60 </file_info>61 RESULT_XML62 <workunit>63 <name>result.name</name>64 <app_name>FILE_MOVER</app_name>65 </workunit>66 }}}67 Include68 {{{<msg_to_host/>}}}69 in config.xml. Currently70 {{{<ignore_upload_certificates/>}}}71 needs to be included as there is no way to send upload certificates with these files.72 73 74 == Sending files ==75 76 To send a file to a specific host, use the function77 78 {{{79 send_file(int host_id, const char* file_name)80 }}}81 82 or the command line program (run from the project root directory)83 84 {{{85 send_file -host_id X -file_name Y86 }}}87 88 send_file creates a result and initializes it with a name of the form send_FILENAME_HOSTID_TIME.89 90 A message is created for the host and added to the msg_to_host table. This message instructs the client to download the file and acknowledge a successful download. The download message included in the next RPC reply to the host. The message has the form:91 92 {{{93 <app>94 <name>FILE_MOVER</name>95 </app>96 <app_version>97 <app_name>FILE_MOVER</app_name>98 <version_num>n</version_num>99 </app_version>100 <result>101 <wu_name>x</wu_name>102 <name>y</name>103 </result>104 <file_info>105 <name>file_name</name>106 <url>download_dir/file_name</url>107 <md5_cksum>md5</md5_cksum>108 <nbytes>file->nbytes</nbytes>109 <sticky/>110 </file_info>111 <workunit>112 <name>result.name</name>113 <app_name>FILE_MOVER</app_name>114 <file_ref>115 <file_name>file_name</file_name>116 </file_ref>117 </workunit>118 }}}119 120 For this to work, you need to include {{{<msg_to_host/>}}} in [ProjectOptions#client-control config.xml].121 122 59 123 60 == Deleting files == 124 61 125 To delete a file from a host, use the function 62 From an interface program or daemon, call 126 63 127 64 {{{ 128 delete_file(int host_id, const char* file_name)65 int delete_file(int host_id, const char* file_name) 129 66 }}} 130 67 131 or the command line program (run from the project root dir)68 or use the command line program 132 69 133 70 {{{ … … 135 72 }}} 136 73 137 `delete_file()` creates a message for the specific host and adds it to the `msg_to_host` table. This message instructs the client to delete the file. The message is included in the next scheduler reply to the host. The message XML has the form 74 From the scheduler plugin, call 138 75 139 76 {{{ 140 <delete_file_info>file_name</delete_file_info> 77 int delete_file_sched(const char* filename); 141 78 }}} 142 79 143 For this to work, you need to include {{{<msg_to_host/>}}} in [ProjectOptions#client-control config.xml]. 80 == Implementation == 144 81 82 From interface programs, 83 '''put_file''' and '''get_file''' create a message to the host (in the msg_to_host table). 84 The message is a chunk of XML that describes a "virtual" app and app version 85 (with no associate executable), 86 and a workunit and result that contain a single input or output file. 87 The result has a name of the form '''file_xfer_*''', 88 which tells the scheduler to treat it specially.