edited userdata file

pull/39/head
alok 6 years ago
parent f8afd23981
commit 3388da5be1
  1. 10
      aws-experiment-launch/new_pipeline/create_solider_instances.py
  2. 20
      aws-experiment-launch/new_pipeline/userdata-soldier.sh

@ -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()

@ -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 &
Loading…
Cancel
Save