rename jobs.resource_limits to runtime_constraints
authorTom Clegg <tom@clinicalfuture.com>
Mon, 7 Oct 2013 18:12:12 +0000 (14:12 -0400)
committerTom Clegg <tom@clinicalfuture.com>
Mon, 7 Oct 2013 18:12:12 +0000 (14:12 -0400)
12 files changed:
apps/workbench/app/views/jobs/index.html.erb
doc/api/JobTasks.textile
doc/api/Jobs.textile
doc/examples/pipeline_templates/rtg-fq-snp.json
sdk/cli/bin/arv-run-pipeline-instance
sdk/cli/bin/crunch-job
sdk/python/arvados.py
services/api/app/controllers/arvados/v1/jobs_controller.rb
services/api/app/models/job.rb
services/api/db/migrate/20131007180607_rename_resource_limits_to_runtime_constraints.rb [new file with mode: 0644]
services/api/db/schema.rb
services/api/script/crunch-dispatch.rb

index d03f557dcffa14abb5da4726c16b3b6c6b95c31c..2188a3bcf63653b5e5dfe3bd9f726afb68dca033 100644 (file)
         </table>
       </td><td>
         <table class="table table-condensed">
-        <% j.resource_limits.sort.each do |k,v| %>
+        <% j.runtime_constraints.sort.each do |k,v| %>
         <tr><td><%= v %></td><td><%= k %></td></tr>
         <% end %>
         </table>
index bc2ece1d10981c2165f032c19450d5c3dcb6bbbd..e950afdcdda7689f125163cf90e546a128015fe8 100644 (file)
@@ -35,7 +35,7 @@ table(table table-bordered table-condensed).
 A step cannot be run until all steps with lower sequence numbers have completed.
 Job steps with the same sequence number can be run in any order.|
 |parameters{}|list||
-|resource_limits{}|list|Constraints that must be satisfied by the job/task scheduler in order to run the task (see below).|
+|runtime_constraints{}|list|Constraints that must be satisfied by the job/task scheduler in order to run the task (see "Jobs":Jobs.html).|
 |output|string||
 |progress|float||
 |success|boolean|Is null if the task has neither completed successfully nor failed permanently.|
index f0f7529e0d0ed20fb03fc58c98d093579b44cfd6..5ae74ca1cfe83c9729b0f17359b61671317ebc99 100644 (file)
@@ -46,7 +46,7 @@ table(table table-bordered table-condensed).
 |*Property name*|*Type*|*Description*|*Notes*|
 |submit_id|string|Unique ID provided by client when job was submitted|Optional. Can be used by client to ensure idempotence|
 |priority|string|||
-|resource_limits{}|list|Constraints that must be satisfied by the job/task scheduler in order to run the job.|See below.|
+|runtime_constraints{}|list|Constraints that must be satisfied by the job/task scheduler in order to run the job.|See below.|
 |script_name|string|Name of MapReduce script||
 |script_parameters{}|list|Parameters passed to MapReduce script||
 |script_version|string|git commit/tree used when running the job|If the job has not started, this can be a tag/branch instead of an unambiguous commit id.|
@@ -59,12 +59,21 @@ table(table table-bordered table-condensed).
 |success|boolean|Whether the job indicated successful completion|Is null if job has not finished|
 |is_locked_by_uuid|string|UUID of the user who has locked this job|Is null if job is not locked. The system user locks the job when starting the job, in order to prevent job attributes from being altered.|
 
-h3. Resource limits
+h3. Runtime constraints
 
 table(table table-bordered table-condensed).
 |*Key*|*Type*|*Description*|*Implemented*|
-|min_nodes|integer||&#x2713;|
+|dependencies{}|list|[
+ {
+  "name": "freebayes",
+  "package_type": "git",
+  "origin": "https://github.com/ekg/freebayes.git",
+  "version": "011561f4a96619125d4388b66b2e82b173f3de7a"
+ },
+ ...
+]||
+|min_nodes|integer||&#10003;|
 |max_nodes|integer|||
-|max_tasks_per_node|integer|Maximum simultaneous tasks on a single node|&#x2713;|
+|max_tasks_per_node|integer|Maximum simultaneous tasks on a single node|&#10003;|
 |min_ram_per_task|integer|Minimum real memory (KiB) per task||
 |min_ram_per_node|integer|Minimum real memory (KiB) per node||
\ No newline at end of file
index 1235455a6d5cfcca7707bb45a5bb5782f45433c0..c951c4c43372defc4f80c39b292d4aa4d114d159 100644 (file)
@@ -52,7 +52,7 @@
      "optional":false
     }
    },
-   "resource_limits":{
+   "runtime_constraints":{
     "max_tasks_per_node":1
    }
   },
index 23a3d0283f383d4332634a33a098cd293ee78b42..47c69022b54de0de44c2dfcd228ad8127176dd51 100755 (executable)
@@ -448,7 +448,7 @@ class WhRunPipelineInstance
               debuglog "component #{cname} new job."
               job = JobCache.create(:script => c[:script],
                                     :script_parameters => c[:script_parameters],
-                                    :resource_limits => c[:resource_limits] || {},
+                                    :runtime_constraints => c[:runtime_constraints] || {},
                                     :script_version => c[:script_version] || 'master')
               if job
                 debuglog "component #{cname} new job #{job[:uuid]}"
