Merge branch 'master' of ssh://isaac.ssl.berkeley.edu/boinc-v2

This commit is contained in:
Rom Walton 2014-08-14 23:54:23 -04:00
commit 0ca81cb1da
4 changed files with 151 additions and 31 deletions

114
.gitignore vendored
View File

@ -24,19 +24,121 @@
/win_build/installerv2/redist/Windows/src/boinccas/Release95 /win_build/installerv2/redist/Windows/src/boinccas/Release95
/win_build/installerv2/redist/Windows/src/boinccas/x64 /win_build/installerv2/redist/Windows/src/boinccas/x64
# Netbeans project files
/html/nbproject/
# #
*.pfx *.pfx
*.pvk *.pvk
*.spc *.spc
*.o
*.lo
*.a
*.la
*.in
/client/Makefile
/win_build/*.filters /win_build/*.filters
/win_build/boinc.sdf /win_build/boinc.sdf
/win_build/boinc.opensdf /win_build/boinc.opensdf
/win_build/ipch /win_build/ipch
/win_build/installerv2/redist/Windows/src/boinccas/*.filters /win_build/installerv2/redist/Windows/src/boinccas/*.filters
/win_build/installerv2/redist/Windows/src/boinccas/boinccas.sdf /win_build/installerv2/redist/Windows/src/boinccas/boinccas.sdf
## files created by _autosetup (autoreconf):
*.in
*.in~
aclocal.m4
autom4te.cache/
compile
config.guess
config.sub
configure
depcomp
install-sh
ltmain.sh
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
missing
test-driver
## files created by configure:
Makefile
.deps/
boinc_path_config.py
pkginfo
prototype
client/scripts/boinc-client
config.h
config.log
config.status
libtool
py/Boinc/version.py
py/setup.py
stamp-h1
test/version.inc
## files created by make:
*.o
*.lo
*.a
*.la
.libs/
svn_version.h
# list of executables
apps/1sec
apps/concat
apps/upper_case
client/boinc
client/boinc_client
client/boinccmd
client/switcher
clientgui/boincmgr
clientscr/boincscr
doc/manpages/appmgr.8
doc/manpages/boinc.1
doc/manpages/boinccmd.1
doc/manpages/boincmgr.1
lib/crypt_prog
lib/parse_test
py/lib.*/
sched/adjust_user_priority
sched/antique_file_deleter
sched/census
sched/cgi
sched/credit_test
sched/db_dump
sched/db_purge
sched/delete_file
sched/fcgi
sched/fcgi_file_upload_handler
sched/feeder
sched/file_deleter
sched/file_upload_handler
sched/get_file
sched/make_work
sched/message_handler
sched/put_file
sched/sample_assimilator
sched/sample_bitwise_validator
sched/sample_dummy_assimilator
sched/sample_substr_validator
sched/sample_trivial_validator
sched/sample_work_generator
sched/sched_driver
sched/show_shmem
sched/single_job_assimilator
sched/size_regulator
sched/status
sched/stop
sched/transitioner
sched/trickle_credit
sched/trickle_deadline
sched/trickle_echo
sched/update_stats
sched/wu_check
tools/cancel_jobs
tools/create_work
tools/dir_hier_move
tools/dir_hier_path
tools/remote_submit_test
tools/sign_executable
vda/ssim
vda/vda
vda/vdad

View File

@ -134,6 +134,10 @@ check_version()
## ---------- now run autoreconf ## ---------- now run autoreconf
cmdline="autoreconf -i"; cmdline="autoreconf -i";
## -- if _autosetup was invoked with -f run autoreconf with -f to force a recreation of all files
if [ "x$1" == "x-f" ]; then
cmdline="autoreconf -i -f";
fi
echo "$cmdline" echo "$cmdline"
if eval $cmdline; then if eval $cmdline; then
echo "Done, now run ./configure" echo "Done, now run ./configure"

View File

@ -8,6 +8,7 @@ define('USER_HOST_TTL', 3600);
define('USER_PROFILE_TTL', 3600); define('USER_PROFILE_TTL', 3600);
define('TOP_PAGES_TTL', 43200); define('TOP_PAGES_TTL', 43200);
define('INDEX_PAGE_TTL', 3600); define('INDEX_PAGE_TTL', 3600);
define('STATUS_PAGE_TTL', 3600);
// max allowed cache usage // max allowed cache usage
// //

View File

