diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..ac383008 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,14 @@ +sudo: false + +language: groovy + +jdk: +- oraclejdk7 + +install: + - export ICE_HOME=${TRAVIS_BUILD_DIR} + - ./grailsw clean + - yes | ./grailsw refresh-dependencies + +script: + - ./grailsw compile \ No newline at end of file diff --git a/README.md b/README.md index d4f67930..9b379e61 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +# Ice +[![Build Status](https://travis-ci.org/Teevity/ice.svg?branch=master)](https://travis-ci.org/Teevity/ice) + ## Intro Ice provides a birds-eye view of our large and complex cloud landscape from a usage and cost perspective. Cloud resources are dynamically provisioned by dozens of service teams within the organization and any static snapshot of resource allocation has limited value. The ability to trend usage patterns on a global scale, yet decompose them down to a region, availability zone, or service team provides incredible flexibility. Ice allows us to quantify our AWS footprint and to make educated decisions regarding reservation purchases and reallocation of resources. diff --git a/src/java/com/netflix/ice/basic/BasicReservationService.java b/src/java/com/netflix/ice/basic/BasicReservationService.java index c6fecaf0..54f828a5 100644 --- a/src/java/com/netflix/ice/basic/BasicReservationService.java +++ b/src/java/com/netflix/ice/basic/BasicReservationService.java @@ -145,6 +145,12 @@ private void pollAPI() throws Exception { AmazonEC2Client ec2Client = new AmazonEC2Client(AwsUtils.awsCredentialsProvider, AwsUtils.clientConfig); for (Region region: Region.getAllRegions()) { + // GovCloud uses different credentials than standard AWS, so you would need two separate + // sets of credentials if you wanted to poll for RIs in both environments. For now, we + // just ignore GovCloud here in order to prevent AuthFailure errors. + if (region == Region.US_GOV_WEST_1) { + continue; + } ec2Client.setEndpoint("ec2." + region.name + ".amazonaws.com"); do { if (!StringUtils.isEmpty(token)) diff --git a/src/java/com/netflix/ice/processor/ReservationCapacityPoller.java b/src/java/com/netflix/ice/processor/ReservationCapacityPoller.java index 8ab163b8..f07968f0 100644 --- a/src/java/com/netflix/ice/processor/ReservationCapacityPoller.java +++ b/src/java/com/netflix/ice/processor/ReservationCapacityPoller.java @@ -139,6 +139,12 @@ public String getSessionToken() { ec2Client = new AmazonEC2Client(AwsUtils.awsCredentialsProvider.getCredentials(), AwsUtils.clientConfig); for (Region region: Region.getAllRegions()) { + // GovCloud uses different credentials than standard AWS, so you would need two separate + // sets of credentials if you wanted to poll for RIs in both environments. For now, we + // just ignore GovCloud when polling for RIs in order to prevent AuthFailure errors. + if (region == Region.US_GOV_WEST_1) { + continue; + } ec2Client.setEndpoint("ec2." + region.name + ".amazonaws.com"); diff --git a/src/java/com/netflix/ice/tag/Region.java b/src/java/com/netflix/ice/tag/Region.java index 04c7ae43..861a96d2 100644 --- a/src/java/com/netflix/ice/tag/Region.java +++ b/src/java/com/netflix/ice/tag/Region.java @@ -29,6 +29,7 @@ public class Region extends Tag { public static final Region US_EAST_2 = new Region("us-east-2", "USE2"); public static final Region US_WEST_1 = new Region("us-west-1", "USW1"); public static final Region US_WEST_2 = new Region("us-west-2", "USW2"); + public static final Region US_GOV_WEST_1 = new Region("us-gov-west-1", "UGW1"); public static final Region EU_WEST_1 = new Region("eu-west-1", "EU"); public static final Region EU_WEST_2 = new Region("eu-west-2", "EUW2"); public static final Region EU_CENTRAL_1 = new Region("eu-central-1", "EUC1"); @@ -48,6 +49,7 @@ public class Region extends Tag { regionsByShortName.put(US_EAST_2.shortName, US_EAST_2); regionsByShortName.put(US_WEST_1.shortName, US_WEST_1); regionsByShortName.put(US_WEST_2.shortName, US_WEST_2); + regionsByShortName.put(US_GOV_WEST_1.shortName, US_GOV_WEST_1); regionsByShortName.put(EU_WEST_1.shortName, EU_WEST_1); regionsByShortName.put(EU_WEST_2.shortName, EU_WEST_2); regionsByShortName.put(EU_CENTRAL_1.shortName, EU_CENTRAL_1); @@ -63,6 +65,7 @@ public class Region extends Tag { regionsByName.put(US_EAST_2.name, US_EAST_2); regionsByName.put(US_WEST_1.name, US_WEST_1); regionsByName.put(US_WEST_2.name, US_WEST_2); + regionsByName.put(US_GOV_WEST_1.name, US_GOV_WEST_1); regionsByName.put(EU_WEST_1.name, EU_WEST_1); regionsByName.put(EU_WEST_2.name, EU_WEST_2); regionsByName.put(EU_CENTRAL_1.name, EU_CENTRAL_1); diff --git a/src/java/com/netflix/ice/tag/Zone.java b/src/java/com/netflix/ice/tag/Zone.java index df506da0..aa90ffa6 100644 --- a/src/java/com/netflix/ice/tag/Zone.java +++ b/src/java/com/netflix/ice/tag/Zone.java @@ -52,6 +52,9 @@ private Zone (Region region, String name) { public static final Zone US_WEST_2B = new Zone(Region.US_WEST_2, "us-west-2b"); public static final Zone US_WEST_2C = new Zone(Region.US_WEST_2, "us-west-2c"); + public static final Zone US_GOV_WEST_1A = new Zone(Region.US_GOV_WEST_1, "us-gov-west-1a"); + public static final Zone US_GOV_WEST_1B = new Zone(Region.US_GOV_WEST_1, "us-gov-west-1b"); + public static final Zone EU_WEST_1A = new Zone(Region.EU_WEST_1, "eu-west-1a"); public static final Zone EU_WEST_1B = new Zone(Region.EU_WEST_1, "eu-west-1b"); public static final Zone EU_WEST_1C = new Zone(Region.EU_WEST_1, "eu-west-1c"); @@ -61,6 +64,7 @@ private Zone (Region region, String name) { public static final Zone EU_CENTRAL_1A = new Zone(Region.EU_CENTRAL_1, "eu-central-1a"); public static final Zone EU_CENTRAL_1B = new Zone(Region.EU_CENTRAL_1, "eu-central-1b"); + public static final Zone EU_CENTRAL_1C = new Zone(Region.EU_CENTRAL_1, "eu-central-1c"); public static final Zone SA_EAST_1A = new Zone(Region.SA_EAST_1, "sa-east-1a"); public static final Zone SA_EAST_1B = new Zone(Region.SA_EAST_1, "sa-east-1b"); @@ -72,6 +76,7 @@ private Zone (Region region, String name) { public static final Zone AP_NORTHEAST_2A = new Zone(Region.AP_NORTHEAST_2, "ap-northeast-2a"); public static final Zone AP_NORTHEAST_2B = new Zone(Region.AP_NORTHEAST_2, "ap-northeast-2b"); + public static final Zone AP_NORTHEAST_2C = new Zone(Region.AP_NORTHEAST_2, "ap-northeast-2c"); public static final Zone AP_SOUTHEAST_1A = new Zone(Region.AP_SOUTHEAST_1, "ap-southeast-1a"); public static final Zone AP_SOUTHEAST_1B = new Zone(Region.AP_SOUTHEAST_1, "ap-southeast-1b"); @@ -108,6 +113,9 @@ private Zone (Region region, String name) { zonesByName.put(US_WEST_2B.name, US_WEST_2B); zonesByName.put(US_WEST_2C.name, US_WEST_2C); + zonesByName.put(US_GOV_WEST_1A.name, US_GOV_WEST_1A); + zonesByName.put(US_GOV_WEST_1B.name, US_GOV_WEST_1B); + zonesByName.put(EU_WEST_1A.name, EU_WEST_1A); zonesByName.put(EU_WEST_1B.name, EU_WEST_1B); zonesByName.put(EU_WEST_1C.name, EU_WEST_1C); @@ -117,6 +125,7 @@ private Zone (Region region, String name) { zonesByName.put(EU_CENTRAL_1A.name, EU_CENTRAL_1A); zonesByName.put(EU_CENTRAL_1B.name, EU_CENTRAL_1B); + zonesByName.put(EU_CENTRAL_1C.name, EU_CENTRAL_1C); zonesByName.put(SA_EAST_1A.name, SA_EAST_1A); zonesByName.put(SA_EAST_1B.name, SA_EAST_1B); @@ -128,6 +137,7 @@ private Zone (Region region, String name) { zonesByName.put(AP_NORTHEAST_2A.name, AP_NORTHEAST_2A); zonesByName.put(AP_NORTHEAST_2B.name, AP_NORTHEAST_2B); + zonesByName.put(AP_NORTHEAST_2C.name, AP_NORTHEAST_2C); zonesByName.put(AP_SOUTHEAST_1A.name, AP_SOUTHEAST_1A); zonesByName.put(AP_SOUTHEAST_1B.name, AP_SOUTHEAST_1B); @@ -176,4 +186,4 @@ public static List getZones(List names) { result.add(zonesByName.get(name)); return result; } -} \ No newline at end of file +}