Skip to content
Permalink
Browse files
GEODE-8348: Add support for customizable purpose tag. (#131)
* GEODE-8348: Add support for customizable purpose tag.

* GEODE-8348: purpose value fixes.
  • Loading branch information
smgoller committed Jul 15, 2020
1 parent d3e8265 commit 9819b5f39c3f7dbbd25e467a9af9f60db368d949
Showing 4 changed files with 25 additions and 7 deletions.
@@ -42,6 +42,8 @@ task(launchCluster, dependsOn: 'classes', type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath

systemProperty 'TEST_CI', project.findProperty('ci')
systemProperty 'PURPOSE', project.findProperty('purpose')

}

task(destroyCluster, dependsOn: 'classes', type: JavaExec) {
@@ -1,7 +1,8 @@
{
"variables": {
"aws_access_key": "",
"aws_secret_key": ""
"aws_secret_key": "",
"purpose": "geode-benchmarks"
},
"builders": [
{
@@ -29,7 +30,7 @@
"Release": "Latest",
"Base_AMI_Name": "{{ .SourceAMIName }}",
"Extra": "{{ .SourceAMITags.TagName }}",
"purpose": "geode-benchmarks"
"purpose": "{{user `purpose`}}"
}
}
],
@@ -46,12 +46,22 @@ while (( "$#" )); do
--ci )
CI=1
;;
-p|--purpose )
if [ "${2}" ]; then
PURPOSE=${2}
shift
else
echo 'ERROR: "--purpose" requires a non-empty argument.'
exit 1
fi
;;
-h|--help|-\? )
echo "Usage: $(basename "$0") -t tag -c 4 [options ...] [-- arguments ...]"
echo "Options:"
echo "-t|--tag : Cluster tag"
echo "-c|--count : The number of instances to start"
echo "--ci : Set if starting instances for Continuous Integration"
echo "-p|--purpose : Purpose (Purpose tag to use for base AMI)"
echo "-- : All subsequent arguments are passed to the benchmark task as arguments."
echo "-h|--help : This help message"
exit 1
@@ -72,10 +82,9 @@ if [[ -z "${AWS_ACCESS_KEY_ID}" ]]; then
export AWS_PROFILE="geode-benchmarks"
fi

if [ -z "${CI}" ]; then
CI=0
fi
CI=${CI:-0}
PURPOSE=${PURPOSE:-"geode-benchmarks"}

pushd ../../../
./gradlew launchCluster -Pci=${CI} --args "${TAG} ${COUNT}"
./gradlew launchCluster -Pci=${CI} -Ppurpose=${PURPOSE} --args "${TAG} ${COUNT}"
popd
@@ -397,11 +397,17 @@ private static Image getNewestImage() {
DateTimeFormatter inputFormatter =
DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.ENGLISH);

String purpose = System.getProperty("PURPOSE", "geode-benchmarks");

if (purpose.isEmpty()) {
purpose = "geode-benchmarks";
}

// Find an appropriate AMI to launch our cluster with
List<Image> benchmarkImages = ec2.describeImages(
DescribeImagesRequest
.builder()
.filters(Filter.builder().name("tag:purpose").values("geode-benchmarks").build())
.filters(Filter.builder().name("tag:purpose").values(purpose).build())
.build())
.images();

0 comments on commit 9819b5f

Please sign in to comment.