[ARVADOS] created: 0358074100610abe13cac98b82cbeca4326af986
git at public.curoverse.com
git at public.curoverse.com
Wed May 6 15:47:04 EDT 2015
at 0358074100610abe13cac98b82cbeca4326af986 (commit)
commit 0358074100610abe13cac98b82cbeca4326af986
Author: Ward Vandewege <ward at curoverse.com>
Date: Wed May 6 15:46:28 2015 -0400
Make MAX_SLOTS a configurable parameter, and rename it to max_compute_nodes.
refs #5926
diff --git a/services/api/app/models/node.rb b/services/api/app/models/node.rb
index bf27f6f..6c05650 100644
--- a/services/api/app/models/node.rb
+++ b/services/api/app/models/node.rb
@@ -13,8 +13,7 @@ class Node < ArvadosModel
belongs_to(:job, foreign_key: :job_uuid, primary_key: :uuid)
attr_accessor :job_readable
- MAX_SLOTS = 64
-
+ @@max_compute_nodes = Rails.configuration.max_compute_nodes
@@dns_server_conf_dir = Rails.configuration.dns_server_conf_dir
@@dns_server_conf_template = Rails.configuration.dns_server_conf_template
@@dns_server_reload_command = Rails.configuration.dns_server_reload_command
@@ -114,7 +113,7 @@ class Node < ArvadosModel
rescue ActiveRecord::RecordNotUnique
try_slot += 1
end
- raise "No available node slots" if try_slot == MAX_SLOTS
+ raise "No available node slots" if try_slot == @@max_compute_nodes
end while true
self.hostname = self.class.hostname_for_slot(self.slot_number)
end
@@ -192,7 +191,7 @@ class Node < ArvadosModel
# At startup, make sure all DNS entries exist. Otherwise, slurmctld
# will refuse to start.
if @@dns_server_conf_dir and @@dns_server_conf_template
- (0..MAX_SLOTS-1).each do |slot_number|
+ (0..@@max_compute_nodes-1).each do |slot_number|
hostname = hostname_for_slot(slot_number)
hostfile = File.join @@dns_server_conf_dir, "#{hostname}.conf"
if !File.exists? hostfile
diff --git a/services/api/config/application.default.yml b/services/api/config/application.default.yml
index 8646107..9ebaa50 100644
--- a/services/api/config/application.default.yml
+++ b/services/api/config/application.default.yml
@@ -304,3 +304,6 @@ common:
# have been finished for at least this many seconds, and delete their
# stderr logs from the logs table.
clean_job_log_rows_after: <%= 30.days %>
+
+ # The maximum number of compute nodes that can be in use simultaneously
+ max_compute_nodes: 64
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list