index 10acb8cbbe72ee99a539e49ebd0dfe168405c924..e23492aba4b3766ae258447ab359616e14548f47 100755 (executable)
@@ -170,9 +170,9 @@ $job_id = $Job->{'uuid'};
 
 
 
-$Job->{'resource_limits'} ||= {};
-$Job->{'resource_limits'}->{'max_tasks_per_node'} ||= 0;
-my $max_ncpus = $Job->{'resource_limits'}->{'max_tasks_per_node'};
+$Job->{'runtime_constraints'} ||= {};
+$Job->{'runtime_constraints'}->{'max_tasks_per_node'} ||= 0;
+my $max_ncpus = $Job->{'runtime_constraints'}->{'max_tasks_per_node'};
 
 
 Log (undef, "check slurm allocation");
@@ -452,7 +452,7 @@ else
 
 
 
-foreach (qw (script script_version script_parameters resource_limits))
+foreach (qw (script script_version script_parameters runtime_constraints))
 {
   Log (undef,
        "$_ " .
index 6e06f5a589983d5311d532d59ada4d8c15f93295..2e49916ef5ac10d57f2c9bb22cd32dde11794b72 100644 (file)
@@ -83,8 +83,8 @@ def api():
     return service
 
 class JobTask:
-    def __init__(self, parameters=dict(), resource_limits=dict()):
-        print "init jobtask %s %s" % (parameters, resource_limits)
+    def __init__(self, parameters=dict(), runtime_constraints=dict()):
+        print "init jobtask %s %s" % (parameters, runtime_constraints)
 
 class job_setup:
     @staticmethod
index c330da512245a21f9166401428c2579713363038..514379e859a00814f73c938d6b9250c86228af19 100644 (file)
@@ -1,6 +1,6 @@
 class Arvados::V1::JobsController < ApplicationController
   accept_attribute_as_json :script_parameters, Hash
-  accept_attribute_as_json :resource_limits, Hash
+  accept_attribute_as_json :runtime_constraints, Hash
   accept_attribute_as_json :tasks_summary, Hash
   skip_before_filter :find_object_by_uuid, :only => :queue
 
index c299d9d73f66eef3372c0201040e45b217b1182a..154e2724db2e2aeab745ad2a1219ef9371eb59b2 100644 (file)
@@ -3,7 +3,7 @@ class Job < ArvadosModel
   include KindAndEtag
   include CommonApiTemplate
   serialize :script_parameters, Hash
-  serialize :resource_limits, Hash
+  serialize :runtime_constraints, Hash
   serialize :tasks_summary, Hash
   before_create :ensure_unique_submit_id
   before_create :ensure_script_version_is_commit
@@ -30,7 +30,7 @@ class Job < ArvadosModel
     t.add :running
     t.add :is_locked_by_uuid
     t.add :log
-    t.add :resource_limits
+    t.add :runtime_constraints
     t.add :tasks_summary
     t.add :dependencies
   end
diff --git a/services/api/db/migrate/20131007180607_rename_resource_limits_to_runtime_constraints.rb b/services/api/db/migrate/20131007180607_rename_resource_limits_to_runtime_constraints.rb
new file mode 100644 (file)
index 0000000..8a6a08a
--- /dev/null
@@ -0,0 +1,5 @@
+class RenameResourceLimitsToRuntimeConstraints < ActiveRecord::Migration
+  def change
+    rename_column :jobs, :resource_limits, :runtime_constraints
+  end
+end
index fe92304aff3b37360534bfbeacf61ad16a6ee04d..6a032d0d19502b4e1eb351ddc310f95d552a3da4 100644 (file)
@@ -11,7 +11,7 @@
 #
 # It's strongly recommended to check this file into your version control system.
 
-ActiveRecord::Schema.define(:version => 20130724153034) do
+ActiveRecord::Schema.define(:version => 20131007180607) do
 
   create_table "api_client_authorizations", :force => true do |t|
     t.string   "api_token",                                           :null => false
@@ -188,7 +188,7 @@ ActiveRecord::Schema.define(:version => 20130724153034) do
     t.string   "is_locked_by_uuid"
     t.string   "log"
     t.text     "tasks_summary"
-    t.text     "resource_limits"
+    t.text     "runtime_constraints"
   end
 
   add_index "jobs", ["created_at"], :name => "index_jobs_on_created_at"
index 388ef6bcea3929ce363d25146c854b8a62a32cd2..26baeb02fd9fc9ab8ed12d689c8f9204c697e3c8 100755 (executable)
@@ -56,8 +56,8 @@ class Dispatcher
 
       min_nodes = 1
       begin
-        if job.resource_limits['min_nodes']
-          min_nodes = begin job.resource_limits['min_nodes'].to_i rescue 1 end
+        if job.runtime_constraints['min_nodes']
+          min_nodes = begin job.runtime_constraints['min_nodes'].to_i rescue 1 end
         end
       end
       next if @idle_slurm_nodes and @idle_slurm_nodes < min_nodes