[ARVADOS] updated: ce3845c8ce108518832ea6ad9a10bb9b98a48174

git at public.curoverse.com git at public.curoverse.com
Tue Feb 25 15:37:32 EST 2014


Summary of changes:
 services/api/app/models/node.rb |   28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)

       via  ce3845c8ce108518832ea6ad9a10bb9b98a48174 (commit)
      from  be60b02bc5c56afaaec808d9e259eba51d951998 (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 ce3845c8ce108518832ea6ad9a10bb9b98a48174
Author: Ward Vandewege <ward at curoverse.com>
Date:   Tue Feb 25 15:36:25 2014 -0500

    Do not blow up on node create when the ec2 configuration values are not
    set.
    
    All this ec2-specific stuff needs to be ripped out, but for now this
    will have to do.

diff --git a/services/api/app/models/node.rb b/services/api/app/models/node.rb
index 0934f2e..459535b 100644
--- a/services/api/app/models/node.rb
+++ b/services/api/app/models/node.rb
@@ -127,17 +127,23 @@ class Node < ArvadosModel
   def start!(ping_url_method)
     ensure_permission_to_update
     ping_url = ping_url_method.call({ uuid: self.uuid, ping_secret: self.info[:ping_secret] })
-    ec2_args = ["--user-data '#{ping_url}'",
-                "-t c1.xlarge -n 1",
-                Rails.configuration.compute_node_ec2run_args,
-                Rails.configuration.compute_node_ami
-               ]
-    ec2run_cmd = ["ec2-run-instances",
-                  "--client-token", self.uuid,
-                  ec2_args].flatten.join(' ')
-    ec2spot_cmd = ["ec2-request-spot-instances",
-                   "-p #{Rails.configuration.compute_node_spot_bid} --type one-time",
-                   ec2_args].flatten.join(' ')
+    if (Rails.configuration.compute_node_ec2run_args rescue false) and
+       (Rails.configuration.compute_node_ami rescue false)
+      ec2_args = ["--user-data '#{ping_url}'",
+                  "-t c1.xlarge -n 1",
+                  Rails.configuration.compute_node_ec2run_args,
+                  Rails.configuration.compute_node_ami
+                 ]
+      ec2run_cmd = ["ec2-run-instances",
+                    "--client-token", self.uuid,
+                    ec2_args].flatten.join(' ')
+      ec2spot_cmd = ["ec2-request-spot-instances",
+                     "-p #{Rails.configuration.compute_node_spot_bid} --type one-time",
+                     ec2_args].flatten.join(' ')
+    else
+      ec2run_cmd = ''
+      ec2spot_cmd = ''
+    end
     self.info[:ec2_run_command] = ec2run_cmd
     self.info[:ec2_spot_command] = ec2spot_cmd
     self.info[:ec2_start_command] = ec2spot_cmd

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list