From 3388da5be11cdb1f45e065935c4fb5d851dc65b5 Mon Sep 17 00:00:00 2001 From: alok Date: Sat, 14 Jul 2018 18:03:32 -0700 Subject: [PATCH] edited userdata file --- .../new_pipeline/create_solider_instances.py | 10 ++++++++-- .../new_pipeline/userdata-soldier.sh | 20 +++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 aws-experiment-launch/new_pipeline/userdata-soldier.sh diff --git a/aws-experiment-launch/new_pipeline/create_solider_instances.py b/aws-experiment-launch/new_pipeline/create_solider_instances.py index 785b0f9e3..cf3e2640a 100644 --- a/aws-experiment-launch/new_pipeline/create_solider_instances.py +++ b/aws-experiment-launch/new_pipeline/create_solider_instances.py @@ -12,7 +12,13 @@ import enum from utils import utils, spot_fleet, logger LOGGER = logger.getLogger(__file__) - +REGION_NAME = 'region_name' +REGION_KEY = 'region_key' +REGION_SECURITY_GROUP = 'region_security_group' +REGION_SECURITY_GROUP_ID = 'region_security_group_id' +REGION_HUMAN_NAME = 'region_human_name' +INSTANCE_TYPE = 't2.micro' +REGION_AMI = 'region_ami' class InstanceResource: ON_DEMAND = 1 @@ -141,7 +147,7 @@ if __name__ == "__main__": parser.add_argument('--instance_ids_output', type=str, dest='instance_ids_output', default='instance_ids_output.txt', help='the file to append or write') parser.add_argument('--instance_resource', dest='instance_resource', type=InstanceResource, - default=InstanceResource.ON_DEMAND, choices=list(InstanceResource)) + default=InstanceResource.ON_DEMAND) parser.add_argument('--append', dest='append', type=bool, default=False, help='append to the current instance_output') args = parser.parse_args() diff --git a/aws-experiment-launch/new_pipeline/userdata-soldier.sh b/aws-experiment-launch/new_pipeline/userdata-soldier.sh new file mode 100644 index 000000000..7436bd578 --- /dev/null +++ b/aws-experiment-launch/new_pipeline/userdata-soldier.sh @@ -0,0 +1,20 @@ +#!/bin/bash +cd /home/ec2-user +commanderIP=52.53.162.27 # <- Put the commander IP here. +curl http://$commanderIP:8080/soldier -o soldier +chmod +x ./soldier +curl http://$commanderIP:8080/benchmark -o benchmark +chmod +x ./benchmark +curl http://$commanderIP:8080/txgen -o txgen +chmod +x ./txgen + +# Get My IP +ip=`curl http://169.254.169.254/latest/meta-data/public-ipv4` + +node_port=9000 +soldier_port=1$node_port +# Kill existing soldier +fuser -k -n tcp $soldier_port + +# Run soldier +./soldier -ip $ip -port $node_port > soldier_log 2>&1 & \ No newline at end of file