From a7a35d1d7a32f1e9fbd1927ad37c964383468d2b Mon Sep 17 00:00:00 2001 From: Sungju Jin Date: Mon, 3 Aug 2015 10:58:07 +0900 Subject: [PATCH 01/16] Upgrade to Grails 2.4.4 --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 0e18411f..818aac8e 100755 --- a/install.sh +++ b/install.sh @@ -2,7 +2,7 @@ # Get Ice in a ready-to-run state on a fresh AWI instance. -GRAILS_VERSION=2.2.1 +GRAILS_VERSION=2.4.4 # Install prerequisites From 0c21b05b68cfb53433dc02d6c75d0263a7a960ed Mon Sep 17 00:00:00 2001 From: AMeng Date: Tue, 25 Aug 2015 15:53:09 -0600 Subject: [PATCH 02/16] Parse services with '/'. Fixes #100 --- .../netflix/ice/basic/BasicDataManager.java | 2 +- .../com/netflix/ice/basic/BasicManagers.java | 2 ++ .../ice/basic/BasicTagGroupManager.java | 2 +- .../ice/processor/BillingFileProcessor.java | 5 ++--- .../com/netflix/ice/processor/DataWriter.java | 3 ++- .../netflix/ice/processor/TagGroupWriter.java | 3 ++- src/java/com/netflix/ice/tag/Tag.java | 18 ++++++++++++++++++ 7 files changed, 28 insertions(+), 7 deletions(-) diff --git a/src/java/com/netflix/ice/basic/BasicDataManager.java b/src/java/com/netflix/ice/basic/BasicDataManager.java index b0ae1b0b..3882e163 100644 --- a/src/java/com/netflix/ice/basic/BasicDataManager.java +++ b/src/java/com/netflix/ice/basic/BasicDataManager.java @@ -65,7 +65,7 @@ public ReadOnlyData load(DateTime monthDate) throws Exception { public BasicDataManager(Product product, ConsolidateType consolidateType, boolean isCost) { this.product = product; this.consolidateType = consolidateType; - this.dbName = (isCost ? "cost_" : "usage_") + consolidateType + "_" + (product == null ? "all" : product.name); + this.dbName = (isCost ? "cost_" : "usage_") + consolidateType + "_" + (product == null ? "all" : product.s3Name); start(300); } diff --git a/src/java/com/netflix/ice/basic/BasicManagers.java b/src/java/com/netflix/ice/basic/BasicManagers.java index c74b6728..33968a64 100644 --- a/src/java/com/netflix/ice/basic/BasicManagers.java +++ b/src/java/com/netflix/ice/basic/BasicManagers.java @@ -25,6 +25,7 @@ import com.netflix.ice.processor.TagGroupWriter; import com.netflix.ice.reader.*; import com.netflix.ice.tag.Product; +import com.netflix.ice.tag.Tag; import java.util.Collection; import java.util.Map; @@ -99,6 +100,7 @@ private void doWork() { } else { String name = key.substring((config.workS3BucketPrefix + TagGroupWriter.DB_PREFIX).length()); + name = Tag.fromS3(name); product = config.productService.getProductByName(name); } if (!products.contains(product)) { diff --git a/src/java/com/netflix/ice/basic/BasicTagGroupManager.java b/src/java/com/netflix/ice/basic/BasicTagGroupManager.java index d3630e7e..5ef12379 100644 --- a/src/java/com/netflix/ice/basic/BasicTagGroupManager.java +++ b/src/java/com/netflix/ice/basic/BasicTagGroupManager.java @@ -48,7 +48,7 @@ public class BasicTagGroupManager extends Poller implements TagGroupManager { private Interval totalInterval; BasicTagGroupManager(Product product) { - this.dbName = TagGroupWriter.DB_PREFIX + (product == null ? "all" : product.name); + this.dbName = TagGroupWriter.DB_PREFIX + (product == null ? "all" : product.s3Name); file = new File(config.localDir, dbName); try { poll(); diff --git a/src/java/com/netflix/ice/processor/BillingFileProcessor.java b/src/java/com/netflix/ice/processor/BillingFileProcessor.java index d8bd990c..45b2b9a4 100644 --- a/src/java/com/netflix/ice/processor/BillingFileProcessor.java +++ b/src/java/com/netflix/ice/processor/BillingFileProcessor.java @@ -428,7 +428,7 @@ private void archive() throws Exception { private void archiveHourly(Map dataMap, String prefix) throws Exception { DateTime monthDateTime = new DateTime(startMilli, DateTimeZone.UTC); for (Product product: dataMap.keySet()) { - String prodName = product == null ? "all" : product.name; + String prodName = product == null ? "all" : product.s3Name; DataWriter writer = new DataWriter(prefix + "hourly_" + prodName + "_" + AwsUtils.monthDateFormat.print(monthDateTime), false); writer.archive(dataMap.get(product)); } @@ -447,7 +447,7 @@ private void archiveSummary(Map dataMap, String prefix) for (Product product: dataMap.keySet()) { - String prodName = product == null ? "all" : product.name; + String prodName = product == null ? "all" : product.s3Name; ReadWriteData data = dataMap.get(product); Collection tagGroups = data.getTagGroups(); @@ -755,4 +755,3 @@ private class BillingFile { } } } - diff --git a/src/java/com/netflix/ice/processor/DataWriter.java b/src/java/com/netflix/ice/processor/DataWriter.java index 875843d8..39b62bf4 100644 --- a/src/java/com/netflix/ice/processor/DataWriter.java +++ b/src/java/com/netflix/ice/processor/DataWriter.java @@ -19,6 +19,7 @@ import com.netflix.ice.common.AwsUtils; import com.netflix.ice.common.TagGroup; +import com.netflix.ice.tag.Tag; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -38,6 +39,7 @@ public class DataWriter { DataWriter(String name, boolean loadData) throws Exception { + name = Tag.toS3(name); dbName = name; file = new File(config.localDir, dbName); if (loadData) { @@ -81,4 +83,3 @@ void archive(ReadWriteData data) throws IOException { logger.info(this.dbName + " uploading done."); } } - diff --git a/src/java/com/netflix/ice/processor/TagGroupWriter.java b/src/java/com/netflix/ice/processor/TagGroupWriter.java index 35d8a6ef..41802c01 100644 --- a/src/java/com/netflix/ice/processor/TagGroupWriter.java +++ b/src/java/com/netflix/ice/processor/TagGroupWriter.java @@ -20,6 +20,7 @@ import com.google.common.collect.Maps; import com.netflix.ice.common.AwsUtils; import com.netflix.ice.common.TagGroup; +import com.netflix.ice.tag.Tag; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -38,6 +39,7 @@ public class TagGroupWriter { TagGroupWriter(String name) throws Exception { + name = Tag.toS3(name); dbName = DB_PREFIX + name; file = new File(config.localDir, dbName); logger.info("creating TagGroupWriter for " + file); @@ -74,4 +76,3 @@ void archive(Long monthMilli,Collection tagGroups) throws IOException logger.info(dbName + " uploading done."); } } - diff --git a/src/java/com/netflix/ice/tag/Tag.java b/src/java/com/netflix/ice/tag/Tag.java index b2fe9330..4973ceb6 100644 --- a/src/java/com/netflix/ice/tag/Tag.java +++ b/src/java/com/netflix/ice/tag/Tag.java @@ -28,8 +28,10 @@ public int compareTo(Tag t) { }; public final String name; + public final String s3Name; Tag(String name) { this.name = name; + this.s3Name = Tag.toS3(name); } @Override @@ -40,6 +42,22 @@ public boolean equals(Object o) { return false; } + /** + * Normalize a tagname suitable to be an S3 Filename + */ + public static String toS3(String name) { + name = name.replaceAll("/","--"); + return name; + } + + /** + * Normalize a tagname from an S3 Filename + */ + public static String fromS3(String name) { + name = name.replaceAll("--","/"); + return name; + } + @Override public String toString() { return this.name; From 2f94555f42817153dda5ca504954ce71c8850f2e Mon Sep 17 00:00:00 2001 From: Eric Liang Date: Tue, 8 Sep 2015 21:09:49 -0700 Subject: [PATCH 03/16] Continue grouping resources even if ResourceId is missing --- src/java/com/netflix/ice/basic/BasicLineItemProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/java/com/netflix/ice/basic/BasicLineItemProcessor.java b/src/java/com/netflix/ice/basic/BasicLineItemProcessor.java index dbb1ffb8..616dc90b 100644 --- a/src/java/com/netflix/ice/basic/BasicLineItemProcessor.java +++ b/src/java/com/netflix/ice/basic/BasicLineItemProcessor.java @@ -204,7 +204,7 @@ else if (result == Result.monthly) { } double resourceCostValue = costValue; - if (items.length > resourceIndex && !StringUtils.isEmpty(items[resourceIndex]) && config.resourceService != null) { + if (items.length > resourceIndex && config.resourceService != null) { if (config.useCostForResourceGroup.equals("modeled") && product == Product.ec2_instance) operation = Operation.getReservedInstances(config.reservationService.getDefaultReservationUtilization(0L)); From 3926e4fb7350d1d1475cff0260b78fcc8328fb77 Mon Sep 17 00:00:00 2001 From: Vasily Vasilkov Date: Mon, 2 Nov 2015 11:43:12 +0300 Subject: [PATCH 04/16] Highstock CDN supports HTTPS now, let's use it by default --- README.md | 2 +- src/java/com/netflix/ice/common/IceOptions.java | 3 +-- src/java/com/netflix/ice/reader/ReaderConfig.java | 2 +- src/java/sample.properties | 4 ++-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1118dd5a..fc0352cb 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,7 @@ Using basic setup, you don't need any extra code change and you will use the pro # Specify your currency conversion rate here. The default value is 1. If 1 pound = 1.5 dollar, then the rate is 0.6666667. ice.currencyRate=0.6666667 - 2.8 By default, Ice pulls in [Highstock](http://www.highcharts.com/) from its CDN. This CDN, unfortunately, does not (at present) support HTTPS. If you're serving Ice over HTTPS, your browser shouldn't or won't download Highstock from there. To fix this, you can serve Highstock somewhere else, and set this property: + 2.8 By default, Ice pulls in [Highstock](https://www.highcharts.com/) from its CDN. ice.highstockUrl=https://example.com/js/highstock.js diff --git a/src/java/com/netflix/ice/common/IceOptions.java b/src/java/com/netflix/ice/common/IceOptions.java index e78077c1..cc943c8e 100644 --- a/src/java/com/netflix/ice/common/IceOptions.java +++ b/src/java/com/netflix/ice/common/IceOptions.java @@ -40,8 +40,7 @@ public class IceOptions { public static final String CURRENCY_RATE = "ice.currencyRate"; /** - * The URL of highstock.js. The default value is the Highcharts CDN; change this if you need to - * serve it from somewhere else (for example, if you need HTTPS). + * The URL of highstock.js. The default value is the Highcharts CDN (HTTPS) */ public static final String HIGHSTOCK_URL = "ice.highstockUrl"; diff --git a/src/java/com/netflix/ice/reader/ReaderConfig.java b/src/java/com/netflix/ice/reader/ReaderConfig.java index 4c08af76..388c8cff 100644 --- a/src/java/com/netflix/ice/reader/ReaderConfig.java +++ b/src/java/com/netflix/ice/reader/ReaderConfig.java @@ -73,7 +73,7 @@ public ReaderConfig( companyName = properties.getProperty(IceOptions.COMPANY_NAME, ""); currencySign = properties.getProperty(IceOptions.CURRENCY_SIGN, "$"); currencyRate = Double.parseDouble(properties.getProperty(IceOptions.CURRENCY_RATE, "1")); - highstockUrl = properties.getProperty(IceOptions.HIGHSTOCK_URL, "http://code.highcharts.com/stock/highstock.js"); + highstockUrl = properties.getProperty(IceOptions.HIGHSTOCK_URL, "https://code.highcharts.com/stock/highstock.js"); this.managers = managers; this.applicationGroupService = applicationGroupService; diff --git a/src/java/sample.properties b/src/java/sample.properties index 09c96bd7..b2963ba6 100644 --- a/src/java/sample.properties +++ b/src/java/sample.properties @@ -13,8 +13,8 @@ ice.reservationPeriod=threeyear # default reservation utilization, possible values are LIGHT, MEDIUM, HEAVY. If you have both (LIGHT or MEDIUM) and HEAVY RIs, make sure you do not put HEAVY here. ice.reservationUtilization=MEDIUM -# the highstock url; host it somewhere else and change this if you need HTTPS -ice.highstockUrl=http://code.highcharts.com/stock/highstock.js +# the highstock url +ice.highstockUrl=https://code.highcharts.com/stock/highstock.js # url prefix, e.g. http://ice.netflix.com/. Will be used in alert emails. ice.urlPrefix= From 5b5a16d0d4bd2bec8ba9f2f28be6316e434c1128 Mon Sep 17 00:00:00 2001 From: Justin Matthew Roberts Date: Wed, 24 Feb 2016 22:24:52 -0500 Subject: [PATCH 05/16] minor fixes - changed grails version - fixed install if statement - changed to java 7 - fixed sed statement from not creating ice.propertiese file --- install.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 0e18411f..7d3196cd 100755 --- a/install.sh +++ b/install.sh @@ -2,17 +2,19 @@ # Get Ice in a ready-to-run state on a fresh AWI instance. -GRAILS_VERSION=2.2.1 +GRAILS_VERSION=2.4.4 # Install prerequisites if [ -f /etc/redhat-release ]; then echo "Installing redhat packages" - sudo yum -y install git java-1.6.0-openjdk-devel.x86_64 wget unzip -else - [ -f /etc/debian-release ]; + sudo yum -y install git java-1.7.0-openjdk-devel.x86_64 wget unzip +elif [ -f /etc/debian-release ];then echo "Installing debian packages" - sudo apt-get -y install git openjdk-6-jdk wget unzip + sudo apt-get -y install git openjdk-7-jdk wget unzip +else + echo "Assuming AWS AMI, installing packages" + sudo yum -y install git java-1.7.0-openjdk-devel.x86_64 wget unzip fi INSTALL_DIR=$(pwd) @@ -74,7 +76,7 @@ do echo -n "-> " read -r PROCBUCKET done -sed -rie 's/=billing_s3bucketprefix\//=/; s|\/mnt\/|'"${HOME_DIR}"'\/|; s/=work_s3bucketprefix\//=/; s/^ice.account.*//; s/=billing_s3bucketname1/='${BILLBUCKET}'/; s/=work_s3bucketname/='${PROCBUCKET}'/' src/java/ice.properties +sed -ri 's/=billing_s3bucketprefix\//=/; s|\/mnt\/|'"${HOME_DIR}"'\/|; s/=work_s3bucketprefix\//=/; s/^ice.account.*//; s/=billing_s3bucketname1/='${BILLBUCKET}'/; s/=work_s3bucketname/='${PROCBUCKET}'/' src/java/ice.properties echo Ice is now ready to run as a processor. If you want to run the reader, edit: echo ~/ice/src/java/ice.properties From f87f9d5aaeb045dbcc981403e215b3e316999a9e Mon Sep 17 00:00:00 2001 From: Jeff Palmer Date: Mon, 24 Jul 2017 18:39:33 +0000 Subject: [PATCH 06/16] Add us-east-1f support --- src/java/com/netflix/ice/tag/Zone.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/java/com/netflix/ice/tag/Zone.java b/src/java/com/netflix/ice/tag/Zone.java index aa90ffa6..26ee6a8e 100644 --- a/src/java/com/netflix/ice/tag/Zone.java +++ b/src/java/com/netflix/ice/tag/Zone.java @@ -39,6 +39,7 @@ private Zone (Region region, String name) { public static final Zone US_EAST_1C = new Zone(Region.US_EAST_1, "us-east-1c"); public static final Zone US_EAST_1D = new Zone(Region.US_EAST_1, "us-east-1d"); public static final Zone US_EAST_1E = new Zone(Region.US_EAST_1, "us-east-1e"); + public static final Zone US_EAST_1F = new Zone(Region.US_EAST_1, "us-east-1f"); public static final Zone US_EAST_2A = new Zone(Region.US_EAST_2, "us-east-2a"); public static final Zone US_EAST_2B = new Zone(Region.US_EAST_2, "us-east-2b"); @@ -100,6 +101,7 @@ private Zone (Region region, String name) { zonesByName.put(US_EAST_1C.name, US_EAST_1C); zonesByName.put(US_EAST_1D.name, US_EAST_1D); zonesByName.put(US_EAST_1E.name, US_EAST_1E); + zonesByName.put(US_EAST_1F.name, US_EAST_1F); zonesByName.put(US_EAST_2A.name, US_EAST_2A); zonesByName.put(US_EAST_2B.name, US_EAST_2B); From 188f21b91227c7ff783eb08972489e01849bf2fb Mon Sep 17 00:00:00 2001 From: Jonathan Ballet Date: Mon, 31 Jul 2017 20:49:45 +0200 Subject: [PATCH 07/16] Allow extra configuration file In order to override some configuration settings, we can now specify an additional configuration location using the Java system properties ``ice.config.location`` which points to another configuration file location. Otherwise, the only way to set custom configuration parameters is by overriding this while Config.groovy file. --- grails-app/conf/Config.groovy | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/grails-app/conf/Config.groovy b/grails-app/conf/Config.groovy index 518499b7..fe177004 100644 --- a/grails-app/conf/Config.groovy +++ b/grails-app/conf/Config.groovy @@ -17,13 +17,11 @@ // locations to search for config files that get merged into the main config // config files can either be Java properties files or ConfigSlurper scripts -grails.config.locations = [ +grails.config.locations = [] -] - -// if(System.properties["${appName}.config.location"]) { -// grails.config.locations << "file:" + System.properties["${appName}.config.location"] -// } +if(System.properties["${appName}.config.location"]) { + grails.config.locations << "file:" + System.properties["${appName}.config.location"] +} grails.project.groupId = appName // change this to alter the default package name and Maven publishing destination grails.mime.file.extensions = true // enables the parsing of file extensions from URLs into the request format From a9d0344c3cd16eef788f7e40fef9ab075cdd102f Mon Sep 17 00:00:00 2001 From: Jonathan Ballet Date: Tue, 1 Aug 2017 10:53:04 +0200 Subject: [PATCH 08/16] Update README with reference to ice.config.location --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 9b379e61..dfe5fec7 100644 --- a/README.md +++ b/README.md @@ -263,6 +263,12 @@ Options with * require writing your own code. ice.use_blended=true +10. Extra Grails configuration file + + If you need to setup custom Grails settings, you can specify an additional configuration file to be loaded by Grails by setting the ``ice.config.location`` system property to the location of that file. + + See http://docs.grails.org/2.3.7/guide/single.html#configExternalized for more information. + ## Example IAM Permissions Grant the following permissions to either an instance role, or the user running the reports: From e146c28f2b16768b5eb48197acd7c7748874ba98 Mon Sep 17 00:00:00 2001 From: Jonathan Ballet Date: Tue, 1 Aug 2017 18:43:15 +0200 Subject: [PATCH 09/16] Fix Grails version in URL --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dfe5fec7..9197e301 100644 --- a/README.md +++ b/README.md @@ -267,7 +267,7 @@ Options with * require writing your own code. If you need to setup custom Grails settings, you can specify an additional configuration file to be loaded by Grails by setting the ``ice.config.location`` system property to the location of that file. - See http://docs.grails.org/2.3.7/guide/single.html#configExternalized for more information. + See http://docs.grails.org/2.4.4/guide/single.html#configExternalized for more information. ## Example IAM Permissions From d5d1cc36955571ba28237ea04460c75e21fbf80e Mon Sep 17 00:00:00 2001 From: Vishesh Jindal Date: Tue, 1 Aug 2017 11:43:13 +0530 Subject: [PATCH 10/16] Add support for localized billing accounts --- src/java/com/netflix/ice/common/AwsUtils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/java/com/netflix/ice/common/AwsUtils.java b/src/java/com/netflix/ice/common/AwsUtils.java index 2efabd7c..f179a520 100755 --- a/src/java/com/netflix/ice/common/AwsUtils.java +++ b/src/java/com/netflix/ice/common/AwsUtils.java @@ -49,9 +49,9 @@ */ public class AwsUtils { private final static Logger logger = LoggerFactory.getLogger(AwsUtils.class); - private static Pattern billingFileWithTagsPattern = Pattern.compile(".+-aws-billing-detailed-line-items-with-resources-and-tags-(\\d\\d\\d\\d-\\d\\d).csv.zip"); - private static Pattern billingFileWithMonitoringPattern = Pattern.compile(".+-aws-billing-detailed-line-items-with-monitoring-(\\d\\d\\d\\d-\\d\\d).csv"); - private static Pattern billingFilePattern = Pattern.compile(".+-aws-billing-detailed-line-items-(\\d\\d\\d\\d-\\d\\d).csv.zip"); + private static Pattern billingFileWithTagsPattern = Pattern.compile(".+-aws-billing-detailed-line-items-with-resources-and-tags-(?:[A-Z]+-)?(\\d\\d\\d\\d-\\d\\d).csv.zip"); + private static Pattern billingFileWithMonitoringPattern = Pattern.compile(".+-aws-billing-detailed-line-items-with-monitoring-(?:[A-Z]+-)?(\\d\\d\\d\\d-\\d\\d).csv"); + private static Pattern billingFilePattern = Pattern.compile(".+-aws-billing-detailed-line-items-(?:[A-Z]+-)?(\\d\\d\\d\\d-\\d\\d).csv.zip"); public static final DateTimeFormatter monthDateFormat = DateTimeFormat.forPattern("yyyy-MM").withZone(DateTimeZone.UTC); public static final DateTimeFormatter dayDateFormat = DateTimeFormat.forPattern("yyyy-MM-dd").withZone(DateTimeZone.UTC); public static final DateTimeFormatter dateFormatter = DateTimeFormat.forPattern("yyyy-MM-dd HHa").withZone(DateTimeZone.UTC); From dbf8be7689ba4159ddec37ee444788f6f6a96d69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benoi=CC=82t=20Sauve=CC=80re?= Date: Wed, 2 Aug 2017 10:37:20 +0200 Subject: [PATCH 11/16] Fixed OS detection in install.sh --- install.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 7d3196cd..af36574f 100755 --- a/install.sh +++ b/install.sh @@ -5,16 +5,20 @@ GRAILS_VERSION=2.4.4 # Install prerequisites - if [ -f /etc/redhat-release ]; then echo "Installing redhat packages" sudo yum -y install git java-1.7.0-openjdk-devel.x86_64 wget unzip -elif [ -f /etc/debian-release ];then + +elif [[ -f /etc/debian-release || -f /etc/debian_version ]];then echo "Installing debian packages" sudo apt-get -y install git openjdk-7-jdk wget unzip -else + +elif [[ -f /etc/issue && $(grep "Amazon Linux AMI" /etc/issue) ]]; then echo "Assuming AWS AMI, installing packages" sudo yum -y install git java-1.7.0-openjdk-devel.x86_64 wget unzip + +else + echo "Unknown operating system. You may have to install Java 7 manually." fi INSTALL_DIR=$(pwd) From 105552f6c5d17de5beee8c390fced815aa4b8550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benoi=CC=82t=20Sauve=CC=80re?= Date: Wed, 2 Aug 2017 11:30:28 +0200 Subject: [PATCH 12/16] Add a syntax validation on install.sh in the Travis CI testing process --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index ac383008..d0577424 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,4 +11,5 @@ install: - yes | ./grailsw refresh-dependencies script: + - bash -n install.sh - ./grailsw compile \ No newline at end of file From ddb6d32720b349d98ab8de45a621300f1822aca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benoi=CC=82t=20Sauve=CC=80re?= Date: Wed, 2 Aug 2017 11:36:10 +0200 Subject: [PATCH 13/16] Force the install.sh script to exit if an error occur --- install.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install.sh b/install.sh index af36574f..71e92117 100755 --- a/install.sh +++ b/install.sh @@ -1,5 +1,8 @@ #!/bin/bash +# Exit the script if an error occur +set -e + # Get Ice in a ready-to-run state on a fresh AWI instance. GRAILS_VERSION=2.4.4 From 2906656d545acc9ea09c33b40b5abdb9147a0df5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benoi=CC=82t=20Sauve=CC=80re?= Date: Wed, 2 Aug 2017 11:38:40 +0200 Subject: [PATCH 14/16] Do not fail in install.sh if the local work directories already exists --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 71e92117..59681044 100755 --- a/install.sh +++ b/install.sh @@ -65,8 +65,8 @@ grails ${JAVA_OPTS} wrapper rm grails-app/i18n/messages.properties # Create our local work directories (both for processing and reading) -mkdir ${HOME_DIR}/ice_processor -mkdir ${HOME_DIR}/ice_reader +mkdir -p ${HOME_DIR}/ice_processor +mkdir -p ${HOME_DIR}/ice_reader # Set up the config file cp src/java/sample.properties src/java/ice.properties From 120414363f6524622ef6604bab61992d89e86e43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benoi=CC=82t=20Sauve=CC=80re?= Date: Wed, 2 Aug 2017 12:02:18 +0200 Subject: [PATCH 15/16] Do not fail in install.sh if the "message.properties" file has already been deleted --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 59681044..8c2cad14 100755 --- a/install.sh +++ b/install.sh @@ -62,7 +62,7 @@ fi grails ${JAVA_OPTS} wrapper # (Bug: Ice can't deal with this file existing and being empty.) -rm grails-app/i18n/messages.properties +rm -f grails-app/i18n/messages.properties # Create our local work directories (both for processing and reading) mkdir -p ${HOME_DIR}/ice_processor From d075c994fe8cc8d95aa121c1fde2b750e78ebe0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benoi=CC=82t=20Sauve=CC=80re?= Date: Wed, 2 Aug 2017 12:34:28 +0200 Subject: [PATCH 16/16] Fixed the path of the generated ice.properties file in the instructions shown at the end of the install.sh script --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 8c2cad14..223110f4 100755 --- a/install.sh +++ b/install.sh @@ -86,6 +86,6 @@ done sed -ri 's/=billing_s3bucketprefix\//=/; s|\/mnt\/|'"${HOME_DIR}"'\/|; s/=work_s3bucketprefix\//=/; s/^ice.account.*//; s/=billing_s3bucketname1/='${BILLBUCKET}'/; s/=work_s3bucketname/='${PROCBUCKET}'/' src/java/ice.properties echo Ice is now ready to run as a processor. If you want to run the reader, edit: -echo ~/ice/src/java/ice.properties +echo "${INSTALL_DIR}/src/java/ice.properties" echo and alter the appropriate flags. You can now start Ice by running the following from the Ice root directory: echo ./grailsw -Djava.net.preferIPv4Stack=true -Dice.s3AccessKeyId=\ -Dice.s3SecretKey=\ run-app