hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomwh...@apache.org
Subject svn commit: r893251 - in /hadoop/common/trunk: CHANGES.txt src/contrib/cloud/src/py/hadoop/cloud/cli.py src/contrib/cloud/src/py/hadoop/cloud/providers/ec2.py src/contrib/cloud/src/py/hadoop/cloud/service.py
Date Tue, 22 Dec 2009 18:06:02 GMT
Author: tomwhite
Date: Tue Dec 22 18:06:02 2009
New Revision: 893251

URL: http://svn.apache.org/viewvc?rev=893251&view=rev
Log:
HADOOP-6444. Support additional security group option in hadoop-ec2 script. Contributed by
Paul Egan.

Modified:
    hadoop/common/trunk/CHANGES.txt
    hadoop/common/trunk/src/contrib/cloud/src/py/hadoop/cloud/cli.py
    hadoop/common/trunk/src/contrib/cloud/src/py/hadoop/cloud/providers/ec2.py
    hadoop/common/trunk/src/contrib/cloud/src/py/hadoop/cloud/service.py

Modified: hadoop/common/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/CHANGES.txt?rev=893251&r1=893250&r2=893251&view=diff
==============================================================================
--- hadoop/common/trunk/CHANGES.txt (original)
+++ hadoop/common/trunk/CHANGES.txt Tue Dec 22 18:06:02 2009
@@ -73,6 +73,9 @@
 
     HADOOP-4656. Add a user to groups mapping service. (boryas, acmurthy)
 
+    HADOOP-6444. Support additional security group option in hadoop-ec2 script.
+    (Paul Egan via tomwhite)
+
   OPTIMIZATIONS
 
   BUG FIXES

Modified: hadoop/common/trunk/src/contrib/cloud/src/py/hadoop/cloud/cli.py
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/contrib/cloud/src/py/hadoop/cloud/cli.py?rev=893251&r1=893250&r2=893251&view=diff
==============================================================================
--- hadoop/common/trunk/src/contrib/cloud/src/py/hadoop/cloud/cli.py (original)
+++ hadoop/common/trunk/src/contrib/cloud/src/py/hadoop/cloud/cli.py Tue Dec 22 18:06:02 2009
@@ -84,6 +84,9 @@
   make_option("--client-cidr", metavar="CIDR", action="append",
     help="The CIDR of the client, which is used to allow access through the \
 firewall to the master node. (May be specified multiple times.)"),
+  make_option("--security-group", metavar="SECURITY_GROUP", action="append",
+    default=[], help="Additional security groups within which the instances \
+should be run. (Amazon EC2 only.) (May be specified multiple times.)"),
   make_option("--public-key", metavar="FILE",
     help="The public key to authorize on launching instances. (Non-EC2 \
 providers only.)"),
@@ -282,7 +285,8 @@
                          opt.get('instance_type'), opt.get('key_name'),
                          opt.get('public_key'), opt.get('user_data_file'),
                          opt.get('availability_zone'), opt.get('user_packages'),
-                         opt.get('auto_shutdown'), opt.get('env'))
+                         opt.get('auto_shutdown'), opt.get('env'),
+                         opt.get('security_group'))
     service.launch_master(template, config_dir, opt.get('client_cidr'))
 
   elif command == 'launch-slaves':
@@ -295,7 +299,8 @@
                          opt.get('instance_type'), opt.get('key_name'),
                          opt.get('public_key'), opt.get('user_data_file'),
                          opt.get('availability_zone'), opt.get('user_packages'),
-                         opt.get('auto_shutdown'), opt.get('env'))
+                         opt.get('auto_shutdown'), opt.get('env'),
+                         opt.get('security_group'))
     service.launch_slaves(template)
 
   elif command == 'launch-cluster':
@@ -315,13 +320,15 @@
                          opt.get('instance_type'), opt.get('key_name'),
                          opt.get('public_key'), opt.get('user_data_file'),
                          opt.get('availability_zone'), opt.get('user_packages'),
