-
Notifications
You must be signed in to change notification settings - Fork 36
/
slaves.py
33 lines (28 loc) · 1.1 KB
/
slaves.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ###### BUILDSLAVES
# 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']))