Skip to content
Permalink
Browse files
allow AMI picking with arbitrary username accounts (#132)
* allow AMI picking with arbitrary username accounts
* improved run directory settings
  • Loading branch information
robbadler committed Aug 12, 2020
1 parent 9819b5f commit 3e3bdd3a371e400db0ce2ce2d736ab06f9244ed1
Showing 5 changed files with 40 additions and 5 deletions.
@@ -43,7 +43,7 @@ task(launchCluster, dependsOn: 'classes', type: JavaExec) {

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

systemProperty 'USER', project.findProperty('user')
}

task(destroyCluster, dependsOn: 'classes', type: JavaExec) {
@@ -17,6 +17,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.


SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
SCRIPTDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
SCRIPTDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

TAG=
CI=

@@ -63,6 +72,6 @@ if [ -z "${CI}" ]; then
CI=0
fi

pushd ../../../
pushd "${SCRIPTDIR}/../../../"
./gradlew destroyCluster -Pci=${CI} --args "${TAG}"
popd
@@ -19,6 +19,14 @@

set -e

SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
SCRIPTDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
SCRIPTDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

TAG=
COUNT=
CI=
@@ -55,6 +63,15 @@ while (( "$#" )); do
exit 1
fi
;;
-u|--user )
if [ "${2}" ]; then
USER="${2}"
shift
else
echo 'ERROR: "--user" requires a non-empty argument.'
exit 1
fi
;;
-h|--help|-\? )
echo "Usage: $(basename "$0") -t tag -c 4 [options ...] [-- arguments ...]"
echo "Options:"
@@ -84,7 +101,10 @@ fi

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

pushd ../../../
./gradlew launchCluster -Pci=${CI} -Ppurpose=${PURPOSE} --args "${TAG} ${COUNT}"
pushd "${SCRIPTDIR}/../../../"
./gradlew launchCluster "${USER_ARG}" -Pci=${CI} -Ppurpose=${PURPOSE} --args "${TAG} ${COUNT}"
popd
@@ -26,11 +26,16 @@
* Static methods to generate common strings used for AWS infrastructure.
*/
class AwsBenchmarkMetadata extends BenchmarkMetadata {
public static final String USER = "geode";
public static String USER = "geode";
public static final int POLL_INTERVAL = 15000;
public static InstanceType INSTANCE_TYPE = InstanceType.C5_18_XLARGE;
public static Tenancy TENANCY = Tenancy.DEDICATED;

public static String setUserName(String user) {
USER = user;
return USER;
}

public static String securityGroup(String tag) {
return BenchmarkMetadata.benchmarkString(tag, "securityGroup");
}
@@ -92,6 +92,7 @@ public static void main(String[] args) throws IOException, InterruptedException
usage("Usage: LaunchCluster <tag> <count>");
}

AwsBenchmarkMetadata.setUserName(System.getProperty("USER", AwsBenchmarkMetadata.USER));
List<Tag> tags = getTags(benchmarkTag);
createKeyPair(benchmarkTag);
Image newestImage = getNewestImage();

0 comments on commit 3e3bdd3

Please sign in to comment.