[ARVADOS] updated: 7c21045a213c5cc8846a263124271c93d38d78b1
git at public.curoverse.com
git at public.curoverse.com
Fri May 9 14:55:23 EDT 2014
Summary of changes:
apps/workbench/app/models/pipeline_instance.rb | 3 ++-
.../application/_pipeline_status_label.html.erb | 6 +++---
.../pipeline_instances/_show_components.html.erb | 20 ++++++++++++--------
sdk/cli/bin/arv-run-pipeline-instance | 21 +++++++++++----------
4 files changed, 28 insertions(+), 22 deletions(-)
via 7c21045a213c5cc8846a263124271c93d38d78b1 (commit)
from 568d941d3fe4bc554af0bca6c1dc4d9fc66ce999 (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 7c21045a213c5cc8846a263124271c93d38d78b1
Author: radhika <radhika at curoverse.com>
Date: Fri May 9 14:54:07 2014 -0400
2352: Update the workbench and arv-run-pipeline-instance script to use pipeline_instance status instead of active and success flags.
diff --git a/apps/workbench/app/models/pipeline_instance.rb b/apps/workbench/app/models/pipeline_instance.rb
index d435ad4..93e9509 100644
--- a/apps/workbench/app/models/pipeline_instance.rb
+++ b/apps/workbench/app/models/pipeline_instance.rb
@@ -18,7 +18,8 @@ class PipelineInstance < ArvadosBase
end
def attribute_editable?(attr)
- attr && (attr.to_sym == :name || (attr.to_sym == :components and self.active == nil))
+ attr && (attr.to_sym == :name ||
+ (attr.to_sym == :components and self.state == 'New'))
end
def attributes_for_display
diff --git a/apps/workbench/app/views/application/_pipeline_status_label.html.erb b/apps/workbench/app/views/application/_pipeline_status_label.html.erb
index 020ce81..f68d547 100644
--- a/apps/workbench/app/views/application/_pipeline_status_label.html.erb
+++ b/apps/workbench/app/views/application/_pipeline_status_label.html.erb
@@ -1,8 +1,8 @@
-<% if p.success %>
+<% if p.state == 'Complete' %>
<span class="label label-success">finished</span>
-<% elsif p.success == false %>
+<% elsif p.state == 'Failed' %>
<span class="label label-danger">failed</span>
-<% elsif p.active %>
+<% elsif p.state == 'RunningOnServer' || p.state == 'RunningOnClient' %>
<span class="label label-info">running</span>
<% else %>
<% if (p.components.select do |k,v| v[:job] end).length == 0 %>
diff --git a/apps/workbench/app/views/pipeline_instances/_show_components.html.erb b/apps/workbench/app/views/pipeline_instances/_show_components.html.erb
index fbedddf..3fae559 100644
--- a/apps/workbench/app/views/pipeline_instances/_show_components.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_show_components.html.erb
@@ -16,7 +16,7 @@
<% end %>
<% end %>
-<% if @object.active != nil %>
+<% if !@object.state.in? ['New', 'Ready', 'Paused'] %>
<table class="table pipeline-components-table">
<colgroup>
<col style="width: 15%" />
@@ -70,7 +70,7 @@
</tfoot>
</table>
-<% if @object.active %>
+<% if @object.state == 'RunningOnServer' || @object.state == 'RunningOnClient' %>
<% content_for :js do %>
setInterval(function(){$('a.refresh').click()}, 15000);
<% end %>
@@ -78,7 +78,7 @@ setInterval(function(){$('a.refresh').click()}, 15000);
<% content_for :tab_line_buttons do %>
<%= form_tag @object, :method => :put do |f| %>
- <%= hidden_field @object.class.to_s.underscore.singularize.to_sym, :active, :value => false %>
+ <%= hidden_field @object.class.to_s.underscore.singularize.to_sym, :state, :value => 'Paused' %>
<%= button_tag "Stop pipeline", {class: 'btn btn-primary pull-right', id: "run-pipeline-button"} %>
<% end %>
@@ -87,18 +87,22 @@ setInterval(function(){$('a.refresh').click()}, 15000);
<% end %>
<% else %>
-
- <p>Please set the desired input parameters for the components of this pipeline. Parameters highlighted in red are required.</p>
+ <% if @object.state == 'New' %>
+ <p>Please set the desired input parameters for the components of this pipeline. Parameters highlighted in red are required.</p>
+ <% end %>
<% content_for :tab_line_buttons do %>
<%= form_tag @object, :method => :put do |f| %>
- <%= hidden_field @object.class.to_s.underscore.singularize.to_sym, :active, :value => true %>
+ <%= hidden_field @object.class.to_s.underscore.singularize.to_sym, :state, :value => 'RunningOnServer' %>
<%= button_tag "Run pipeline", {class: 'btn btn-primary pull-right', id: "run-pipeline-button"} %>
<% end %>
<% end %>
- <%= render partial: 'show_components_editable', locals: {editable: true} %>
-
+ <% if @object.state == 'New' %>
+ <%= render partial: 'show_components_editable', locals: {editable: true} %>
+ <% else %>
+ <%= render partial: 'show_components_editable', locals: {editable: false} %>
+ <% end %>
<% end %>
diff --git a/sdk/cli/bin/arv-run-pipeline-instance b/sdk/cli/bin/arv-run-pipeline-instance
index 5f925ef..0550bbc 100755
--- a/sdk/cli/bin/arv-run-pipeline-instance
+++ b/sdk/cli/bin/arv-run-pipeline-instance
@@ -541,7 +541,7 @@ class WhRunPipelineInstance
end
end
@instance[:components] = @components
- @instance[:active] = moretodo
+# @instance[:active] = moretodo
report_status
if @options[:no_wait]
@@ -580,19 +580,19 @@ class WhRunPipelineInstance
if interrupted
if success
- @instance[:active] = false
- @instance[:success] = success
- @instance[:state] = "Complete"
+# @instance[:active] = false
+# @instance[:success] = success
+ @instance[:state] = 'Complete'
else
- @instance[:active] = nil
- @instance[:success] = nil
+# @instance[:active] = nil
+# @instance[:success] = nil
@instance[:state] = 'Paused'
end
else
if ended == @components.length or failed > 0
- @instance[:active] = false
- @instance[:success] = success
- @instance[:state] = success ? "Complete" : "Failed"
+# @instance[:active] = false
+# @instance[:success] = success
+ @instance[:state] = success ? 'Complete' : 'Failed'
end
end
@@ -605,7 +605,8 @@ class WhRunPipelineInstance
def cleanup
if @instance
- @instance[:active] = false
+# @instance[:active] = false
+ @instance[:state] = 'New' # should it be Failed?
@instance.save
end
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list