Skip to content
Browse files

cosmetic dashboard changes, AJAX cluster node preview in main page

  • Loading branch information...
1 parent 307da79 commit 9efc93b5e587e0a3ff05ea0e7c89c979e874520d Pete Skomoroch committed May 30, 2009
View
2 .gitignore
@@ -5,3 +5,5 @@ doc/app
config/config.yml
config/deploy.rb
config/s3.yml
+config/*.datawrangling
+
View
7 app/controllers/jobs_controller.rb
@@ -189,6 +189,7 @@ def error
# Custom actions for MPI cluster config files, convenience methods that return plain text
+
# GET /jobs/1/hosts
def hosts
@@ -270,4 +271,10 @@ def refresh
@jobs = Job.paginate :page => params[:page], :order => 'created_at DESC', :per_page =>10
end
+ # Custom action for AJAX node detail pane
+ def nodes_list
+ @job = Job.find(params[:job_id])
+ render :partial => "nodes_list", :locals => { :job => @job }
+ end
+
end
View
5 app/models/job.rb
@@ -189,7 +189,9 @@ def processors_per_node
end
+
def launch_cluster
+ #TODO: add a check before each step to see if job has been cancelled, if so abort...
puts 'background cluster launch initiated...'
begin
self.nextstep! # launch_pending -> launching_instances
@@ -262,6 +264,9 @@ def terminate_cluster_later
def terminate_cluster
+ #TODO: add a check to see if delayed_job launch has been initiated
+ # if it hasn't we need to delete the delayed job, for now we just block cancellation until nodes
+ # have launched
puts 'background cluster shutdown initiated...'
begin
self.nextstep! # cancellation_requested -> cancelling_job
View
31 app/views/jobs/_jobs_list.html.erb
@@ -1,32 +1,33 @@
<table>
<tr>
- <th>Id</th>
- <th>Name</th>
- <th>NodeType</th>
- <th># of Nodes</th>
- <th>OutputPath</th>
- <th>Started at</th>
- <th>Updated at</th>
- <th>Finished at</th>
- <th>State</th>
- <th>Progress</th>
- <th></th>
+ <th class="helpHed">Id</th>
+ <th class="helpHed">Name</th>
+ <th class="helpHed">NodeType</th>
+ <th class="helpHed"># of Nodes</th>
+ <th class="helpHed">Started at</th>
+ <th class="helpHed">Updated at</th>
+ <th class="helpHed">Finished at</th>
+ <th class="helpHed">State</th>
+ <th class="helpHed">Progress</th>
+ <th class="helpHed"></th>
+ <th class="helpHed"></th>
+ <th class="helpHed"></th>
</tr>
<% @jobs.each do |job| %>
- <tr>
+ <tr onclick="<%= remote_function :update => "nodes_list", :url =>
+ {:action => 'nodes_list', :job_id => job.id}, params[:job_id] => job.id %>">
<td><%=h job.id %></td>
<td><%=h job.name %></td>
<td><%=h job.instance_type %></td>
<td><%=h job.number_of_instances %></td>
- <td><%=h job.output_path %></td>
<td><%=h job.started_at.strftime('%m/%d %I:%M%p') unless job.started_at.nil? %></td>
<td><%=h job.updated_at.strftime('%m/%d %I:%M%p') unless job.updated_at.nil? %></td>
<td><%=h job.finished_at.strftime('%m/%d %I:%M%p') unless job.finished_at.nil? %></td>
<td><%=h job.state.gsub("_", " ") %></td>
<td><%=h job.progress %></td>
<td><%= image_tag(job.spinner_state) %></td>
- <td><%= link_to 'Show', job %></td>
- <td><%= link_to 'Cancel', cancel_job_path(job), :method => :put if job.is_cancellable? %></td>
+ <td><%= link_to 'Details', job %></td>
+ <td><%= link_to 'Cancel', cancel_job_path(job), :method => :put if job.is_cancellable? %> <%= 'Cancel' if not job.is_cancellable? %></td>
</tr>
<% end %>
</table>
View
16 app/views/jobs/_nodes_list.html.erb
@@ -1,13 +1,13 @@
-<h2>Cluster Nodes:</h2>
+<h2>Cluster Nodes for Job #<%=h @job.id %></h2>
<table>
<tr>
- <th>instance</th>
- <th>state</th>
- <th>Dns name</th>
- <th>Private dns name</th>
- <th>launch time</th>
- <th>Is configured</th>
- <th>NFS mounted</th>
+ <th class="helpHed">instance</th>
+ <th class="helpHed">state</th>
+ <th class="helpHed">Dns name</th>
+ <th class="helpHed">Private dns name</th>
+ <th class="helpHed">launch time</th>
+ <th class="helpHed">Is configured</th>
+ <th class="helpHed">NFS mounted</th>
</tr>
<% @job.nodes.each do |n| %>
View
9 app/views/jobs/index.html.erb
@@ -1,10 +1,17 @@
<h1>Elasticwulf Jobs</h1>
Submit a <%= link_to 'New job', new_job_path %><BR>
<BR><BR>
+
<div id="jobs_div">
<%= render :partial => "jobs_list", :locals => { :jobs => @jobs } %>
</div>
-<%= periodically_call_remote(:url => {:action => :refresh, :page=> params[:page] }, :frequency => '5', :condition => "start_polling == true",
+Click on a row above to see node details
+<BR>
+<div id = "nodes_list">
+ <%= render :partial => "nodes_list", :job_id => params[:job_id] unless @job.nil? %>
+</div>
+
+<%= periodically_call_remote(:url => {:action => :refresh, :page => params[:page], :job_id =>params[:job_id] }, :frequency => '5', :condition => "start_polling == true",
:update => 'jobs_div', :method => :get) %>
View
3 app/views/jobs/new.html.erb
@@ -1,5 +1,6 @@
<h2>Enter Your Job Parameters</h2>
-<%= link_to 'Back', jobs_path %>
+< <%= link_to 'Back', jobs_path %>
+<BR><BR>
<% form_for(@job) do |f| %>
<%= f.error_messages %>
View
2 app/views/jobs/refresh.erb
@@ -1 +1 @@
-<%= render :partial => "jobs_list", :locals => { :jobs => @jobs } %>
+<%= render :partial => "jobs_list", :locals => { :jobs => @jobs , :job => @job} %>
View
4 app/views/jobs/show.html.erb
@@ -1,5 +1,5 @@
-<%= link_to 'Edit', edit_job_path(@job) %> |
-<%= link_to 'Back', jobs_path %> |
+< <%= link_to 'Back', jobs_path %> |
+<%= link_to 'Edit', edit_job_path(@job) %>
<%= link_to 'Cancel Job', cancel_job_path(@job), :method => :put if @job.is_cancellable? %>
<h2>Job Details:</h2>
View
5 lib/bootscripts/ubuntu_installs.sh
@@ -38,10 +38,11 @@ apt-get -y install gawk curl
apt-get -y install zip unzip rsync bzip2
# version control
-apt-get -y install subversion mercurial git-core cvs
+apt-get -y install git-core
+apt-get -y install subversion mercurial cvs
# Amazon related tools
-apt-get -y install s3cmd ec2-ami-tools
+apt-get -y install s3cmd ec2-ami-tools
# MPI related
apt-get -y install build-essential
View
15 public/stylesheets/green.css
@@ -11,6 +11,7 @@ body {
table {
font: 11px/24px Verdana, Arial, Helvetica, sans-serif;
border-collapse: collapse;
+ border: 1px #6699CC solid;
}
th {
@@ -27,8 +28,22 @@ tr.yellow td {
td {
border-bottom: 1px solid #CCC;
padding: 0 0.5em;
+ border-top: 0px;
+ border-left: 1px solid #9CF;
+ border-right: 0px;
}
+th.helpHed
+ { border-bottom: 2px solid #6699CC;
+ border-left: 1px solid #6699CC;
+ background-color: #BEC8D1;
+ text-align: left;
+ text-indent: 5px;
+ font-family: Verdana;
+ font-weight: bold;
+ font-size: 11px;
+ color: #404040; }
+
td.adjacent {
border-left: 1px solid #CCC;

0 comments on commit 9efc93b

Please sign in to comment.
Something went wrong with that request. Please try again.