Skip to content
This repository has been archived by the owner on Nov 1, 2018. It is now read-only.

Release 0.3.1 #3

Open
wants to merge 5 commits into
base: release-0.3.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
package_dir = {'': 'src'},
packages=find_packages("src", exclude=["dg_paraproxy"]),

install_requires = ['boto>=2.0', 'paramiko>=1.7.7.1', 'colorama>=0.2.4', 'pyOpenSSL>=0.10',
install_requires = ['boto<2.0', 'paramiko>=1.7.7.1', 'colorama>=0.2.4', 'pyOpenSSL>=0.10',
'globusonline-transfer-api-client>=0.10.7'],
setup_requires = [ "setuptools_git >= 0.4.2", ],
include_package_data=True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
distro_id = "natty"
elsif node.platform_version == "10.10"
distro_id = "maverick"
elsif node.platform_version == "10.04"
distro_id = "lenny"
end

when "debian"
Expand Down
2 changes: 1 addition & 1 deletion src/globus/provision/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class GPConfig(Config):
"""),
Option(name = "server-port",
getter = "ec2-server-port",
type = OPTTYPE_STRING,
type = OPTTYPE_INT,
required = False,
doc = """
The TCP port of the EC2 server. If you are using Amazon AWS, leave this option
Expand Down
16 changes: 15 additions & 1 deletion src/globus/provision/core/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"""

from globus.provision.common.threads import GPThread
from globus.provision.common.ssh import SSH
from globus.provision.common.ssh import SSH, SSHCommandFailureException
from globus.provision.common import log
from globus.provision.core.topology import Node

Expand Down Expand Up @@ -221,6 +221,20 @@ def configure(self, ssh):

self.check_continue()

#temporarily add admin group
log.debug("Create new admin group")
try:
ssh.run("addgroup admin")
except SSHCommandFailureException:
log.debug("Admin group already exists, skipping..")

#temporarily add admin group
log.debug("Create new admin group")
try:
ssh.run("addgroup admin")
except SSHCommandFailureException:
log.debug("Admin group already exists, skipping..")

# Run chef
log.debug("Running chef", node)
ssh.run("echo -e \"cookbook_path \\\"/chef/cookbooks\\\"\\nrole_path \\\"/chef/roles\\\"\" > /tmp/chef.conf", expectnooutput=True)
Expand Down
42 changes: 23 additions & 19 deletions src/globus/provision/deploy/ec2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ def __connect(self):
try:
log.debug("Connecting to EC2...")
ec2_server_hostname = config.get("ec2-server-hostname")
ec2_server_port = config.get("ec2-server-port")
ec2_server_port = int(config.get("ec2-server-port"))
ec2_server_path = config.get("ec2-server-path")

if ec2_server_hostname != None:
self.conn = create_ec2_connection(ec2_server_hostname,
ec2_server_port,
ec2_server_path)
ec2_server_path,
ec2_server_port)
else:
self.conn = create_ec2_connection()

Expand All @@ -98,26 +98,30 @@ def __get_security_groups(self, topology, node):
if self.has_gp_sg:
sgs = ["globus-provision"]
else:
gp_sg = self.conn.get_all_security_groups(filters={"group-name":"globus-provision"})
if len(gp_sg) == 0:
gp_sg = self.conn.create_security_group('globus-provision', 'Security group for Globus Provision instances')
try:
gp_sg = self.conn.get_all_security_groups(filters={"group-name":"globus-provision"})
if len(gp_sg) == 0:
gp_sg = self.conn.create_security_group('globus-provision', 'Security group for Globus Provision instances')

# Internal
gp_sg.authorize(src_group = gp_sg)
# Internal
gp_sg.authorize(src_group = gp_sg)

# SSH
gp_sg.authorize('tcp', 22, 22, '0.0.0.0/0')
# SSH
gp_sg.authorize('tcp', 22, 22, '0.0.0.0/0')

# GridFTP
gp_sg.authorize('tcp', 2811, 2811, '0.0.0.0/0')
gp_sg.authorize('udp', 2811, 2811, '0.0.0.0/0')
gp_sg.authorize('tcp', 50000, 51000, '0.0.0.0/0')
# GridFTP
gp_sg.authorize('tcp', 2811, 2811, '0.0.0.0/0')
gp_sg.authorize('udp', 2811, 2811, '0.0.0.0/0')
gp_sg.authorize('tcp', 50000, 51000, '0.0.0.0/0')

# MyProxy
gp_sg.authorize('tcp', 7512, 7512, '0.0.0.0/0')
# MyProxy
gp_sg.authorize('tcp', 7512, 7512, '0.0.0.0/0')

# Galaxy
gp_sg.authorize('tcp', 8080, 8080, '0.0.0.0/0')
# Galaxy
gp_sg.authorize('tcp', 8080, 8080, '0.0.0.0/0')
except TypeError:
log.debug("Cannot setup security group, so skipping...")


sgs = ["globus-provision"]
self.has_gp_sg = True
Expand Down Expand Up @@ -284,4 +288,4 @@ def pre_configure(self, ssh):

def post_configure(self, ssh):
pass


6 changes: 3 additions & 3 deletions src/globus/provision/deploy/ec2/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def run(self):
# Some VMs don't include their hostname
ssh.run("echo \"%s `hostname`\" | sudo tee -a /etc/hosts" % instance.private_ip_address)

ssh.run("sudo apt-get install lsb-release")
ssh.run("sudo apt-get install lsb-release wget")
ssh.run("echo \"deb http://apt.opscode.com/ `lsb_release -cs` main\" | sudo tee /etc/apt/sources.list.d/opscode.list")
ssh.run("wget -qO - http://apt.opscode.com/packages@opscode.com.gpg.key | sudo apt-key add -")
ssh.run("sudo apt-get update")
Expand All @@ -107,7 +107,7 @@ def run(self):

print "Removing private data and authorized keys"
ssh.run("sudo find /root/.*history /home/*/.*history -exec rm -f {} \;", exception_on_error = False)
ssh.run("sudo find / -name authorized_keys -exec rm -f {} \;")
#ssh.run("sudo find / -name authorized_keys -exec rm -f {} \;")

# Apparently instance.stop() will terminate
# the instance (this is a known bug), so we
Expand Down Expand Up @@ -180,7 +180,7 @@ def run(self):

print "Removing private data and authorized keys"
ssh.run("sudo find /root/.*history /home/*/.*history -exec rm -f {} \;")
ssh.run("sudo find / -name authorized_keys -exec rm -f {} \;")
#ssh.run("sudo find / -name authorized_keys -exec rm -f {} \;")

# Apparently instance.stop() will terminate
# the instance (this is a known bug), so we
Expand Down