-                         opt.get('auto_shutdown'), opt.get('env')),
+                         opt.get('auto_shutdown'), opt.get('env'),
+                         opt.get('security_group')),
         InstanceTemplate((DATANODE, TASKTRACKER), number_of_slaves,
                          get_image_id(service.cluster, opt),
                          opt.get('instance_type'), opt.get('key_name'),
                          opt.get('public_key'), opt.get('user_data_file'),
                          opt.get('availability_zone'), opt.get('user_packages'),
-                         opt.get('auto_shutdown'), opt.get('env')),
+                         opt.get('auto_shutdown'), opt.get('env'),
+                         opt.get('security_group')),
                          ]
     elif len(args) > 2 and len(args) % 2 == 0:
       print_usage(sys.argv[0])
@@ -336,7 +343,8 @@
                            opt.get('public_key'), opt.get('user_data_file'),
                            opt.get('availability_zone'),
                            opt.get('user_packages'),
-                           opt.get('auto_shutdown'), opt.get('env')))
+                           opt.get('auto_shutdown'), opt.get('env'),
+                           opt.get('security_group')))
 
     service.launch_cluster(instance_templates, config_dir,
                            opt.get('client_cidr'))

Modified: hadoop/common/trunk/src/contrib/cloud/src/py/hadoop/cloud/providers/ec2.py
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/contrib/cloud/src/py/hadoop/cloud/providers/ec2.py?rev=893251&r1=893250&r2=893251&view=diff
==============================================================================
--- hadoop/common/trunk/src/contrib/cloud/src/py/hadoop/cloud/providers/ec2.py (original)
+++ hadoop/common/trunk/src/contrib/cloud/src/py/hadoop/cloud/providers/ec2.py Tue Dec 22
18:06:02 2009
@@ -221,10 +221,11 @@
       self._create_groups(role)
       
     user_data = instance_user_data.read_as_gzip_stream()
+    security_groups = self._get_group_names(roles) + kwargs.get('security_groups', [])
 
     reservation = self.ec2Connection.run_instances(image_id, min_count=number,
       max_count=number, key_name=kwargs.get('key_name', None),
-      security_groups=self._get_group_names(roles), user_data=user_data,
+      security_groups=security_groups, user_data=user_data,
       instance_type=size_id, placement=kwargs.get('placement', None))
     return [instance.id for instance in reservation.instances]
 

Modified: hadoop/common/trunk/src/contrib/cloud/src/py/hadoop/cloud/service.py
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/contrib/cloud/src/py/hadoop/cloud/service.py?rev=893251&r1=893250&r2=893251&view=diff
==============================================================================
--- hadoop/common/trunk/src/contrib/cloud/src/py/hadoop/cloud/service.py (original)
+++ hadoop/common/trunk/src/contrib/cloud/src/py/hadoop/cloud/service.py Tue Dec 22 18:06:02
2009
@@ -51,7 +51,8 @@
   def __init__(self, roles, number, image_id, size_id,
                      key_name, public_key,
                      user_data_file_template=None, placement=None,
-                     user_packages=None, auto_shutdown=None, env_strings=[]):
+                     user_packages=None, auto_shutdown=None, env_strings=[],
+                     security_groups=[]):
     self.roles = roles
     self.number = number
     self.image_id = image_id
@@ -63,6 +64,7 @@
     self.user_packages = user_packages
     self.auto_shutdown = auto_shutdown
     self.env_strings = env_strings
+    self.security_groups = security_groups
 
   def add_env_strings(self, env_strings):
     new_env_strings = list(self.env_strings or [])
@@ -307,7 +309,8 @@
                                             instance_user_data,
                                             key_name=it.key_name,
                                             public_key=it.public_key,
-                                            placement=it.placement)
+                                            placement=it.placement,
+                                            security_groups=it.security_groups)
     print "Waiting for %s instances in role %s to start" % \
       (it.number, ",".join(it.roles))
     try:



Mime
View raw message