@ -58,6 +58,10 @@ check_get_args(array("xml"));
$xml = get_int("xml", true); $xml = get_int("xml", true);
if (!defined('STATUS_PAGE_TTL')) {
define('STATUS_PAGE_TTL', 3600);
}
// daemon status outputs: 1 (running) 0 (not running) or -1 (disabled) // daemon status outputs: 1 (running) 0 (not running) or -1 (disabled)
// //
function daemon_status($host, $pidname, $progname, $disabled) { function daemon_status($host, $pidname, $progname, $disabled) {
@ -130,34 +134,34 @@ function show_counts($key, $xmlkey, $value) {
} }
function get_mysql_count($table, $query) { function get_mysql_count($table, $query) {
$count = unserialize(get_cached_data(3600, "get_mysql_count".$table.$query)); $count = unserialize(get_cached_data(STATUS_PAGE_TTL, "get_mysql_count".$table.$query));
if ($count == false) { if ($count == false) {
$count = BoincDB::get()->count($table, $query); $count = BoincDB::get()->count($table, $query);
set_cached_data(3600, serialize($count), "get_mysql_count".$table.$query); set_cached_data(STATUS_PAGE_TTL, serialize($count), "get_mysql_count".$table.$query);
} }
return $count; return $count;
} }
function get_mysql_sum($table, $field) { function get_mysql_sum($table, $field, $clause="") {
$value = unserialize(get_cached_data(3600, "get_mysql_sum".$table.$field)); $value = unserialize(get_cached_data(STATUS_PAGE_TTL, "get_mysql_sum".$table.$field.$clause));
if ($value == false) { if ($value == false) {
$value = BoincDB::get()->sum($table, $field); $value = BoincDB::get()->sum($table, $field, $clause);
set_cached_data(3600, serialize($value), "get_mysql_sum".$table.$field); set_cached_data(STATUS_PAGE_TTL, serialize($value), "get_mysql_sum".$table.$field.$clause);
} }
return $value; return $value;
} }
function get_cached_apps() { function get_cached_apps() {
$apps = unserialize(get_cached_data(3600, "get_cached_apps")); $apps = unserialize(get_cached_data(STATUS_PAGE_TTL, "get_cached_apps"));
if ($apps == false) { if ($apps == false) {
$apps = BoincApp::enum("deprecated=0"); $apps = BoincApp::enum("deprecated=0");
set_cached_data(3600, serialize($apps), "get_cached_apps"); set_cached_data(STATUS_PAGE_TTL, serialize($apps), "get_cached_apps");
} }
return $apps; return $apps;
} }
function get_runtime_info($appid) { function get_runtime_info($appid) {
$info = unserialize(get_cached_data(3600, "get_runtime_info".$appid)); $info = unserialize(get_cached_data(STATUS_PAGE_TTL, "get_runtime_info".$appid));
if ($info == false) { if ($info == false) {
$info = BoincDB::get()->lookup_fields("result", "stdClass", $info = BoincDB::get()->lookup_fields("result", "stdClass",
"ceil(avg(elapsed_time)/3600*100)/100 as avg, "ceil(avg(elapsed_time)/3600*100)/100 as avg,
@ -170,11 +174,11 @@ function get_runtime_info($appid) {
" "
); );
if (!$info){ if (!$info){
// No recent jobs sound // No recent jobs found
$info = new stdClass; $info = new stdClass;
$info->avg = $info->min = $info->max = $info->users = 0; $info->avg = $info->min = $info->max = $info->users = 0;
} }
set_cached_data(3600, serialize($info), "get_runtime_info".$appid); set_cached_data(STATUS_PAGE_TTL, serialize($info), "get_runtime_info".$appid);
} }
return $info; return $info;
} }
@ -215,10 +219,20 @@ $version = null;
if (file_exists("../../local.revision")) { if (file_exists("../../local.revision")) {
$version = trim(file_get_contents("../../local.revision")); $version = trim(file_get_contents("../../local.revision"));
} }
$now = time();
// we cache the current time to show via XML or on the page itself
// assuming that every cached element on this page is generated at the same time!
// To reset this, set STATUS_PAGE_TTL to 0 in project/cache_parameters.inc open
// this page in a browser and then set it back to 3600
//
$last_update = unserialize(get_cached_data(STATUS_PAGE_TTL, "server_status_last_update"));
if ($last_update == false) {
$last_update = time();
set_cached_data(STATUS_PAGE_TTL, serialize($last_update), "server_status_last_update");
}
$xmlstring = "<server_status> $xmlstring = "<server_status>
<update_time>$now</update_time> <update_time>$last_update</update_time>
"; ";
if ($version) { if ($version) {
$xmlstring .= "<software_version>$version</software_version>\n"; $xmlstring .= "<software_version>$version</software_version>\n";
@ -232,7 +246,7 @@ if ($xml) {
if ($version) { if ($version) {
echo tra("Server software version: %1", $version) . " / "; echo tra("Server software version: %1", $version) . " / ";
} }
echo time_str(time()), " echo time_str($last_update), "
<table width=100%> <table width=100%>
<tr> <tr>
<td width=40% valign=top> <td width=40% valign=top>
@ -241,7 +255,6 @@ if ($xml) {
<tr><th>".tra("Program")."</th><th>".tra("Host")."</th><th>".tra("Status")."</th></tr> <tr><th>".tra("Program")."</th><th>".tra("Host")."</th><th>".tra("Status")."</th></tr>
"; ";
} }
;
// Are the data-driven web sites running? Check for existence of stop_web. // Are the data-driven web sites running? Check for existence of stop_web.
// If it is there, set $web_running to -1 for "disabled", // If it is there, set $web_running to -1 for "disabled",
// otherwise it will be already set to 1 for "enabled." // otherwise it will be already set to 1 for "enabled."
@ -353,7 +366,7 @@ if ($retval) {
get_mysql_count("result", "file_delete_state=1") get_mysql_count("result", "file_delete_state=1")
); );
$gap = unserialize(get_cached_data(3600, "transitioner_backlog")); $gap = unserialize(get_cached_data(STATUS_PAGE_TTL, "transitioner_backlog"));
if ($gap === false) { if ($gap === false) {
$min = BoincDB::get()->lookup_fields("workunit", "stdClass", "MIN(transition_time) as min", "TRUE"); $min = BoincDB::get()->lookup_fields("workunit", "stdClass", "MIN(transition_time) as min", "TRUE");
//$gap = BoincDB::get()->min("workunit", "transition_time"); $gap = time()-$gap/3600; //$gap = BoincDB::get()->min("workunit", "transition_time"); $gap = time()-$gap/3600;
@ -361,7 +374,7 @@ if ($retval) {
if (($gap < 0) || ($min->min == 0)) { if (($gap < 0) || ($min->min == 0)) {
$gap = 0; $gap = 0;
} }
set_cached_data(3600, serialize($gap), "transitioner_backlog"); set_cached_data(STATUS_PAGE_TTL, serialize($gap), "transitioner_backlog");
} }
show_counts( show_counts(
tra("Transitioner backlog (hours)"), tra("Transitioner backlog (hours)"),