pull/41/head
Richard Liu 6 years ago
commit 52ba30ff5d
  1. 3
      aws-experiment-launch/experiment/commander/main.go
  2. 10
      aws-experiment-launch/new-pipeline/userdata-soldier.sh
  3. 4
      aws-experiment-launch/new-pipeline/utils/utils.py
  4. 9
      aws-experiment-launch/utils/utils.py

@ -38,7 +38,6 @@ func readConfigFile() [][]string {
if err != nil { if err != nil {
log.Fatal("Failed to create local file", err) log.Fatal("Failed to create local file", err)
} }
defer out.Close()
// get remote config file // get remote config file
resp, err := http.Get(setting.configURL) resp, err := http.Get(setting.configURL)
@ -52,6 +51,7 @@ func readConfigFile() [][]string {
if err != nil { if err != nil {
log.Fatal("Failed to copy file") log.Fatal("Failed to copy file")
} }
out.Close()
// log config file // log config file
content, err := ioutil.ReadFile(configFile) content, err := ioutil.ReadFile(configFile)
@ -60,6 +60,7 @@ func readConfigFile() [][]string {
} }
log.Println("Successfully downloaded config") log.Println("Successfully downloaded config")
log.Println(string(content)) log.Println(string(content))
file, err := os.Open(configFile) file, err := os.Open(configFile)
defer file.Close() defer file.Close()
if err != nil { if err != nil {

@ -1,9 +1,9 @@
#!/bin/bash #!/bin/bash
yum install ruby wget -y yum install ruby -y
cd $HOME cd /home/ec2-user/
wget http://unique-bucket-bin.s3.amazonaws.com/txgen curl http://unique-bucket-bin.s3.amazonaws.com/txgen -o txgen
wget http://unique-bucket-bin.s3.amazonaws.com/soldier curl http://unique-bucket-bin.s3.amazonaws.com/soldier -o soldier
wget http://unique-bucket-bin.s3.amazonaws.com/benchmark curl http://unique-bucket-bin.s3.amazonaws.com/benchmark -o benchmark
chmod +x ./soldier chmod +x ./soldier
chmod +x ./txgen chmod +x ./txgen
chmod +x ./benchmark chmod +x ./benchmark

@ -136,8 +136,8 @@ def generate_distribution_config(shard_number, client_number, ip_list, distribut
return False return False
# Create ip for clients. # Create ip for clients.
client_id, leader_id, validator_id, commander_id = 0, 0, 0, 0 client_id, leader_id, validator_id = 0, 0, 0
validator_number = len(ip_list) - client_number - shard_number - 1 validator_number = len(ip_list) - client_number - shard_number
with open(distribution_config, "w") as fout: with open(distribution_config, "w") as fout:
for i in range(len(ip_list)): for i in range(len(ip_list)):
ip, node_name_tag = ip_list[i].split(" ") ip, node_name_tag = ip_list[i].split(" ")

@ -136,15 +136,12 @@ def generate_distribution_config(shard_number, client_number, ip_list, distribut
return False return False
# Create ip for clients. # Create ip for clients.
client_id, leader_id, validator_id, commander_id = 0, 0, 0, 0 client_id, leader_id, validator_id= 0, 0, 0
validator_number = len(ip_list) - client_number - shard_number - 1 validator_number = len(ip_list) - client_number - shard_number
with open(distribution_config, "w") as fout: with open(distribution_config, "w") as fout:
for i in range(len(ip_list)): for i in range(len(ip_list)):
ip, node_name_tag = ip_list[i].split(" ") ip, node_name_tag = ip_list[i].split(" ")
if commander_id < 1: if leader_id < shard_number:
fout.write("%s 9000 commander %d %s\n" % (ip, commander_id % shard_number, node_name_tag))
commander_id = commander_id + 1
elif leader_id < shard_number:
fout.write("%s 9000 leader %d %s\n" % (ip, leader_id, node_name_tag)) fout.write("%s 9000 leader %d %s\n" % (ip, leader_id, node_name_tag))
leader_id = leader_id + 1 leader_id = leader_id + 1
elif validator_id < validator_number: elif validator_id < validator_number:

Loading…
Cancel
Save