def __init__(self, name, password=None, master='', url='', instance_type="m3.large",
                identifier=ec2_default_access, secret_identifier=ec2_default_secret,
                keypair_name=ec2_default_keypair_name, security_name='LustreBuilder',
                user_data=None, region="us-west-1", placement="b", max_builds=1,
                build_wait_timeout=60 * 1, spot_instance=True, max_spot_price=.08,
                price_multiplier=None, **kwargs):

        self.name = name

        tags = kwargs.get('tags')
        if not tags or tags is None:
            tags={
                "ENV"      : "DEV",
                "Name"     : "LustreBuilder",
                "ORG"      : "COMP",
                "OWNER"    : "Buildbot Admin <*****@*****.**>",
                "PLATFORM" :  name,
                "PROJECT"  : "Lustre",
            }

        if password is None:
            password = LustreEC2Slave.pass_generator()

        if user_data is None:
            user_data = LustreEC2Slave.default_user_data % (master, name, password, url)

        EC2LatentBuildSlave.__init__(
            self, name=name, password=password, instance_type=instance_type, 
            identifier=identifier, secret_identifier=secret_identifier, region=region,
            user_data=user_data, keypair_name=keypair_name, security_name=security_name,
            max_builds=max_builds, spot_instance=spot_instance, tags=tags,
            max_spot_price=max_spot_price, placement=placement,
            price_multiplier=price_multiplier, build_wait_timeout=build_wait_timeout, 
            **kwargs)
    def __init__(self,
                 name,
                 password=None,
                 master='',
                 url='',
                 instance_type="m3.large",
                 identifier=ec2_default_access,
                 secret_identifier=ec2_default_secret,
                 keypair_name=ec2_default_keypair_name,
                 security_name='LustreBuilder',
                 user_data=None,
                 region="us-west-1",
                 placement="b",
                 max_builds=1,
                 build_wait_timeout=60 * 1,
                 spot_instance=True,
                 max_spot_price=.08,
                 price_multiplier=None,
                 **kwargs):

        self.name = name

        tags = kwargs.get('tags')
        if not tags or tags is None:
            tags = {
                "ENV": "DEV",
                "Name": "LustreBuilder",
                "ORG": "COMP",
                "OWNER": "Buildbot Admin <*****@*****.**>",
                "PLATFORM": name,
                "PROJECT": "Lustre",
            }

        if password is None:
            password = LustreEC2Slave.pass_generator()

        if user_data is None:
            user_data = LustreEC2Slave.default_user_data % (master, name,
                                                            password, url)

        EC2LatentBuildSlave.__init__(self,
                                     name=name,
                                     password=password,
                                     instance_type=instance_type,
                                     identifier=identifier,
                                     secret_identifier=secret_identifier,
                                     region=region,
                                     user_data=user_data,
                                     keypair_name=keypair_name,
                                     security_name=security_name,
                                     max_builds=max_builds,
                                     spot_instance=spot_instance,
                                     tags=tags,
                                     max_spot_price=max_spot_price,
                                     placement=placement,
                                     price_multiplier=price_multiplier,
                                     build_wait_timeout=build_wait_timeout,
                                     **kwargs)
