Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding the T2 class of burstable instances #610

Open
wants to merge 5 commits into
base: master
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 grails-app/conf/BuildConfig.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ grails.project.dependency.resolution = {

compile(
// Amazon Web Services programmatic interface. Transitive dependency of glisten, but also used directly.
'com.amazonaws:aws-java-sdk:1.7.5',
'com.amazonaws:aws-java-sdk:1.8.3',

// Enables publication of a health check URL for deploying Asgard, and an on/off switch for activities.
// Transitive dependencies include:
Expand Down
11 changes: 11 additions & 0 deletions grails-app/services/com/netflix/asgard/InstanceTypeService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,31 @@ class InstanceTypeService implements CacheInitializer {
String memOpt = 'Memory optimized'
String hiMem = 'High-Memory'
String compOpt = 'Compute optimized'
String bInst = 'Burstable Performance Instances'
String six4 = '64-bit'
String three2OrSix4 = '32-bit or 64-bit'
String hcpu = 'High-CPU'
[
new HardwareProfile(instanceType: 't1.micro', family: 'Micro instances', group: 'Micro', size: 'Micro',
arch: three2OrSix4, vCpu: '1', ecu: 'Variable', mem: '0.615', storage: 'EBS only',
ebsOptim: '-', netPerf: 'Very Low'),
new HardwareProfile(instanceType: 't2.micro', family: bInst, group: gen, size: 'Micro',
arch: three2OrSix4, vCpu: '1', ecu: 'Variable', mem: '1', storage: 'EBS only',
ebsOptim: '-', netPerf: 'Low to Moderate'),

new HardwareProfile(instanceType: 'm1.small', family: gen, group: 'Standard', size: 'Small (Default)',
arch: three2OrSix4, vCpu: '1', ecu: '1', mem: '1.7', storage: '1 x 160', ebsOptim: '-',
netPerf: 'Low'),
new HardwareProfile(instanceType: 't2.small', family: bInst, group: gen, size: 'Small',
arch: three2OrSix4, vCpu: '1', ecu: '1', mem: '2', storage: 'EBS only', ebsOptim: '-',
netPerf: 'Low to Moderate'),

new HardwareProfile(instanceType: 'm1.medium', family: gen, group: 'Standard', size: 'Medium',
arch: three2OrSix4, vCpu: '1', ecu: '2', mem: '3.75', storage: '1 x 410', ebsOptim: '-',
netPerf: 'Moderate'),
new HardwareProfile(instanceType: 't2.medium', family: bInst, group: gen, size: 'Medium',
arch: three2OrSix4, vCpu: '2', ecu: '2', mem: '4', storage: 'EBS only', ebsOptim: '-',
netPerf: 'Low to Moderate'),

new HardwareProfile(instanceType: 'm1.large', family: gen, group: 'Standard', size: 'Large', arch: six4,
vCpu: '2', ecu: '4', mem: '7.5', storage: '2 x 420', ebsOptim: 'Yes', netPerf: 'Moderate'),
Expand Down
3 changes: 3 additions & 0 deletions src/groovy/com/netflix/asgard/model/InstanceType.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ enum InstanceType {
T1Micro("t1.micro"),
M1Small("m1.small"),
M1Medium("m1.medium"),
T2Micro("t2.micro"),
T2Small("t2.small"),
T2Medium("t2.medium"),
M1Large("m1.large"),
M1Xlarge("m1.xlarge"),
M3Medium("m3.medium"),
Expand Down
47 changes: 41 additions & 6 deletions test/unit/com/netflix/asgard/AutoScalingControllerSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,47 @@ class AutoScalingControllerSpec extends Specification {
['akms', 'helloworld', 'helloworld-frontend', 'helloworld-asgardtest', 'helloworld-tmp', 'ntsuiboot'])

//note: attrs['instanceTypes'] is sorted by price - cheapest to most expensive
attrs['instanceTypes'][0].getMonthlyLinuxOnDemandPrice() == '$50.40'
['m3.medium', 'c3.large', 'm3.large', 'r3.large', 'c3.xlarge', 'm3.xlarge', 'r3.xlarge',
'c3.2xlarge', 'm3.2xlarge', 'r3.2xlarge', 'c3.4xlarge', 'i2.xlarge', 'r3.4xlarge', 'c3.8xlarge', 'i2.2xlarge',
'r3.8xlarge', 'i2.4xlarge', 'hs1.8xlarge', 'i2.8xlarge', 'huge.mainframe', 'c1.medium', 'c1.xlarge',
'cc1.4xlarge', 'cc2.8xlarge', 'cg1.4xlarge', 'cr1.8xlarge', 'g2.2xlarge', 'hi1.4xlarge', 'm1.large',
'm1.medium', 'm1.small', 'm1.xlarge', 'm2.2xlarge', 'm2.4xlarge', 'm2.xlarge', 't1.micro'
attrs['instanceTypes'][0].getMonthlyLinuxOnDemandPrice() == '$9.36'
[
't2.micro',
't1.micro',
't2.small',
'm1.small',
't2.medium',
'm3.medium',
'c3.large',
'm3.large',
'r3.large',
'c3.xlarge',
'm3.xlarge',
'r3.xlarge',
'c3.2xlarge',
'm3.2xlarge',
'r3.2xlarge',
'c3.4xlarge',
'i2.xlarge',
'r3.4xlarge',
'c3.8xlarge',
'i2.2xlarge',
'r3.8xlarge',
'i2.4xlarge',
'hs1.8xlarge',
'i2.8xlarge',
'huge.mainframe',
'c1.medium',
'c1.xlarge',
'cc1.4xlarge',
'cc2.8xlarge',
'cg1.4xlarge',
'cr1.8xlarge',
'g2.2xlarge',
'hi1.4xlarge',
'm1.large',
'm1.medium',
'm1.xlarge',
'm2.2xlarge',
'm2.4xlarge',
'm2.xlarge'
] == attrs['instanceTypes']*.name
}

Expand Down
7 changes: 3 additions & 4 deletions test/unit/com/netflix/asgard/EmailerServiceUnitSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,9 @@ java.io.IOException: Unable to reach Internet due to comet
Exception grailsException = new GrailsRuntimeException('Something went wrong', deleteConflictException)
String expectedSubject = "Trouble: HalService HalKnowsBest DeleteConflictException"
String expectedBodyStart = """You tried to terminate HAL, yet he lives
com.amazonaws.services.identitymanagement.model.DeleteConflictException: Status Code: 403, AWS Service: HalService, \
AWS Request ID: deadbeef, AWS Error Code: HalKnowsBest, \
AWS Error Message: I'm sorry, Dave. I'm afraid I can't do that.
\tat"""
com.amazonaws.services.identitymanagement.model.DeleteConflictException: I'm sorry, Dave. I'm afraid I can't do that. \
(Service: HalService; Status Code: 403; \
Error Code: HalKnowsBest; Request ID: deadbeef)"""

when:
String body = emailerService.sendExceptionEmail('You tried to terminate HAL, yet he lives', grailsException)
Expand Down
12 changes: 6 additions & 6 deletions test/unit/com/netflix/asgard/HostedZoneControllerSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ class HostedZoneControllerSpec extends Specification {
e.statusCode = 503
throw e
}
controller.flash.message == 'Status Code: 503, AWS Service: Route53, AWS Request ID: BOOGIEBOOGIE, ' +
'AWS Error Code: DontLikeYou, AWS Error Message: Sorry, pal.'
controller.flash.message == 'Sorry, pal. (Service: Route53; Status Code: 503; ' +
'Error Code: DontLikeYou; Request ID: BOOGIEBOOGIE)'
response.redirectUrl == '/hostedZone/create?name=test.example.com'
0 * _
}
Expand Down Expand Up @@ -195,8 +195,8 @@ class HostedZoneControllerSpec extends Specification {
}
controller.flash.message == 'Could not add resource record set: ' +
'com.amazonaws.services.route53.model.InvalidInputException: ' +
'Status Code: 503, AWS Service: Route53, AWS Request ID: BOOGIEBOOGIE, ' +
'AWS Error Code: DontLikeYou, AWS Error Message: Sorry, pal.'
'Sorry, pal. (Service: Route53; Status Code: 503; Error Code: DontLikeYou; ' +
'Request ID: BOOGIEBOOGIE)'
response.redirectUrl ==
'/hostedZone/prepareResourceRecordSet?hostedZoneId=ZATANNA&resourceRecordSetName=plain.example.com.'
0 * _
Expand Down Expand Up @@ -256,8 +256,8 @@ class HostedZoneControllerSpec extends Specification {
}
controller.flash.message == 'Could not delete resource record set: ' +
'com.amazonaws.services.route53.model.InvalidInputException: ' +
'Status Code: 503, AWS Service: Route53, AWS Request ID: BOOGIEBOOGIE, ' +
'AWS Error Code: DontLikeYou, AWS Error Message: Sorry, pal.'
'Sorry, pal. (Service: Route53; Status Code: 503; ' +
'Error Code: DontLikeYou; Request ID: BOOGIEBOOGIE)'
response.redirectUrl == '/hostedZone/show/ZATANNA'
0 * _
noExceptionThrown()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class InstanceTypeServiceSpec extends Specification {
'i2.4xlarge', 'i2.8xlarge', 'i2.xlarge', 'm1.large', 'm1.medium', 'm1.small', 'm1.xlarge', 'm2.2xlarge',
'm2.4xlarge', 'm2.xlarge', 'm3.2xlarge', 'm3.large', 'm3.medium', 'm3.xlarge', 'r3.2xlarge',
'r3.4xlarge', 'r3.8xlarge', 'r3.large', 'r3.xlarge', 'superduper.4xlarge',
't1.micro'] == instanceTypes*.name.sort()
't1.micro', 't2.medium', 't2.micro', 't2.small'] == instanceTypes*.name.sort()
//each list contains mostly nulls
def allSizes = instanceTypes*.hardwareProfile*.size
allSizes.removeAll { it == null }
Expand Down