Skip to content

Commit

Permalink
Merge branch 'integration'
Browse files Browse the repository at this point in the history
* integration:
  Add eu-central-1c zone #252
  Added master branch status from Travis
  Add GovCloud region and ap-northeast-2c AZ.
  Added ICE_HOME environment variable + Disabled tests
  Run the grails tests in the Travis CI flow
  Added travis ci file
  • Loading branch information
NitriKx committed Jul 4, 2017
2 parents 717e3af + 782856d commit e8afb5b
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
6 changes: 6 additions & 0 deletions src/java/com/netflix/ice/basic/BasicReservationService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
3 changes: 3 additions & 0 deletions src/java/com/netflix/ice/tag/Region.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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);
Expand All @@ -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);
Expand Down
12 changes: 11 additions & 1 deletion src/java/com/netflix/ice/tag/Zone.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
Expand All @@ -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");
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -176,4 +186,4 @@ public static List<Zone> getZones(List<String> names) {
result.add(zonesByName.get(name));
return result;
}
}
}

0 comments on commit e8afb5b

Please sign in to comment.