Esempio n. 3
0
    def __init__(self, name, password=None, master='', url='', mode="BUILD",
                instance_type="m3.large", identifier=ec2_default_access,
                secret_identifier=ec2_default_secret,
                keypair_name=ec2_default_keypair_name, security_name='ZFSBuilder',
                user_data=None, region="us-west-1", placement='a', max_builds=1,
                build_wait_timeout=30 * 60, spot_instance=False, max_spot_price=0.10,
                price_multiplier=None, missing_timeout=60 * 20, **kwargs):

        self.name = name
        bin_path = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

        tags = kwargs.get('tags')
        if not tags or tags is None:
            tags={
                "ENV"      : "DEV",
                "Name"     : "ZFSBuilder",
                "ORG"      : "COMP",
                "OWNER"    : "behlendorf1",
                "PLATFORM" : self.name,
                "PROJECT"  : "ZFS",
            }

        if master in (None, ''):
            master = "build.zfsonlinux.org:9989"

        if url in (None, ''):
            url = "https://raw.githubusercontent.com/zfsonlinux/zfs-buildbot/master/scripts/" 

        if password is None:
            password = ZFSEC2Slave.pass_generator()

        if user_data is None:
            user_data = ZFSEC2Slave.default_user_data % (bin_path, master, name, password, mode, url)

        EC2LatentBuildSlave.__init__(
            self, name=name, password=password, instance_type=instance_type, 
            identifier=identifier, secret_identifier=secret_identifier, region=region,
            user_data=user_data, keypair_name=keypair_name, security_name=security_name,
            max_builds=max_builds, spot_instance=spot_instance, tags=tags,
            max_spot_price=max_spot_price, placement=placement,
            price_multiplier=price_multiplier, build_wait_timeout=build_wait_timeout, 
            missing_timeout=missing_timeout, **kwargs)
Esempio n. 4
0
    def __init__(self, name, password=None, master='', url='', mode="BUILD",
                instance_type="m3.large", identifier=ec2_default_access,
                secret_identifier=ec2_default_secret,
                keypair_name=ec2_default_keypair_name, security_name='ZFSBuilder',
                user_data=None, region="us-west-2", placement=None, max_builds=1, 
                build_wait_timeout=100 * 60, spot_instance=True, max_spot_price=.08,
                price_multiplier=1.25, missing_timeout=60 * 20, **kwargs):

        self.name = name
        bin_path = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

        tags = kwargs.get('tags')
        if not tags or tags is None:
            tags={
                "ENV"      : "DEV",
                "Name"     : "ZFSBuilder",
                "ORG"      : "COMP",
                "OWNER"    : "behlendorf1",
                "PLATFORM" : self.name,
                "PROJECT"  : "ZFS",
            }

        if master in (None, ''):
            master = "build.zfsonlinux.org:9989"

        if url in (None, ''):
            url = "https://raw.githubusercontent.com/zfsonlinux/zfs-buildbot/master/scripts/" 

        if password is None:
            password = ZFSEC2Slave.pass_generator()

        if user_data is None:
            user_data = ZFSEC2Slave.default_user_data % (bin_path, master, name, password, mode, url)

        EC2LatentBuildSlave.__init__(
            self, name=name, password=password, instance_type=instance_type, 
            identifier=identifier, secret_identifier=secret_identifier, region=region,
            user_data=user_data, keypair_name=keypair_name, security_name=security_name,
            max_builds=max_builds, spot_instance=spot_instance, tags=tags,
            max_spot_price=max_spot_price, placement=placement,
            price_multiplier=price_multiplier, build_wait_timeout=build_wait_timeout, 
            missing_timeout=missing_timeout, **kwargs)
 def _soft_disconnect(self, fast=False):
     EC2LatentBuildSlave._soft_disconnect(self, fast)
     self.insubstantiate(fast)
