");
- foreach($results as $result) {
- echo "
- id>$result->id · $result->name |
- ".state_string($result)." |
-
-";
- $i = 0;
- if ($result->server_state == 5) {
- $phys_names = get_outfile_names($result);
- $log_names = get_outfile_log_names($result);
- for ($i=0; $iid, $i
- );
- $path = dir_hier_path($phys_names[$i], $upload_dir, $fanout);
- $s = stat($path);
- $size = $s['size'];
- echo sprintf('%s (%s bytes) ',
- $url,
- $log_names[$i],
- number_format($size)
- );
- }
- }
- echo " |
\n";
- }
end_table();
+ text_end();
echo "Return to job control page\n";
page_tail();
}
@@ -714,13 +767,15 @@ function handle_show_all($user) {
case 'abort_batch': handle_abort_batch($user); break;
case 'abort_batch_confirm': handle_abort_batch_confirm(); break;
case 'admin': handle_admin($user); break;
+case 'admin_app': handle_admin_app($user); break;
+case 'admin_all': handle_admin_all($user); break;
case 'batch_stats': handle_batch_stats($user); break;
case 'query_batch': handle_query_batch($user); break;
case 'query_job': handle_query_job($user); break;
case 'retire_batch': handle_retire_batch($user); break;
case 'retire_batch_confirm': handle_retire_batch_confirm(); break;
case 'show_all': handle_show_all($user); break;
-case 'toggle_loc': handle_toggle_loc($user);
+case 'toggle_loc': handle_toggle_loc($user); break;
default:
error_page("no such action $action");
}
diff --git a/samples/docker_wrapper/docker_wrapper.cpp b/samples/docker_wrapper/docker_wrapper.cpp
index 4b7a519393b..1e970249b07 100644
--- a/samples/docker_wrapper/docker_wrapper.cpp
+++ b/samples/docker_wrapper/docker_wrapper.cpp
@@ -122,9 +122,13 @@ DOCKER_CONN docker_conn;
// parse job config file
//
int parse_config_file() {
+ // defaults
+ config.workdir = "/app";
+
std::ifstream ifs(config_file);
if (ifs.fail()) {
- return -1;
+ fprintf(stderr, "no job.toml config file\n");
+ return 0;
}
toml::ParseResult r = toml::parse(ifs);
if (!r.valid()) {
@@ -136,8 +140,6 @@ int parse_config_file() {
x = v.find("workdir");
if (x) {
config.workdir = x->as();
- } else {
- config.workdir = "/app";
}
x = v.find("project_dir_mount");
if (x) {
diff --git a/samples/docker_wrapper/test_buda/Dockerfile_worker_1 b/samples/docker_wrapper/test_buda/Dockerfile_worker_1
new file mode 100644
index 00000000000..d897eaff2b1
--- /dev/null
+++ b/samples/docker_wrapper/test_buda/Dockerfile_worker_1
@@ -0,0 +1,3 @@
+FROM debian
+WORKDIR /app
+CMD ./main_2.sh
diff --git a/samples/docker_wrapper/test_buda/main_2.sh b/samples/docker_wrapper/test_buda/main_2.sh
new file mode 100644
index 00000000000..f07fd7a2a69
--- /dev/null
+++ b/samples/docker_wrapper/test_buda/main_2.sh
@@ -0,0 +1,3 @@
+#! /bin/bash
+
+./worker_3_x86_64-pc-linux-gnu --nsecs 20 in out
diff --git a/sched/assimilator.cpp b/sched/assimilator.cpp
index 3f62321003d..ca9c56db8b6 100644
--- a/sched/assimilator.cpp
+++ b/sched/assimilator.cpp
@@ -160,7 +160,8 @@ bool do_pass(APP& app) {
retval = assimilate_handler(wu, results, canonical_result);
if (retval && retval != DEFER_ASSIMILATION) {
log_messages.printf(MSG_CRITICAL,
- "[%s] handler error: %s; exiting\n", wu.name, boincerror(retval)
+ "assimilator.cpp [%s] handler error %d: %s; exiting\n",
+ wu.name, retval, boincerror(retval)
);
exit(retval);
}
diff --git a/sched/file_deleter.cpp b/sched/file_deleter.cpp
index a495a918775..7d5f7243bf1 100644
--- a/sched/file_deleter.cpp
+++ b/sched/file_deleter.cpp
@@ -17,6 +17,8 @@
// file deleter. See usage() below for usage.
+// skips WUs with 'nodelete' in the name
+// skips files with in the
// enum sizes. RESULT_PER_ENUM is three times larger on the
// assumption of 3-fold average redundancy.
diff --git a/sched/sample_assimilator.cpp b/sched/sample_assimilator.cpp
index eda8ce6cc62..f25f4450770 100644
--- a/sched/sample_assimilator.cpp
+++ b/sched/sample_assimilator.cpp
@@ -17,7 +17,7 @@
// A sample assimilator that:
// 1) if success, copy the output file(s) to a directory
-// ../sample_results/batchid
+// ../results/batchid
// If 1 output file, its name is the WU name
// If >1 files, file i is named _i
// 2) if failure, write a message to _error
@@ -89,11 +89,9 @@ int assimilate_handler(
bool file_copied = false;
for (i=0; i.
// A sample assimilator that only writes a log message.
+// But WUs are marked as assimilated, which means file deleter
+// will delete output files unless you mark them as no_delete,
+// or include 'no_delete' in the WU name
#include "config.h"
#include
diff --git a/sched/script_assimilator.cpp b/sched/script_assimilator.cpp
index 5dbc6777381..deabe191c1c 100644
--- a/sched/script_assimilator.cpp
+++ b/sched/script_assimilator.cpp
@@ -21,12 +21,15 @@
// cmdline args to this program:
// --script "scriptname arg1 ... argn"
//
-// The script assimilates a completed job.
+// This program runs the script for each completed job.
//
-// arg1 ... argn represent cmdline args to be passed to the script.
-// the options are:
+// arg1 ... argn are 'tokens' representing cmdline args
+// to be passed to the script.
+// possible tokens are:
//
-// files list of output files of the job's canonical result
+// files list of paths of output files of the canonical result
+// files2 list of
+// of output files of the canonical result
// wu_id workunit ID
// wu_name workunit name
// result_id ID of the canonical result
@@ -56,20 +59,22 @@
using std::vector;
using std::string;
-vector script;
+// scriptname, followed by arguments
+vector script_args;
int assimilate_handler_init(int argc, char** argv) {
// handle project specific arguments here
for (int i=1; i paths;
- retval = get_output_file_paths(canonical_result, paths);
+ sprintf(cmd, "../bin/%s", script_args[0].c_str());
+ vector fis;
+ retval = get_output_file_infos(canonical_result, fis);
if (retval) return retval;
- for (i=1; i& fis) {
if (xp.match_tag("file_ref")) {
OUTPUT_FILE_INFO fi;
int retval = fi.parse(xp);
- if (retval) return retval;
+ if (retval) {
+ log_messages.printf(MSG_CRITICAL,
+ "get_output_file_infos(): error parsing %s\n",
+ result.xml_doc_in
+ );
+ return retval;
+ }
if (standalone) {
- safe_strcpy(path, fi.name.c_str());
- if (!path_to_filename(fi.name, name)) {
- fi.name = name;
+ safe_strcpy(path, fi.phys_name.c_str());
+ if (!path_to_filename(fi.phys_name, name)) {
+ fi.phys_name = name;
}
} else {
dir_hier_path(
- fi.name.c_str(), config.upload_dir,
+ fi.phys_name.c_str(), config.upload_dir,
config.uldl_dir_fanout, path
);
}
diff --git a/sched/validate_util.h b/sched/validate_util.h
index 221c2d6cad5..f133dc05edc 100644
--- a/sched/validate_util.h
+++ b/sched/validate_util.h
@@ -27,8 +27,9 @@
// of result.xml_doc_in
//
struct OUTPUT_FILE_INFO {
- std::string name;
+ std::string phys_name;
std::string path;
+ std::string logical_name;
bool optional;
// sample_bitwise_validator: not an error if this file is missing
bool no_validate;
diff --git a/tools/create_work.cpp b/tools/create_work.cpp
index 0809b37f8a5..3680943b675 100644
--- a/tools/create_work.cpp
+++ b/tools/create_work.cpp
@@ -25,6 +25,15 @@
// - to create a single job, with everything passed on the cmdline
// - to create multiple jobs, where per-job info is passed via stdin,
// one line per job
+// available options here:
+// --wu_name X
+// --wu_template F
+// --result_template F
+// --remote_file url nbytes md5
+// --target_host ID
+// --target_user ID
+// --priority N
+// phys_name1 ...
//
// The input files must already be staged (i.e. in the download hierarchy).
@@ -436,10 +445,6 @@ int main(int argc, char** argv) {
strcat(jd.result_template_path, jd.result_template_file);
if (use_stdin) {
- // clear the WU template name so we'll recognize a job-level one
- //
- strcpy(jd.wu_template_file, "");
-
if (jd.assign_flag) {
// if we're doing assignment we can't use the bulk-query method;
// create the jobs one at a time.
diff --git a/tools/query_job b/tools/query_job
index 65a2b860202..9f56272f2f0 100755
--- a/tools/query_job
+++ b/tools/query_job
@@ -34,17 +34,17 @@ function show_wu($wu, $dir) {
." Host $host->id ($host->os_name, $host->p_vendor)\n"
." User $user->id ($user->name)\n"
;
+ $xmlin = simplexml_load_string(
+ sprintf("%s", $result->xml_doc_in)
+ );
$xmlout = simplexml_load_string(
sprintf("%s", $result->xml_doc_out)
);
$ofs = $xmlout->file_info;
+ $ifs = $xmlin->result->file_ref;
$nofs = $ofs->count();
for ($i=0; $i<$nofs; $i++) {
- if ($nofs == 1) {
- $path = "$dir/$wu->name";
- } else {
- $path = sprintf("$dir/%s_%d", $wu->name, $i);
- }
+ $path = sprintf("$dir/%s__file_%s", $wu->name, $ifs[$i]->open_name);
if (!is_file($path)) {
die("output file $i is missing: $path\n");
}
diff --git a/tools/sample_assimilate.py b/tools/sample_assimilate.py
index 766c4d9c914..2f48d22bc16 100755
--- a/tools/sample_assimilate.py
+++ b/tools/sample_assimilate.py
@@ -1,20 +1,21 @@
#! /usr/bin/env python3
# Sample script for the script-based assimilator (sched/script_assimilator.cpp)
-# Moves output files into a results/ dir hierarchy
+# Moves output files into a results/ hierarchy
#
# Use with a config.xml command of the form
-# script_assimilator -d 3 --app worker --script "sample_assimilate.py wu_name batch_id files"
+# script_assimilator -d 3 --app worker --script "sample_assimilate.py wu_name batch_id files2"
# With this command, this script will be invoked either as
-# sample_assimilate.py wu_name batch_id outfile_path1 ...
+# sample_assimilate.py wu_name batch_id outfile_path1 logical_name1 ...
# or
-# sample_assimilator.py --error error_code wu_name wu_id batch_id
+# sample_assimilator.py --error error_code wu_name wu_id batch_id
#
# in the 1st case, move the output files from the upload hierarchy
-# to results//_i
+# to results//__file_
+# where is the file's logical name
# in the 2nd case, write the error code
-# to results//_error
+# to results//_error
import sys, os
@@ -37,15 +38,13 @@
if os.system(cmd):
raise Exception('%s failed'%(cmd))
- nfiles = len(sys.argv) - 3
- if nfiles == 1:
- outfile_path = sys.argv[3]
- cmd = 'mv %s %s/%s'%(outfile_path, outdir, wu_name)
+ nfiles = (len(sys.argv) - 3)//2
+ for i in range(nfiles):
+ outfile_path = sys.argv[2*i+3]
+ logical_name = sys.argv[2*i+4]
+ cmd = 'mv %s %s/%s__file_%s'%(
+ outfile_path, outdir, wu_name, logical_name
+ )
if os.system(cmd):
- raise Exception('%s failed'%(cmd))
- else:
- for i in range(nfiles):
- outfile_path = sys.argv[i+3]
- cmd = 'mv %s %s/%s_%d'%(outfile_path, outdir, wu_name, i)
- if os.system(cmd):
- raise Exception('%s failed'%(cmd))
+ #raise Exception('%s failed'%(cmd))
+ sys.stderr.write('%s failed\n'%(cmd))
diff --git a/tools/submit_buda b/tools/submit_buda
index 5b5950c3a76..add5f0abfb3 100755
--- a/tools/submit_buda
+++ b/tools/submit_buda
@@ -1,35 +1,40 @@
#! /usr/bin/env php