Exemplo n.º 1
0
		def bootstrap(queue):
			# setsid() creates a new session, making this process the group leader.
			# We do that, so when the server calls killpg (kill process group)
			# on us, it won't kill itself (this process was spawned from a
			# thread under the server, meaning it's part of the same group).
			# The process hierarchy looks like this:
			# Pyro server (process - listening on a port)
			# +- pool thread
			# +- pool thread
			# +- pool thread
			# +- started thread (the one that got the "run()" call)
			#    L bootstrap() process (us)
			# Calling setsid() also fixes another problem:
			#   SIGINTs sent to this process seem to be redirected
			#   to the process leader. Since there is a thread between
			#   us and the process leader, the signal will not be propagated
			#   (signals are not propagated to threads), this means that any
			#   subprocess we start (i.e. debootstrap) will not get a SIGINT.
			import os
			os.setsid()
			from bootstrapvz.base.main import run
			try:
				bootstrap_info = run(manifest, debug=debug, dry_run=dry_run)
				queue.put(bootstrap_info)
			except (Exception, KeyboardInterrupt) as e:
				queue.put(e)
Exemplo n.º 2
0
 def dry_run(path):
     manifest = Manifest(path=path)
     run(manifest, dry_run=True)
Exemplo n.º 3
0
			"metadata_sources": "Ec2"
		}
	}
}

amis = {}
# Simple nested loop is to simple - not all combinations are valid here
for architecture in architectures:
	for bootloader in bootloaders:
		for partition_type in partitions:
			manifest_data['system']['architecture'] = architecture
			manifest_data['system']['bootloader'] = bootloader
			manifest_data['volume']['partitions']['type'] = partition_type
			manifest_data['volume']['partitions']['root'] = partitions[partition_type]
			manifest = Manifest(data=manifest_data)
			info = run(manifest, debug=True)
			amis[info._ec2['image']] = (architecture, bootloader, partition_type)
			print("Created {0} for {1}, {2}, {3}".format(info._ec2['image'], architecture, bootloader, partition_type))

# I'd be nice to have ability to 
instance_types = ['t1.micro']

aws_configuration = {'region_name': 'eu-west-1'}
ec2_connection = ec2.open_connection(aws_configuration)

security_group="WebServer"
key_name="DebianKeypair"

instances = []
# Also we'd need something more sophisticated here
# Not all instance types allow for running all AMIs (e.g. HVM vs. PVM)
Exemplo n.º 4
0
 def run(self, *args, **kwargs):
     from bootstrapvz.base.main import run
     return run(*args, **kwargs)
Exemplo n.º 5
0
	def run(self, *args, **kwargs):
		from bootstrapvz.base.main import run
		return run(*args, **kwargs)
Exemplo n.º 6
0
 def dry_run(path):
     manifest = Manifest(path=path)
     run(manifest, dry_run=True)