David 23 Apr 2007

- make_project: remove --no_test_app option, add --test_app option
    - make_project: initial config in all cases has
        one_result_per_user_per_wu = 0
    - sample_assimilator: make it able to handle > 1 output file
    - boinc_cmd: make --help output more readable
    - User web: fix some undefined vars in translation.inc
        Rytis: let's try to fix PHP runtime warnings
    - DB: add default values for app table (avoid MySQL warnings)

    db/
        schema.sql
    html/
        inc/
            translation.inc
            uotd.inc
        ops/
            update_forum_activities.php
    lib/
        str_util.C
        boinc_cmd.C
    py/Boinc/
        setup_project.py
    sched/
        sample_work_generator.C
        sample_assimilator.C
    tools/
        make_project
        uc_wu, uc_result (new)

svn path=/trunk/boinc/; revision=12450
This commit is contained in:
David Anderson 2007-04-23 16:14:47 +00:00
parent e182b4370b
commit fe32380dcf
29 changed files with 168 additions and 74 deletions

View File

@ -3885,3 +3885,32 @@ Bruce 20 April 2007
sched/
sched_locality.C
David 23 Apr 2007
- make_project: remove --no_test_app option, add --test_app option
- make_project: initial config in all cases has
one_result_per_user_per_wu = 0
- sample_assimilator: make it able to handle > 1 output file
- boinc_cmd: make --help output more readable
- User web: fix some undefined vars in translation.inc
Rytis: let's try to fix PHP runtime warnings
- DB: add default values for app table (avoid MySQL warnings)
db/
schema.sql
html/
inc/
translation.inc
uotd.inc
ops/
update_forum_activities.php
lib/
str_util.C
boinc_cmd.C
py/Boinc/
setup_project.py
sched/
sample_work_generator.C
sample_assimilator.C
tools/
make_project
uc_wu, uc_result (new)

View File

@ -41,12 +41,12 @@ create table app (
id integer not null auto_increment,
create_time integer not null,
name varchar(254) not null,
min_version integer not null,
deprecated smallint not null,
min_version integer not null default 0,
deprecated smallint not null default 0,
user_friendly_name varchar(254) not null,
homogeneous_redundancy smallint not null,
weight double not null,
beta smallint not null,
homogeneous_redundancy smallint not null default 0,
weight double not null default 1,
beta smallint not null default 0,
primary key (id)
) type=InnoDB;

View File

@ -1,6 +1,6 @@
<?php
require_once("docutil.php");
page_head("The BOINC application programming interface (API)");
page_head("The BOINC application programming interface (API) [ Deprectated - Wiki ]");
echo "
<p>
The BOINC API is a set of C++ functions.

View File

@ -1,7 +1,7 @@
<?php
require_once("docutil.php");
page_head("Software prerequisites (Unix/Linux)");
page_head("Software prerequisites (Unix/Linux) [deprecated - wiki]");
echo "

View File

@ -7,7 +7,7 @@ It may not be necessary to build the core client;
you can get executables for many platforms at
<a href=http://boinc.berkeley.edu>http://boinc.berkeley.edu</a>.
<p>
See the <a href=build.php>Software Prerequisites</a>.
See the <a href=http://boinc.berkeley.edu/trac/wiki/SoftwarePrereqsUnix>Software Prerequisites</a>.
<h3>Unix, Mac OS/X</h3>
<p>

View File

@ -6,14 +6,14 @@ echo "
THIS FILE IS DEPRECATED. DON'T LINK TO IT.
<h3>Basics</h3>
<ul>
<li> <a href=build.php>Software prerequisites</a>
<li> <a href=http://boinc.berkeley.edu/trac/wiki/SoftwarePrereqsUnix>Software prerequisites</a>
<li> <a href=source_code.php>Getting source code</a>
</ul>
<h3>Platform-specific cookbooks</h3>
<ul>
<li> <a href=build_system.php>Building BOINC on Unix</a>
<li> <a href=mac_build.php>Building BOINC and BOINC applications on Mac OS X</a>
<li> <a href=mac_http://boinc.berkeley.edu/trac/wiki/SoftwarePrereqsUnix>Building BOINC and BOINC applications on Mac OS X</a>
<li> <a href=http://www.spy-hill.net/~myers/help/boinc/boinc-on-windows.html>Building BOINC applications on Windows</a>
<li> <a href=http://www.spy-hill.net/~myers/help/boinc/boinc-on-linux.html>Building BOINC and BOINC Applications on Linux</a>
<li> <a href=http://torque.oncloud8.com/archives/000124.html>Linux install notes</a> (out of date).

