Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

job submission: don't error out if standard templates missing; change comment in transitioner #2133

Merged
merged 3 commits into from
Sep 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions html/inc/submit.inc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ function req_to_xml($req, $op) {
foreach ($req->jobs as $job) {
$x .= " <job>
";
if (!empty($job->name)) {
$x .= " <name>$job->name</name>
";
}
if (!empty($job->rsc_fpops_est)) {
$x .= " <rsc_fpops_est>$job->rsc_fpops_est</rsc_fpops_est>
";
Expand Down Expand Up @@ -340,24 +344,23 @@ if (0) {
$req->project = "http://isaac.ssl.berkeley.edu/test/";
$req->authenticator = trim(file_get_contents("test_auth"));
$req->app_name = "uppercase";
$req->batch_name = "batch_name7";
$req->batch_name = "batch_name_11";
$req->app_version_num = 710;
$req->jobs = array();

$job = new StdClass;
$job->input_files = array();

$f = new StdClass;
$f->mode = "remote";
$f->url = "http://isaac.ssl.berkeley.edu/validate_logic.txt";
$f->md5 = "eec5a142cea5202c9ab2e4575a8aaaa7";
$f->nbytes = 4250;
$job->input_files[] = $f;

if (0) {
$f = new StdClass;
$f->mode = "local";
$f->source = "foobar";
//$job->input_files[] = $f;
}

$it = "
<input_template>
Expand All @@ -384,7 +387,7 @@ if (0) {
<name><OUTFILE_0/></name>
<generated_locally/>
<upload_when_present/>
<max_nbytes>5000000</max_nbytes>
<max_nbytes>6000000</max_nbytes>
<url><UPLOAD_URL/></url>
</file_info>
<result>
Expand All @@ -396,6 +399,10 @@ if (0) {
</output_template>
";
for ($i=0; $i<2; $i++) {
$job = new StdClass;
$job->input_files = array();
$job->input_files[] = $f;
$job->name = $req->batch_name."_$i";
//$job->rsc_fpops_est = $i*1e9;
$job->command_line = "--t $i";
$job->wu_template = $it;
Expand Down
2 changes: 2 additions & 0 deletions lib/submit_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def __init__(self):
return
def to_xml(self):
xml = '<job>\n'
if hasattr(self, 'name'):
xml += '<name>%s</name>\n'%self.name
if hasattr(self, 'rsc_fpops_est'):
xml += '<rsc_fpops_est>%f</rsc_fpops_est>\n'%self.rsc_fpops_est
if hasattr(self, 'command_line'):
Expand Down
4 changes: 4 additions & 0 deletions sched/transitioner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,10 @@ bool do_pass() {
"[WU#%lu %s] handle_wu: %s; quitting\n",
wu_item.id, wu_item.name, boincerror(retval)
);
// probably better to exit here.
// Whatever cause this WU to fail (and it could be temporary)
// might cause ALL WUs to fail
//
exit(1);
}

Expand Down
22 changes: 13 additions & 9 deletions tools/backend_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,17 @@

using std::string;

// the random part of output filenames needs to be hard to guess
// Initialize RNG based on time and PID
// (the random part of output filenames needs to be hard to guess)
//
static struct random_init {
random_init() {
srand48(getpid() + time(0));
}
} random_init;

// read file into buffer
//
int read_file(FILE* f, char* buf, int len) {
int n = fread(buf, 1, len, f);
buf[n] = 0;
Expand Down Expand Up @@ -268,15 +271,16 @@ int create_work2(
DB_WORKUNIT& wu,
const char* _wu_template,
const char* result_template_filename,
const char* result_template_filepath,
// relative to project root; stored in DB
const char* /* result_template_filepath*/,
// deprecated
vector<INFILE_DESC> &infiles,
SCHED_CONFIG& config_loc,
const char* command_line,
const char* additional_xml,
char* query_string
) {
int retval;
char _result_template[BLOB_SIZE];
char wu_template[BLOB_SIZE];

#if 0
Expand All @@ -297,13 +301,13 @@ int create_work2(
return retval;
}

retval = read_filename(
result_template_filepath, _result_template, sizeof(_result_template)
);
if (retval) {
// check for presence of result template.
// we don't need to actually look at it.
//
const char* p = config.project_path(result_template_filename);
if (!boinc_file_exists(p)) {
fprintf(stderr,
"create_work: can't read result template file %s\n",
result_template_filepath
"create_work: result template file %s doesn't exist\n", p
);
return retval;
}
Expand Down
5 changes: 4 additions & 1 deletion tools/create_work.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.

// Create workunit(s).
// Command-line program for creating jobs (workunits).
// Used directly for local job submission;
// run from PHP script for remote job submission.
//
// see http://boinc.berkeley.edu/trac/wiki/JobSubmission

#include "config.h"
Expand Down