Esempio n. 6
0
    def __init__(self,
                 name,
                 password=None,
                 master='',
                 url='',
                 mode="BUILD",
                 instance_type="c5d.large",
                 identifier=ec2_default_access,
                 secret_identifier=ec2_default_secret,
                 keypair_name=ec2_default_keypair_name,
                 security_name='ZFSBuilder',
                 subnet_id=None,
                 security_group_ids=None,
                 user_data=None,
                 region="us-west-1",
                 placement='a',
                 max_builds=1,
                 build_wait_timeout=60,
                 spot_instance=False,
                 max_spot_price=0.10,
                 price_multiplier=None,
                 missing_timeout=3600 * 12,
                 block_device_map=None,
                 get_image=None,
                 **kwargs):

        self.name = name
        bin_path = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

        tags = kwargs.get('tags')
        if not tags or tags is None:
            tags = {
                "ENV": "DEV",
                "Name": "ZFSBuilder",
                "ORG": "COMP",
                "OWNER": "behlendorf1",
                "PLATFORM": self.name,
                "PROJECT": "ZFS",
            }

        if master in (None, ''):
            master = "build.zfsonlinux.org:9989"

        if url in (None, ''):
            url = "https://raw.githubusercontent.com/openzfs/zfs-buildbot/master/scripts/"

        if password is None:
            password = ZFSEC2Slave.pass_generator()

        if user_data is None:
            user_data = ZFSEC2Slave.default_user_data % (
                bin_path, master, name, password, mode, url)

        if block_device_map is None:
            # io1 is 50 IOPS/GB, iops _must_ be specified for io1 only
            # Cf. https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html
            boot_device_props = {"volume_type": "gp2", "size": 24}

            # Reasonable default values for additional persistent disks, if desired
            persist_device_props = {
                "volume_type": "io1",
                "iops": 400,
                "size": 8
            }

            # The boot device name must exactly match the name in the
            # distribution provided AMI otherwise it will fail to boot.
            if "Amazon" in name or "Kernel.org" in name or "Debian" in name:
                boot_device = "/dev/xvda"
            else:
                boot_device = "/dev/sda1"

            block_device_map = {
                boot_device: boot_device_props,
                "/dev/sdb": {
                    "ephemeral_name": "ephemeral0"
                },
                "/dev/sdc": {
                    "ephemeral_name": "ephemeral1"
                },
                "/dev/sdd": {
                    "ephemeral_name": "ephemeral2"
                },
                "/dev/sde": {
                    "ephemeral_name": "ephemeral3"
                },
                "/dev/sdf": {
                    "ephemeral_name": "ephemeral4"
                },
                "/dev/sdg": {
                    "ephemeral_name": "ephemeral5"
                },
            }

        # get_image can be used to determine an AMI when the slave starts.
        if callable(get_image):
            # Trick EC2LatentBuildSlave input validation by providing a "valid" regex.
            # This won't actually be used because we override get_image().
            kwargs['valid_ami_location_regex'] = ''
            # If we just set `self.get_image = get_image` then self doesn't get passed.
            self.get_image = lambda: get_image(self)

        EC2LatentBuildSlave.__init__(self,
                                     name=name,
                                     password=password,
                                     instance_type=instance_type,
                                     identifier=identifier,
                                     secret_identifier=secret_identifier,
                                     region=region,
                                     user_data=user_data,
                                     keypair_name=keypair_name,
                                     security_name=security_name,
                                     subnet_id=subnet_id,
                                     security_group_ids=security_group_ids,
                                     max_builds=max_builds,
                                     spot_instance=spot_instance,
                                     tags=tags,
                                     max_spot_price=max_spot_price,
                                     price_multiplier=price_multiplier,
                                     build_wait_timeout=build_wait_timeout,
                                     missing_timeout=missing_timeout,
                                     placement=placement,
                                     block_device_map=block_device_map,
                                     **kwargs)
Esempio n. 7
0
# The 'slaves' list defines the set of recognized buildslaves. Each element is
# a BuildSlave object, specifying a unique slave name and password.  The same
# slave name and password must be configured on the slave.
from buildbot.buildslave import BuildSlave
from buildbot.buildslave.ec2 import EC2LatentBuildSlave

# using simplejson instead of json since Twisted wants ascii instead of unicode
import simplejson as json

slaves = []

# Load slaves from external file, see slaves.json.sample
for slave in json.load(open("slaves.json")):
    if 'latentslave' in slave['name']:
        slaves.append(
            EC2LatentBuildSlave(slave['name'],
                                slave['password'],
                                'c4.large',
                                max_builds=1,
                                ami='ami-ec6c7186',
                                region='us-east-1',
                                placement='e',
                                user_data='{"SLAVENAME": "%s"}' %
                                slave['name'],
                                spot_instance=True,
                                max_spot_price=0.05,
                                price_multiplier=1.15))
    else:
        slaves.append(BuildSlave(slave['name'], slave['password']))