View File

@ -2,7 +2,7 @@
require_once("docutil.php");
page_head("The project configuration file");
page_head("The project configuration file [deprecated - wiki]");
echo "<!-- \$Id$ -->\n";
echo"

View File

@ -1,6 +1,6 @@
<?php
require_once("docutil.php");
page_head("Storage");
page_head("Storage [Deprecated - Wiki]");
echo "
<h3>Files and data servers</h3>
<p>

View File

@ -1,6 +1,6 @@
<?php
require_once("docutil.php");
page_head("The BOINC graphics API");
page_head("The BOINC graphics API [deprecated - Wiki]");
echo"
<p>
BOINC applications can optionally provide graphics,

View File

@ -1,6 +1,6 @@
<?php
require_once("docutil.php");
page_head("Overview of BOINC");
page_head("Overview of BOINC [Deprecated - Wiki]");
echo"
<p>
BOINC is a software platform for distributed computing

View File

@ -1,6 +1,6 @@
<?php
require_once("docutil.php");
page_head("The make_project script");
page_head("The make_project script [deprecated - Wiki]");
echo "
<p>
The <code>make_project</code> script creates

View File

@ -1,6 +1,6 @@
<?php
require_once("docutil.php");
page_head("Platforms");
page_head("Platforms [Deprecated - Wiki]");
echo "
<p>
The computers available to a volunteer computing project

View File

@ -4,7 +4,7 @@ page_head("Project creation cookbook");
echo "
<h2>Make skeletal project</h2>
<ul>
<li> Install and configure all <a href=build.php>prerequisite software</a>
<li> Install and configure all <a href=http://boinc.berkeley.edu/trac/wiki/SoftwarePrereqsUnix>prerequisite software</a>
(follow the directions carefully).
Make sure MySQL is configured and running.
<li> <a href=source_code.php>Get the BOINC software</a>,

View File

