Tag the EC2 instances with the build uuid.

This commit is contained in:
Jake Moshenko 2015-01-05 15:35:14 -05:00
parent dd7664328c
commit fc757fecad
2 changed files with 7 additions and 5 deletions

View file

@ -37,7 +37,7 @@ class BuilderExecutor(object):
starting and stopping builders.
"""
@coroutine
def start_builder(self, realm, token):
def start_builder(self, realm, token, build_uuid):
""" Create a builder with the specified config. Returns a unique id which can be used to manage
the builder.
"""
@ -103,7 +103,7 @@ class EC2Executor(BuilderExecutor):
return stack_amis[ec2_region]
@coroutine
def start_builder(self, realm, token):
def start_builder(self, realm, token, build_uuid):
region = self.executor_config['EC2_REGION']
channel = self.executor_config.get('COREOS_CHANNEL', 'stable')
get_ami_callable = partial(self._get_coreos_ami, region, channel)
@ -141,6 +141,7 @@ class EC2Executor(BuilderExecutor):
'Name': 'Quay Ephemeral Builder',
'Realm': realm,
'Token': token,
'BuildUUID': build_uuid,
}))
raise Return(launched.id)
@ -163,7 +164,7 @@ class PopenExecutor(BuilderExecutor):
""" Executor which uses Popen to fork a quay-builder process.
"""
@coroutine
def start_builder(self, realm, token):
def start_builder(self, realm, token, build_uuid):
# Now start a machine for this job, adding the machine id to the etcd information
logger.debug('Forking process for build')
import subprocess