2004-06-09 19:09:16 +00:00
|
|
|
<?php
|
2003-08-19 06:44:58 +00:00
|
|
|
require_once("docutil.php");
|
|
|
|
page_head("Storage");
|
|
|
|
echo "
|
2002-09-10 17:04:05 +00:00
|
|
|
<h3>Files and data servers</h3>
|
2002-04-30 22:22:54 +00:00
|
|
|
<p>
|
2002-08-19 18:43:10 +00:00
|
|
|
The BOINC storage model is based on <b>files</b>.
|
2004-12-20 20:47:25 +00:00
|
|
|
Examples of files:
|
|
|
|
<ul>
|
|
|
|
<li> The inputs and outputs of applications;
|
|
|
|
<li> Application executables, libraries, etc.
|
|
|
|
</ul>
|
2002-09-10 17:04:05 +00:00
|
|
|
<p>
|
2004-12-20 20:47:25 +00:00
|
|
|
The BOINC core client transfers files to and from project-operated
|
|
|
|
<b>data servers</b> using HTTP.
|
2002-04-30 22:22:54 +00:00
|
|
|
<p>
|
2002-08-19 18:43:10 +00:00
|
|
|
A file is described by an XML element of the form
|
2004-11-29 22:26:34 +00:00
|
|
|
".html_text("
|
|
|
|
<file_info>
|
|
|
|
<name>foobar</name>
|
|
|
|
<url>http://a.b.c/foobar</url>
|
|
|
|
<url>http://x.y.z/foobar</url>
|
2002-05-17 22:33:57 +00:00
|
|
|
...
|
2004-11-29 22:26:34 +00:00
|
|
|
<md5_cksum>123123123123</md5_cksum>
|
|
|
|
<nbytes>134423</nbytes>
|
|
|
|
<max_nbytes>200000</max_nbytes>
|
|
|
|
<status>1</status>
|
|
|
|
[ <generated_locally/> ]
|
|
|
|
[ <executable/> ]
|
|
|
|
[ <upload_when_present/> ]
|
|
|
|
[ <sticky/> ]
|
|
|
|
[ <signature_required/> ]
|
|
|
|
[ <no_delete/> ]
|
2004-12-02 22:56:49 +00:00
|
|
|
[ <report_on_rpc/> ]
|
2004-11-29 22:26:34 +00:00
|
|
|
</file_info>
|
|
|
|
")."
|
2004-04-23 00:05:16 +00:00
|
|
|
The elements are as follows:
|
|
|
|
";
|
|
|
|
list_start();
|
|
|
|
list_item(
|
2005-06-28 05:43:22 +00:00
|
|
|
"name",
|
|
|
|
"The file's name, which must be unique within the project.
|
|
|
|
If you want to use participant hosts on which
|
|
|
|
filenames are case-insensitive (e.g. Windows)
|
|
|
|
this uniqueness is case-insensitive."
|
2004-04-23 00:05:16 +00:00
|
|
|
);
|
2004-12-02 22:56:49 +00:00
|
|
|
list_item("url",
|
|
|
|
"a URL where the file is (or will be) located on a data server."
|
|
|
|
);
|
|
|
|
list_item("md5_cksum", "The MD5 checksum of the file."
|
|
|
|
);
|
|
|
|
list_item("nbytes",
|
2006-02-25 00:21:39 +00:00
|
|
|
"the size of the file in bytes."
|
2004-12-02 22:56:49 +00:00
|
|
|
);
|
|
|
|
list_item("max_nbytes",
|
|
|
|
"The maximum allowable size of the file in bytes (may be greater than 2^32).
|
|
|
|
This is used to prevent flooding data servers with bogus data."
|
|
|
|
);
|
|
|
|
list_item("status",
|
|
|
|
"0 if the file is not present,
|
|
|
|
1 if the file is present, or a negative error code if there was a
|
|
|
|
problem in downloading or generating the file."
|
|
|
|
);
|
|
|
|
list_item("generated_locally",
|
|
|
|
"If present, indicates that the file will be generated by an application on
|
|
|
|
the client, as opposed to being downloaded."
|
|
|
|
);
|
|
|
|
list_item("executable",
|
|
|
|
"If present, indicates that the file protections should be set to allow
|
|
|
|
execution."
|
|
|
|
);
|
|
|
|
list_item("upload_when_present",
|
2005-04-28 23:40:40 +00:00
|
|
|
"If present, indicates that the file should be uploaded
|
2005-08-13 03:19:22 +00:00
|
|
|
when the application finishes.
|
2005-10-15 05:08:59 +00:00
|
|
|
The file is uploaded even if the application doesn't
|
|
|
|
finish successfully.
|
2005-12-23 22:36:37 +00:00
|
|
|
API functions are available for
|
|
|
|
<a href=int_upload.php>uploading files prior to
|
|
|
|
finishing computation</a>.
|
2004-12-02 22:56:49 +00:00
|
|
|
");
|
|
|
|
list_item("sticky",
|
|
|
|
"If present, indicates that the file should be retained
|
|
|
|
on the client after its initial use."
|
|
|
|
);
|
|
|
|
list_item("signature_required",
|
|
|
|
"If present, indicates that the file should be verified with an
|
|
|
|
RSA signature.
|
|
|
|
This generally only applies to executable files."
|
|
|
|
);
|
|
|
|
list_item("no_delete",
|
|
|
|
"If present for an input (workunit) file,
|
2004-12-20 20:47:25 +00:00
|
|
|
indicates that the file should NOT be removed from the data server's
|
|
|
|
download directory when the workunit is completed.
|
|
|
|
Use this if a particular input file or files are used by more than one
|
|
|
|
workunit, or will be used by future workunits."
|
2004-12-02 22:56:49 +00:00
|
|
|
);
|
|
|
|
list_item("no_delete",
|
|
|
|
"If present for an output (result) file,
|
2004-12-20 20:47:25 +00:00
|
|
|
indicates that the file should NOT be removed from the data server's upload
|
2004-12-02 22:56:49 +00:00
|
|
|
directory when the corresponding workunit is completed.
|
2004-12-20 20:47:25 +00:00
|
|
|
Use with caution - this may cause your upload directory to overflow."
|
2004-12-02 22:56:49 +00:00
|
|
|
);
|
|
|
|
list_item("report_on_rpc",
|
|
|
|
"Include a description of this file in scheduler RPC requests,
|
|
|
|
so that the scheduler may send appropriate work
|
|
|
|
using <a href=sched_locality.php>locality scheduling</a>."
|
|
|
|
);
|
2004-04-23 00:05:16 +00:00
|
|
|
list_end();
|
|
|
|
echo "
|
2002-04-30 22:22:54 +00:00
|
|
|
<p>
|
2002-08-19 18:43:10 +00:00
|
|
|
Once a file is created (on a data server or a participant host) it
|
2004-12-20 20:47:25 +00:00
|
|
|
is <b>immutable</b>.
|
|
|
|
This means that all replicas of that file are assumed to be identical.
|
|
|
|
|
2005-12-21 21:46:22 +00:00
|
|
|
<a name=file_ref>
|
2002-07-29 19:01:38 +00:00
|
|
|
<h3>File references</h3>
|
2002-04-30 22:22:54 +00:00
|
|
|
<p>
|
2003-10-13 19:23:40 +00:00
|
|
|
Files may be associated with <a href=work.php>workunits</a>,
|
|
|
|
<a href=result.php>results</a> and
|
|
|
|
<a href=app.php>application versions</a>.
|
2002-08-19 18:43:10 +00:00
|
|
|
Each such association is represented by an XML element of the form
|
2004-11-29 22:26:34 +00:00
|
|
|
".html_text("
|
|
|
|
<file_ref>
|
|
|
|
<file_name>foobar</file_name>
|
|
|
|
[ <open_name>input</open_name> ]
|
|
|
|
[ <main_program/> ]
|
|
|
|
</file_ref>
|
|
|
|
")."
|
2004-04-23 00:05:16 +00:00
|
|
|
The elements are as follows:
|
2003-08-19 06:44:58 +00:00
|
|
|
";
|
2004-04-23 00:05:16 +00:00
|
|
|
list_start();
|
|
|
|
list_item("file_name", "Specifies a file.");
|
2005-12-21 21:46:22 +00:00
|
|
|
list_item("open_name",
|
|
|
|
"The name by which the application will refer to the file.
|
|
|
|
Applications access files using
|
|
|
|
<a href=api.php>the following functions</a>:
|
|
|
|
<pre>
|
|
|
|
char physical_name[256];
|
|
|
|
boinc_resolve_filename(\"input\", physical_name, 256);
|
|
|
|
fopen(physical_name, \"r\")
|
|
|
|
</pre>
|
|
|
|
In this example, open_name is 'input'.
|
|
|
|
It is mapped, at runtime, to a path that includes
|
|
|
|
the filename ('foobar' in the example above).
|
|
|
|
");
|
|
|
|
list_item("main_program",
|
|
|
|
"Relevant only for files associated with application versions.
|
|
|
|
It indicates that this file is the application's main program.
|
|
|
|
");
|
2004-04-23 00:05:16 +00:00
|
|
|
list_end();
|
2004-12-20 20:47:25 +00:00
|
|
|
|
|
|
|
echo "
|
|
|
|
<h3>File management</h3>
|
|
|
|
<p>
|
|
|
|
BOINC's default behavior is to delete files around
|
|
|
|
when they aren't needed any more.
|
|
|
|
Specifically:
|
|
|
|
<ul>
|
|
|
|
<li> On the client, input files are deleted when no workunit refers to them,
|
|
|
|
and output files are deleted when no result refers to them.
|
|
|
|
Application-version files are deleted when they are referenced
|
|
|
|
only from superceded application versions.
|
|
|
|
<li> On the client, the 'sticky' flag overrides the above mechanisms
|
|
|
|
and suppresses the deletion of the file.
|
|
|
|
The file may deleted by an explicit
|
|
|
|
<a href=delete_file.php>server request</a>.
|
|
|
|
The file may also be deleted at any time by the core client
|
|
|
|
in order to honor limits on disk-space usage.
|
|
|
|
<li> On the server, the <a href=file_deleter.php>file deleter daemon</a>
|
|
|
|
deletes input and output files that are no longer needed.
|
|
|
|
This can be suppressed using the 'no_delete' flag,
|
|
|
|
or using command-line options to the file deleter.
|
|
|
|
</ul>
|
2006-02-25 00:21:39 +00:00
|
|
|
|
|
|
|
<a name=compression></a>
|
|
|
|
<h3>File compression</h3>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
Starting with version 5.4, the BOINC client
|
|
|
|
is able to handle HTTP Content-Encoding types 'deflate' (zlib algorithm)
|
|
|
|
and 'gzip' (gzip algorithm).
|
|
|
|
The client decompresses these files 'on the fly' and
|
|
|
|
stores them on disk in uncompressed form.
|
|
|
|
<p>
|
|
|
|
Projects can set this encoding in two ways:
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
Use the Apache 2.0 mod_deflate module to automatically
|
|
|
|
compress files on the fly.
|
|
|
|
This method will work with all BOINC clients,
|
|
|
|
but it will do compression only for 5.4+ clients.
|
|
|
|
|
|
|
|
<li>
|
|
|
|
Compress their workunits when they create them and use
|
|
|
|
a filename suffix such as '.gz'.
|
|
|
|
In httpd.conf make sure that the following line is present:
|
|
|
|
<pre>
|
|
|
|
AddEncoding x-gzip .gz
|
|
|
|
</pre>
|
|
|
|
This will add the content encoding to the header so that
|
|
|
|
the client will decompress the file automatically.
|
|
|
|
This method has the advantage of reducing server disk usage
|
|
|
|
and server CPU load,
|
|
|
|
but it will only work with 5.4+ clients.
|
|
|
|
Use the 'min_core_version' field of the app_version table to enforce this.
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
You can also use these in conjunction because the mod_deflate module
|
|
|
|
allows you to exempt certain filetypes from on-the-fly compression.
|
|
|
|
|
|
|
|
<p>
|
|
|
|
Neither of these methods stores files in compressed form on the client.
|
|
|
|
For this, you must do compression at the application level.
|
|
|
|
The BOINC source distribution includes
|
|
|
|
<a href=boinc_zip.txt>a version of the zip library</a>
|
|
|
|
designed for use by BOINC applications on any platform.
|
2004-12-20 20:47:25 +00:00
|
|
|
";
|
2003-08-19 06:44:58 +00:00
|
|
|
page_tail();
|
|
|
|
?>
|