@ -1,7 +1,7 @@
<?php
require_once("docutil.php");
page_head("Project options");
page_head("Project options [deprecated - wiki]");
function list_option($x, $y) {
echo "<a name=$x></a>";

View File

@ -3,7 +3,7 @@ require_once("docutil.php");
page_head("Python scripting framework");
echo "
See the section on Python in the <a href=build.php>Software Prerequisites</a>.
See the section on Python in the <a href=http://boinc.berkeley.edu/trac/wiki/SoftwarePrereqsUnix>Software Prerequisites</a>.
<h2>Structure</h2>

View File

@ -1,6 +1,6 @@
<?php
require_once("docutil.php");
page_head("Recruiting and retaining volunteers");
page_head("Recruiting and retaining volunteers [deprecated - wiki]");
echo "
<h3>Contents</h3>
<ul>

View File

@ -1,6 +1,6 @@
<?php
require_once("docutil.php");
page_head("Redundancy and errors");
page_head("Redundancy and errors [deprecated - Wiki]");
echo "
A BOINC 'result' abstracts an instance of a computation,
possibly not performed yet.

View File

@ -2,7 +2,7 @@
require_once("docutil.php");
page_head("Test framework for BOINC developers (not intended for general use)");
echo "
See the section on testing in <a href=build.php>Software Prerequisites</a>.
See the section on testing in <a href=http://boinc.berkeley.edu/trac/wiki/SoftwarePrereqsUnix>Software Prerequisites</a>.
Note that a web server with PHP is required for
running a real server, but that requires a lot of path and permissions
configuration so we opt not to use them in testing.

View File

@ -288,6 +288,7 @@ function parseLanguage($file, $interface){
}
$translation_file = file($file);
$first_entry = true;
$current_token_text="";
for ($i = 0;$i<sizeof($translation_file);$i++){
$entry = ltrim(trim($translation_file[$i]));
//echo $entry;
@ -297,7 +298,7 @@ function parseLanguage($file, $interface){
//If this is not the first, save the previous entry
//Does token msgid entry exist in interface?
//If so, add to output
$id = checkToken($current_token, $interface, $i);
$id = checkToken($current_token, $interface, $i, $file);
if ($id!==false){
$output[$id]=$current_token_text;
}
@ -311,7 +312,7 @@ function parseLanguage($file, $interface){
$current_token_text.=getPOLineContent($entry);
}
}
$id = checkToken($current_token, $interface, $i);
$id = checkToken($current_token, $interface, $i, $file);
if ($id!==false){
$output[$id]=$current_token_text;
}
@ -323,7 +324,7 @@ function parseLanguage($file, $interface){
* Checks if token is in interface.
* Displays error if not
**********************/
function checkToken($current_token, $interface, $line){
function checkToken($current_token, $interface, $line, $file){
$id = array_search($current_token,$interface);
if ($id===false){
language_log("Above line ".$line.": Language file $file has a token (".$current_token.") that is not defined in the interface.",1);

View File

@ -40,7 +40,7 @@ function get_current_uotd() {
// see if it's time to pick a new UOTD.
//
function build_uotd_page() {
echo date("F d Y", time())."\n";
echo date("F d Y", time()).": Starting\n";
$current_uotd = get_current_uotd();
if ($current_uotd) {
$assigned = getdate($current_uotd->uotd_time);

View File

@ -7,6 +7,8 @@ define('MAX_REWARD', 4096);
define('SCALAR', 0.9);
set_time_limit(0);
echo date(DATE_RFC822), ": Starting\n";
db_init();
$now = time();
@ -37,6 +39,7 @@ while ($thread = mysql_fetch_object($result)) {
}
echo date(DATE_RFC822), ": Finished\n";
?>

View File

@ -61,36 +61,40 @@ void version(){
}
void help() {
fprintf(stderr, "\n\n\
usage: boinc_cmd [--host hostname] [--passwd passwd] command\n\n\
fprintf(stderr, "\n\
usage: boinc_cmd [--host hostname] [--passwd passwd] command\n\n\
Commands:\n\
--get_state show entire state\n\
--get_results show results\n\
--get_file_transfers show file transfers\n\
--get_project_status show status of all attached projects\n\
--get_simple_gui_info show status of projects and active results\n\
--get_disk_usage\n\
--result url result_name {suspend | resume | abort | graphics_window | graphics_fullscreen}\n\
--project url {reset | detach | update | suspend | resume | nomorework | allowmorework}\n\
--project_attach url auth\n\
--file_transfer url filename {retry | abort}\n\
--set_run_mode {always | auto | never} duration\n\
--set_network_mode {always | auto | never} duration\n\
--get_state show entire state\n\
--get_results show results\n\
--get_file_transfers show file transfers\n\
--get_project_status show status of all attached projects\n\
--get_simple_gui_info show status of projects and active results\n\
--get_disk_usage show disk usage\n\
--result url result_name op job operation\n\
op = suspend | resume | abort | graphics_window | graphics_fullscreen\n\
--project url op project operation\n\
op = reset | detach | update | suspend | resume | nomorework | allowmorework\n\
--project_attach url auth attach to project\n\
--file_transfer url filename op file transfer operation\n\
op = retry | abort\n\
--set_run_mode mode duration set run mode for given duration\n\
mode = always | auto | never\n\
--set_network_mode mode duration\n\
--get_proxy_settings\n\
--set_proxy_settings\n\
--get_messages seqno show messages > seqno\n\
--get_messages seqno show messages > seqno\n\
--get_host_info\n\
--acct_mgr_rpc url name password\n\
--run_benchmarks\n\
--get_screensaver_mode\n\
--set_screensaver_mode on|off blank_time {desktop window_station}\n\
--set_screensaver_mode on|off blank_time [desktop window_station]\n\
--get_project_config url\n\
--get_project_config_poll\n\
--lookup_account url email passwd\n\
--create_account url email passwd name\n\
--read_cc_config\n\
--quit\n\
");
--quit\n"
);
exit(1);
}

View File

@ -662,6 +662,7 @@ const char* boincerror(int which_error) {
case ERR_SHMEM_NAME: return "can't get shared mem segment name";
case ERR_NO_NETWORK_CONNECTION: return "no available network connection";
case ERR_IN_PROGRESS: return "operation in progress";
case ERR_ACCT_CREATION_DISABLED: return "account creation disabled";
case ERR_ATTACH_FAIL_INIT: return "Couldn't start master page download";
case ERR_ATTACH_FAIL_DOWNLOAD: return "Couldn't download master page";
case ERR_ATTACH_FAIL_PARSE: return "Couldn't parse master page";

View File

@ -365,13 +365,14 @@ def install_boinc_files(dest_dir):
class Project:
def __init__(self,
short_name, long_name,
project_dir=None,key_dir=None,
project_dir=None, key_dir=None,
master_url=None, cgi_url=None,
db_name=None,
production=False
):
init()
self.production = production
self.short_name = short_name
self.long_name = long_name or 'Project ' + self.short_name.replace('_',' ').capitalize()
@ -396,6 +397,7 @@ class Project:
config.show_results = 1
config.sched_debug_level = 3
config.fuh_debug_level = 3
config.one_result_per_user_per_wu = 0
config.master_url = master_url or os.path.join(options.html_url , self.short_name , '')
config.download_url = os.path.join(config.master_url, 'download')
@ -406,11 +408,9 @@ class Project:
config.key_dir = key_dir or os.path.join(self.project_dir , 'keys')
config.app_dir = os.path.join(self.project_dir, 'apps')
if production:
config.one_result_per_user_per_wu = '1'
config.min_sendwork_interval = 6
self.scheduler_url = os.path.join(config.cgi_url , 'cgi')
def dir(self, *dirs):
return apply(os.path.join,(self.project_dir,)+dirs)
@ -481,17 +481,15 @@ class Project:
self.dir('html/user/server_status.php'))
install(srcdir('html/languages/project_specific_translations/sample_en.po'), self.dir('html/languages/project_specific_translations/en.po'))
install(srcdir('tools/project.xml'), self.dir('project.xml'))
install(srcdir('test/uc_result'), self.dir('templates/uc_result'))
install(srcdir('test/uc_wu_nodelete'), self.dir('templates/uc_wu'))
install(srcdir('tools/create_work_example'), self.dir('bin/create_work_example'))
if not self.production:
install(srcdir('test/uc_result'), self.dir('templates/uc_result'))
install(srcdir('test/uc_wu_nodelete'), self.dir('templates/uc_wu'))
my_symlink(self.config.config.download_dir, self.dir('html', 'user', 'download'))
my_symlink('../stats', self.dir('html/user/stats'))
my_symlink('../user_profile', self.dir('html/user/user_profile'))
my_symlink('../user_profile', self.dir('html/user_profile/user_profile'))
# Copy the sched server in the cgi directory with the cgi names given
# source_dir/html/user/schedulers.txt
#

View File

@ -18,7 +18,7 @@
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// A sample assimilator that:
// 1) if success, copy the output file to a directory
// 1) if success, copy the output file(s) to a directory
// 2) if failure, append a message to an error log
#include <vector>
@ -34,29 +34,48 @@
using std::vector;
using std::string;
FILE* f = 0;
int write_error(char* p) {
static FILE* f = 0;
if (!f) {
f = fopen("../sample_results/errors", "a");
if (!f) return ERR_FOPEN;
}
fflush(f);
return 0;
}
int assimilate_handler(
WORKUNIT& wu, vector<RESULT>& /*results*/, RESULT& canonical_result
) {
int retval;
char buf[1024];
unsigned int i;
retval = boinc_mkdir("../sample_results");
if (retval) return retval;
if (wu.canonical_resultid) {
string output_file_path;
vector<string> output_file_paths;
char copy_path[256];
get_output_file_path(canonical_result, output_file_path);
sprintf(copy_path, "../sample_results/%s", wu.name);
retval = boinc_copy(output_file_path.c_str(), copy_path);
if (retval) return retval;
} else {
if (!f) {
f = fopen("../sample_results/errors", "a");
if (!f) return ERR_FOPEN;
get_output_file_paths(canonical_result, output_file_paths);
int n = output_file_paths.size();
for (i=0; i<n; i++) {
string path = output_file_paths[i];
if (n==1) {
sprintf(copy_path, "../sample_results/%s", wu.name);
} else {
sprintf(copy_path, "../sample_results/%s_%d", wu.name, i);
}
retval = boinc_copy(path.c_str() , copy_path);
if (retval) {
sprintf(buf, "couldn't copy file %s\n", path.c_str());
write_error(buf);
return retval;
}
}
fprintf(f, "%s: 0x%x\n", wu.name, wu.error_mask);
fflush(f);
} else {
sprintf(buf, "%s: 0x%x\n", wu.name, wu.error_mask);
return write_error(buf);
}
return 0;
}

View File

@ -77,7 +77,16 @@ int make_job() {
wu.clear();
wu.appid = app.id;
strcpy(wu.name, name);
wu.rsc_fpops_est = 1e12;
wu.rsc_fpops_bound = 1e14;
wu.rsc_memory_bound = 1e8;
wu.rsc_disk_bound = 1e8;
wu.delay_bound = 86400;
wu.min_quorum = REPLICATION_FACTOR;
wu.target_nresults = REPLICATION_FACTOR;
wu.max_error_results = REPLICATION_FACTOR*4;
wu.max_total_results = REPLICATION_FACTOR*8;
wu.max_success_results = REPLICATION_FACTOR*4;
infiles[0] = name;
// Register the job with BOINC
@ -85,7 +94,7 @@ int make_job() {
return create_work(
wu,
wu_template,
"uc_result",
"templates/uc_result",
"../templates/uc_result",
infiles,
1,
@ -103,7 +112,7 @@ void main_loop() {
if (n > CUSHION) {
sleep(60);
} else {
int njobs = (CUSHION-n)/REPLICATION_FACTOR+1;
int njobs = (CUSHION-n)/REPLICATION_FACTOR;
log_messages.printf(SCHED_MSG_LOG::MSG_DEBUG,
"Making %d jobs\n", njobs
);
@ -116,6 +125,10 @@ void main_loop() {
exit(retval);
}
}
// Now sleep for a few seconds to let the transitioner
// create instances for the jobs we just created.
// Otherwise we could end up creating an excess of jobs.
sleep(5);
}
}
}

View File

@ -35,7 +35,7 @@ Misc options:
--user_name default: $USER (%(USER)s)
--delete_prev_inst delete project-root first (from prev installation)
--drop_db_first drop database first (from prev installation)
--no_test_app don't install test application
--test_app install test application
Dir-options:
--project_root default: HOME/projects/PROJECT
@ -75,7 +75,7 @@ try:
'help',
'verbose=',
'no_query',
'no_test_app',
'test_app',
'user_name=',
'drop_db_first',
'delete_prev_inst',
@ -97,7 +97,7 @@ except getopt.GetoptError, e:
options.url_base = None
options.no_query = False
options.no_test_app = False
options.test_app = False
options.delete_prev_inst = False
for o,a in opts:
@ -105,7 +105,7 @@ for o,a in opts:
elif o == '-v': options.echo_verbose = 2
elif o == '--verbose': options.echo_verbose = int(a)
elif o == '--no_query': options.no_query = True
elif o == '--no_test_app': options.no_test_app = True
elif o == '--test_app': options.test_app = True
elif o == '--user_name': options.user_name = a
elif o == '--drop_db_first': options.drop_db_first = True
elif o == '--delete_prev_inst': options.delete_prev_inst = True
@ -206,7 +206,7 @@ project = Project(
cgi_url = options.cgi_url,
key_dir = options.key_dir,
db_name = options.db_name,
production = 1
production = True
)
project.install_project()
@ -216,7 +216,7 @@ proot = delete_slash(options.project_root)
project.sched_install('feeder')
project.sched_install('transitioner')
project.sched_install('file_deleter')
if not options.no_test_app:
if options.test_app:
project.config.daemons.make_node_and_append("daemon").cmd = 'sample_work_generator -d 3'
project.config.daemons.make_node_and_append("daemon").cmd = 'sample_bitwise_validator -d 3 -app uppercase'
project.config.daemons.make_node_and_append("daemon").cmd = 'sample_assimilator -d 3 -app uppercase'
@ -253,7 +253,7 @@ project.config.write()
print '''Done installing default daemons.'''
# copy the test app if needed
if not options.no_test_app:
if options.test_app:
pname = 'i686-pc-linux-gnu'
dname = 'uppercase_1.1_'+pname
ucdir = proot+'/apps/uppercase/'
@ -262,6 +262,9 @@ if not options.no_test_app:
os.mkdir(ucdir)
os.mkdir(versdir)
shutil.copy('../apps/upper_case', filepath)
shutil.copy('uc_result', proot+'/templates/')
shutil.copy('uc_wu', proot+'/templates/')
shutil.copy('../tools/create_work_example', proot+'/bin/')
httpd_conf_template_filename = os.path.join(
options.project_root,

13
tools/uc_result Normal file
View File

@ -0,0 +1,13 @@
<file_info>
<name><OUTFILE_0/></name>
<generated_locally/>
<upload_when_present/>
<max_nbytes>5000000</max_nbytes>
<url><UPLOAD_URL/></url>
</file_info>
<result>
<file_ref>
<file_name><OUTFILE_0/></file_name>
<open_name>out</open_name>
</file_ref>
</result>

10
tools/uc_wu Normal file
View File

@ -0,0 +1,10 @@
<file_info>
<number>0</number>
</file_info>
<workunit>
<file_ref>
<file_number>0</file_number>
<open_name>in</open_name>
</file_ref>
<command_line>-cpu_time 10</command_line>
</workunit>