[ARVADOS] updated: a5fbf74ba1454a555f2c74290e2ff08596955bb3
git at public.curoverse.com
git at public.curoverse.com
Wed Aug 13 16:35:45 EDT 2014
Summary of changes:
sdk/cli/bin/arv-run-pipeline-instance | 57 ++++++++++++++++++++++++-----------
1 file changed, 40 insertions(+), 17 deletions(-)
via a5fbf74ba1454a555f2c74290e2ff08596955bb3 (commit)
via b17d7233f5ccb8ec3d857ae3e506d53377207376 (commit)
via 884eae85a67a1d80002f17c36878511caa9596e0 (commit)
from 3cc80b447efcaf416ea4d6857d6d40583e462ff8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit a5fbf74ba1454a555f2c74290e2ff08596955bb3
Merge: 3cc80b4 b17d723
Author: Brett Smith <brett at curoverse.com>
Date: Wed Aug 13 16:36:42 2014 -0400
Merge branch '3405-pipeline-error-logging-wip'
Closes #3405, #3582.
commit b17d7233f5ccb8ec3d857ae3e506d53377207376
Author: Brett Smith <brett at curoverse.com>
Date: Tue Aug 12 14:48:32 2014 -0400
3405: Mark pipeline instances failed when they're aborted.
diff --git a/sdk/cli/bin/arv-run-pipeline-instance b/sdk/cli/bin/arv-run-pipeline-instance
index 8274f4c..980ce83 100755
--- a/sdk/cli/bin/arv-run-pipeline-instance
+++ b/sdk/cli/bin/arv-run-pipeline-instance
@@ -724,7 +724,14 @@ class WhRunPipelineInstance
end
def abort(msg)
- @instance.log_stderr(msg) if @instance
+ if @instance
+ if ["New", "Ready", "RunningOnClient",
+ "RunningOnServer"].include?(@instance[:state])
+ @instance[:state] = "Failed"
+ @instance.save
+ end
+ @instance.log_stderr(msg)
+ end
Kernel::abort(msg)
end
end
commit 884eae85a67a1d80002f17c36878511caa9596e0
Author: Brett Smith <brett at curoverse.com>
Date: Tue Aug 12 14:41:55 2014 -0400
3405: Log errors about launching pipeline instances.
There's a couple of components to this:
* Do some basic checks on the organization of the pipeline instance
before we start running it, and abort if any of them fail.
* If the pipeline runner aborts for any reason, send that as pipeline
instance stderr to the API server, so other tools like Workbench can
render it for users' benefit.
diff --git a/sdk/cli/bin/arv-run-pipeline-instance b/sdk/cli/bin/arv-run-pipeline-instance
index f20aceb..8274f4c 100755
--- a/sdk/cli/bin/arv-run-pipeline-instance
+++ b/sdk/cli/bin/arv-run-pipeline-instance
@@ -285,6 +285,16 @@ class PipelineInstance
def [](x)
@pi[x]
end
+
+ def log_stderr(msg)
+ $arv.log.create log: {
+ event_type: 'stderr',
+ object_uuid: self[:uuid],
+ owner_uuid: self[:owner_uuid],
+ properties: {"text" => msg},
+ }
+ end
+
protected
def initialize(j)
@attributes_to_update = {}
@@ -345,19 +355,7 @@ class JobCache
end
msg += "Job submission was: #{body.to_json}"
- $client.execute(:api_method => $arvados.logs.create,
- :body_object => {
- :log => {
- :object_uuid => pipeline[:uuid],
- :event_type => 'stderr',
- :owner_uuid => pipeline[:owner_uuid],
- :properties => {"text" => msg}
- }
- },
- :authenticated => false,
- :headers => {
- authorization: 'OAuth2 '+ENV['ARVADOS_API_TOKEN']
- })
+ pipeline.log_stderr(msg)
nil
end
end
@@ -380,10 +378,6 @@ class WhRunPipelineInstance
if template.match /[^-0-9a-z]/
# Doesn't look like a uuid -- use it as a filename.
@template = JSON.parse File.read(template), :symbolize_names => true
- if !@template[:components]
- abort ("#{$0}: Template loaded from #{template} " +
- "does not have a \"components\" key")
- end
else
result = $client.execute(:api_method => $arvados.pipeline_templates.get,
:parameters => {
@@ -422,8 +416,25 @@ class WhRunPipelineInstance
end
end
+ if not @template[:components].is_a?(Hash)
+ abort "\n#{Time.now} -- pipeline_template #{@template[:uuid]}\nSyntax error: Template missing \"components\" hash"
+ end
@components = @template[:components].dup
+ bad_components = @components.each_pair.select do |cname, cspec|
+ not cspec.is_a?(Hash)
+ end
+ if bad_components.any?
+ abort "\n#{Time.now} -- pipeline_template #{@template[:uuid]}\nSyntax error: Components not specified with hashes: #{bad_components.map(&:first).join(', ')}"
+ end
+
+ bad_components = @components.each_pair.select do |cname, cspec|
+ not cspec[:script_parameters].is_a?(Hash)
+ end
+ if bad_components.any?
+ abort "\n#{Time.now} -- pipeline_template #{@template[:uuid]}\nSyntax error: Components missing \"script_parameters\" hashes: #{bad_components.map(&:first).join(', ')}"
+ end
+
errors = []
@components.each do |componentname, component|
component[:script_parameters].each do |parametername, parameter|
@@ -711,6 +722,11 @@ class WhRunPipelineInstance
end
end
end
+
+ def abort(msg)
+ @instance.log_stderr(msg) if @instance
+ Kernel::abort(msg)
+ end
end
runner = WhRunPipelineInstance.new($options)
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list