From 54b078d0afce63176d893eee93feb673b3383ba6 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 7 Oct 2009 18:42:51 +0000 Subject: [PATCH] - client: add --unsigned_apps_ok cmdline option and config option. This tells the client to allow unsigned apps. For testing. No file xfers or other network traffic will be allowed if set. - client: add option (same as cmdline flag) - client: add option (same as cmdline flag) - client: print message if abort past-deadline unstarted job - client: improve message when have NVIDIA drivers but no GPU svn path=/trunk/boinc/; revision=19276 --- checkin_notes | 22 ++++++++++++ client/app_start.cpp | 5 +++ client/client_state.cpp | 10 +++++- client/client_state.h | 9 ++--- client/cs_cmdline.cpp | 3 ++ client/cs_prefs.cpp | 4 +++ client/log_flags.cpp | 14 +++++++- lib/coproc.cpp | 2 +- samples/client_state_save.xml | 66 +++++++++++++++++++++++++++++++++++ 9 files changed, 128 insertions(+), 7 deletions(-) create mode 100644 samples/client_state_save.xml diff --git a/checkin_notes b/checkin_notes index eb405f98b3..af375591c7 100644 --- a/checkin_notes +++ b/checkin_notes @@ -8460,3 +8460,25 @@ David 6 Oct 2009 sched/ sched_send.cpp + +David 7 Oct 2009 + - client: add --unsigned_apps_ok cmdline option + and config option. + This tells the client to allow unsigned apps. + For testing. + No file xfers or other network traffic will be allowed if set. + - client: add option (same as cmdline flag) + - client: add option (same as cmdline flag) + - client: print message if abort past-deadline unstarted job + - client: improve message when have NVIDIA drivers but no GPU + + client/ + app_start.cpp + client_state.cpp,h + cs_cmdline.cpp + cs_prefs.cpp + log_flags.cpp + lib/ + coproc.cpp + samples/ + client_state_save.xml (new) diff --git a/client/app_start.cpp b/client/app_start.cpp index 5718cd753a..843a102a78 100644 --- a/client/app_start.cpp +++ b/client/app_start.cpp @@ -920,6 +920,11 @@ error: // gstate.input_files_available(result, true); gstate.report_result_error(*result, buf); + if (log_flags.task_debug) { + msg_printf(wup->project, MSG_INFO, + "[task_debug] couldn't start app: %s", buf + ); + } set_task_state(PROCESS_COULDNT_START, "start"); return retval; } diff --git a/client/client_state.cpp b/client/client_state.cpp index 13b29c57e8..b781ec6a4b 100644 --- a/client/client_state.cpp +++ b/client/client_state.cpp @@ -126,6 +126,7 @@ CLIENT_STATE::CLIENT_STATE(): disable_graphics = false; work_fetch_no_new_work = false; cant_write_state_file = false; + unsigned_apps_ok = false; debt_interval_start = 0; retry_shmem_time = 0; @@ -864,7 +865,10 @@ int CLIENT_STATE::link_app_version(PROJECT* p, APP_VERSION* avp) { // any file associated with an app version must be signed // - fip->signature_required = true; + if (!unsigned_apps_ok) { + fip->signature_required = true; + } + file_ref.file_info = fip; } return 0; @@ -993,6 +997,10 @@ bool CLIENT_STATE::abort_unstarted_late_jobs() { RESULT* rp = results[i]; if (!rp->not_started()) continue; if (rp->report_deadline > now) continue; + msg_printf(rp->project, MSG_INFO, + "Aborting task %s; not started and deadline has passed", + rp->name + ); rp->abort_inactive(ERR_UNSTARTED_LATE); action = true; } diff --git a/client/client_state.h b/client/client_state.h index a592826c2e..b1e62a039e 100644 --- a/client/client_state.h +++ b/client/client_state.h @@ -166,21 +166,22 @@ public: double last_wakeup_time; bool initialized; /// failed to write state file. - /// In this case we continue to run for 1 minute, /// handling GUI RPCs but doing nothing else, /// so that the Manager can tell the user what the problem is bool cant_write_state_file; + /// accept unsigned app files (use for testing only!!) + bool unsigned_apps_ok; + /// use hardwired numbers rather than running benchmarks + bool skip_cpu_benchmarks; private: bool client_state_dirty; int old_major_version; int old_minor_version; int old_release; - /// if set, use hardwired numbers rather than running benchmarks - bool skip_cpu_benchmarks; /// if set, run benchmarks on client startup bool run_cpu_benchmarks; - /// set if a benchmark fails to start because of a process that doesn't stop. + /// set if a benchmark fails to start because of a job that doesn't exit /// Persists so that the next start of BOINC runs the benchmarks. bool cpu_benchmarks_pending; diff --git a/client/cs_cmdline.cpp b/client/cs_cmdline.cpp index 82a10d186a..0b3499c538 100644 --- a/client/cs_cmdline.cpp +++ b/client/cs_cmdline.cpp @@ -83,6 +83,7 @@ static void print_options(char* prog) { " --show_projects show attached projects\n" " --skip_cpu_benchmarks don't run CPU benchmarks\n" " --start_delay X delay starting apps for X secs\n" + " --unsigned_apps_ok allow unsigned apps (for testing)\n" " --update_prefs contact a project to update preferences\n" " --version show version info\n" , @@ -219,6 +220,8 @@ void CLIENT_STATE::parse_cmdline(int argc, char** argv) { } else if (ARG(start_delay)) { if (i == argc-1) show_options = true; else config.start_delay = atof(argv[++i]); + } else if (ARG(unsigned_apps_ok)) { + unsigned_apps_ok = true; } else if (ARG(update_prefs)) { if (i == argc-1) show_options = true; else safe_strcpy(update_prefs_url, argv[++i]); diff --git a/client/cs_prefs.cpp b/client/cs_prefs.cpp index 62955e0e2f..d6158c746f 100644 --- a/client/cs_prefs.cpp +++ b/client/cs_prefs.cpp @@ -212,6 +212,10 @@ int CLIENT_STATE::resume_tasks(int reason) { } int CLIENT_STATE::check_suspend_network() { + // no network traffic if we're allowing unsigned apps + // + if (unsigned_apps_ok) return SUSPEND_REASON_USER_REQ; + switch(network_mode.get_current()) { case RUN_MODE_ALWAYS: return 0; case RUN_MODE_NEVER: diff --git a/client/log_flags.cpp b/client/log_flags.cpp index fe35597f26..1765fd09eb 100644 --- a/client/log_flags.cpp +++ b/client/log_flags.cpp @@ -240,7 +240,7 @@ int CONFIG::parse_options(XML_PARSER& xp) { return 0; } if (xp.parse_bool(tag, "abort_jobs_on_exit", btemp)) { - gstate.abort_jobs_on_exit = true; + gstate.abort_jobs_on_exit = btemp; continue; } if (xp.parse_bool(tag, "allow_multiple_clients", allow_multiple_clients)) continue; @@ -304,6 +304,18 @@ int CONFIG::parse_options(XML_PARSER& xp) { if (xp.parse_bool(tag, "use_certs", use_certs)) continue; if (xp.parse_bool(tag, "use_certs_only", use_certs_only)) continue; if (xp.parse_bool(tag, "zero_debts", zero_debts)) continue; + if (xp.parse_bool(tag, "skip_cpu_benchmarks", btemp)) { + gstate.skip_cpu_benchmarks = btemp; + continue; + } + if (xp.parse_bool(tag, "unsigned_apps_ok", btemp)) { + gstate.unsigned_apps_ok = btemp; + continue; + } + if (xp.parse_bool(tag, "exit_after_finish", btemp)) { + gstate.exit_after_finish = btemp; + continue; + } msg_printf(NULL, MSG_USER_ERROR, "Unrecognized tag in %s: <%s>\n", CONFIG_FILE, tag diff --git a/lib/coproc.cpp b/lib/coproc.cpp index 871bdfa944..029d5d68b2 100644 --- a/lib/coproc.cpp +++ b/lib/coproc.cpp @@ -323,7 +323,7 @@ void COPROC_CUDA::get( retval = (*__cuInit)(0); if (retval) { - sprintf(buf, "cuInit() returned %d", retval); + sprintf(buf, "NVIDIA drivers present but no GPUs found"); warnings.push_back(buf); return; } diff --git a/samples/client_state_save.xml b/samples/client_state_save.xml new file mode 100644 index 0000000000..d7498f6c39 --- /dev/null +++ b/samples/client_state_save.xml @@ -0,0 +1,66 @@ + + + 1e9 + 2e9 + 2e9 + 1e11 + 1e11 + + + http://test.test + test_project + + + + test_app + test_app + + + + test.exe + + 1 + + + input.txt + 1 + + + output.txt + + + 1e6 + + + + test_app + 6.3.0 + + test.exe + + + + + + test_wu + test_app + + input.txt + in + + + + + test_result + test_wu + 2 + 2e9 + + output.txt + out + + + +3 + +