Skip to content

Commit

Permalink
added looping logic with the new directory paths closes #772 closes #759
Browse files Browse the repository at this point in the history


added loops and directory logic to the loops
  • Loading branch information
Matthew Letter committed Oct 19, 2017
1 parent 78c3d9c commit 43bc0d1
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 91 deletions.
2 changes: 1 addition & 1 deletion agent/slycat-docker-agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def checkjob(self, command):
}
try:
# /job_log.txt
results["output"], results["errors"] = ("COMPLETE", "COMPLETE")
results["output"], results["errors"] = ("COMPLETED", "COMPLETED")
except OSError as e:
sys.stdout.write("%s\n" % json.dumps({"ok": False, "message": e}))
sys.stdout.flush()
Expand Down
12 changes: 6 additions & 6 deletions packages/slycat/web/server/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,10 +430,10 @@ def create_distance_matrix(fn_id, params):
arr.append(
"python $SLYCAT_HOME/agent/slycat-agent-create-image-distance-matrix.py"
" --distance-measure %s --distance-column \"%s\" \"%s\" "
"~/slycat_%s_%s_%s_distance_matrix.csv --profile ${profile}" % (
"~/slycat_%s_%s_%s_distance_matrix.csv " % (
function_id, image_columns_name, params["input"], image_columns_name, uid, function_id))
# uncomment this line for local development
# arr.append("python slycat-agent-create-image-distance-matrix.py --distance-measure %s --distance-column \"%s\" \"%s\" ~/slycat_%s_%s_%s_distance_matrix.csv --profile ${profile}" % (f, c, params["input"], c, uid, f))
# arr.append("python slycat-agent-create-image-distance-matrix.py --distance-measure %s --distance-column \"%s\" \"%s\" ~/slycat_%s_%s_%s_distance_matrix.csv" % (f, c, params["input"], c, uid, f))

return arr

Expand Down Expand Up @@ -469,22 +469,22 @@ def compute_timeseries(fn_id, params, working_dir):
arr.append(
"python $SLYCAT_HOME/agent/slycat-agent-compute-timeseries.py "
"\"%s\" --timeseries-name=\"%s\" --cluster-sample-count %s --cluster-sample-type %s"
" --cluster-type %s --cluster-metric %s --workdir \"%s\" --hash %s --profile ${profile}" % (
" --cluster-type %s --cluster-metric %s --workdir \"%s\" --hash %s" % (
hdf5_dir, params["timeseries_name"], params["cluster_sample_count"],
params["cluster_sample_type"],
params["cluster_type"], params["cluster_metric"], pickle_dir, uid))
# uncomment this line for local development
# arr.append("python slycat-agent-compute-timeseries.py \"%s\" --timeseries-name=\"%s\" --cluster-sample-count %s --cluster-sample-type %s --cluster-type %s --cluster-metric %s --workdir \"%s\" --hash %s --profile ${profile}" % (params["output_directory"], params["timeseries_name"], params["cluster_sample_count"], params["cluster_sample_type"], params["cluster_type"], params["cluster_metric"], params["workdir"], uid))
# arr.append("python slycat-agent-compute-timeseries.py \"%s\" --timeseries-name=\"%s\" --cluster-sample-count %s --cluster-sample-type %s --cluster-type %s --cluster-metric %s --workdir \"%s\" --hash %s" % (params["output_directory"], params["timeseries_name"], params["cluster_sample_count"], params["cluster_sample_type"], params["cluster_type"], params["cluster_metric"], params["workdir"], uid))
else:
# uncomment this line for production
arr.append(
"python $SLYCAT_HOME/agent/slycat-agent-compute-timeseries.py "
"\"%s\" --cluster-sample-count %s --cluster-sample-type %s --cluster-type %s"
" --cluster-metric %s --workdir \"%s\" --hash %s --profile ${profile}" % (
" --cluster-metric %s --workdir \"%s\" --hash %s" % (
hdf5_dir, params["cluster_sample_count"], params["cluster_sample_type"], params["cluster_type"],
params["cluster_metric"], pickle_dir, uid))
# uncomment this line for local development
# arr.append("python slycat-agent-compute-timeseries.py \"%s\" --cluster-sample-count %s --cluster-sample-type %s --cluster-type %s --cluster-metric %s --workdir \"%s\" --hash %s --profile ${profile}" % (params["output_directory"], params["cluster_sample_count"], params["cluster_sample_type"], params["cluster_type"], params["cluster_metric"], params["workdir"], uid))
# arr.append("python slycat-agent-compute-timeseries.py \"%s\" --cluster-sample-count %s --cluster-sample-type %s --cluster-type %s --cluster-metric %s --workdir \"%s\" --hash %s" % (params["output_directory"], params["cluster_sample_count"], params["cluster_sample_type"], params["cluster_type"], params["cluster_metric"], params["workdir"], uid))

return arr

Expand Down
3 changes: 3 additions & 0 deletions web-server/js/slycat-remote-interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ define('slycat-remote-interface', ['knockout', 'knockout-mapping', 'slycat-serve
vm.retain_hdf5 = ko.observable(false);

vm.jid = ko.observable(-1);
vm.working_directory = ko.observable('');
vm.agent_function = ko.observable(params.agent_function === undefined ? '' : params.agent_function);
vm.agent_function_params = params.agent_function_params === undefined ? {} : params.agent_function_params;
vm.on_submit_callback = params.on_submit_callback;
Expand Down Expand Up @@ -240,6 +241,7 @@ define('slycat-remote-interface', ['knockout', 'knockout-mapping', 'slycat-serve
type: vm.model_type,
command: "checkjob",
parameters: {
working_directory: vm.working_directory(),
jid: vm.jid(),
fn: vm.agent_function(),
hostname: vm.remote.hostname(),
Expand Down Expand Up @@ -303,6 +305,7 @@ define('slycat-remote-interface', ['knockout', 'knockout-mapping', 'slycat-serve
vm.on_submit_callback();

vm.jid(results.jid);
vm.working_directory(results.working_dir)
server_checkjob(uid);
},
error: function(request, status, reason_phrase) {
Expand Down
Loading

0 comments on commit 43bc0d1

Please sign in to comment.