Skip to content

Commit

Permalink
Fix a few region related issues with setup config
Browse files Browse the repository at this point in the history
add more region flexibility to allow setup base rkv region in both east and west (or pretty much anywhere)
  • Loading branch information
pdgetrf authored Sep 29, 2022
1 parent 983fb5a commit b37c505
Show file tree
Hide file tree
Showing 19 changed files with 414 additions and 18 deletions.
File renamed without changes.
File renamed without changes.
62 changes: 62 additions & 0 deletions scripts/config_examples/si_def_3_region_m5a.2xlarge_east.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"RegionConfigs": [
{
"Region": "us-west-1",
"KeyName": "regionless_kv_service_key",
"FileName": "regionless_kv_service_key_us_west_1.pem",
"AMI": "ami-067f8db0a5c2309c0"
},
{
"Region": "us-west-2",
"KeyName": "regionless_kv_service_key",
"FileName": "regionless_kv_service_key_us_west_2.pem",
"AMI": "ami-0bf8f78223ea6f3f6"
},
{
"Region": "us-east-1",
"KeyName": "regionless_kv_service_key",
"FileName": "regionless_kv_service_key_us_east_1.pem",
"AMI": "ami-0729e439b6769d6ab"
},
{
"Region": "us-east-2",
"KeyName": "regionless_kv_service_key",
"FileName": "regionless_kv_service_key_us_east_2.pem",
"AMI": "ami-00978328f54e31526"
}
],
"Stores": [
{
"NamePrefix": "rkv-lab-si",
"Region": "us-east-1",
"AvailabilityZone": "us-east-1a",
"Port": 6666,
"Count": 12,
"InstanceType": "m5a.2xlarge"
},
{
"NamePrefix": "rkv-lab-si",
"Region": "us-east-1",
"AvailabilityZone": "us-east-1b",
"Port": 6666,
"Count": 12,
"InstanceType": "m5a.2xlarge"
},
{
"NamePrefix": "rkv-lab-si",
"Region": "us-east-2",
"AvailabilityZone": "us-east-2a",
"Port": 6666,
"Count": 12,
"InstanceType": "m5a.2xlarge"
},
{
"NamePrefix": "rkv-lab-si",
"Region": "us-west-1",
"AvailabilityZone": "us-west-1b",
"Port": 6666,
"Count": 18,
"InstanceType": "m5a.2xlarge"
}
]
}
62 changes: 62 additions & 0 deletions scripts/config_examples/si_def_3_region_xlarge.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"RegionConfigs": [
{
"Region": "us-west-1",
"KeyName": "regionless_kv_service_key",
"FileName": "regionless_kv_service_key_us_west_1.pem",
"AMI": "ami-067f8db0a5c2309c0"
},
{
"Region": "us-west-2",
"KeyName": "regionless_kv_service_key",
"FileName": "regionless_kv_service_key_us_west_2.pem",
"AMI": "ami-0bf8f78223ea6f3f6"
},
{
"Region": "us-east-1",
"KeyName": "regionless_kv_service_key",
"FileName": "regionless_kv_service_key_us_east_1.pem",
"AMI": "ami-0729e439b6769d6ab"
},
{
"Region": "us-east-2",
"KeyName": "regionless_kv_service_key",
"FileName": "regionless_kv_service_key_us_east_2.pem",
"AMI": "ami-00978328f54e31526"
}
],
"Stores": [
{
"NamePrefix": "rkv-lab-si",
"Region": "us-west-2",
"AvailabilityZone": "us-west-2a",
"Port": 6666,
"Count": 3,
"InstanceType": "t2.xlarge"
},
{
"NamePrefix": "rkv-lab-si",
"Region": "us-west-2",
"AvailabilityZone": "us-west-2b",
"Port": 6666,
"Count":3,
"InstanceType": "t2.xlarge"
},
{
"NamePrefix": "rkv-lab-si",
"Region": "us-west-1",
"AvailabilityZone": "us-west-1b",
"Port": 6666,
"Count": 3,
"InstanceType": "t2.xlarge"
},
{
"NamePrefix": "rkv-lab-si",
"Region": "us-east-1",
"AvailabilityZone": "us-east-1a",
"Port": 6666,
"Count": 3,
"InstanceType": "t2.xlarge"
}
]
}
62 changes: 62 additions & 0 deletions scripts/config_examples/si_def_3_region_xlarge_east.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"RegionConfigs": [
{
"Region": "us-west-1",
"KeyName": "regionless_kv_service_key",
"FileName": "regionless_kv_service_key_us_west_1.pem",
"AMI": "ami-067f8db0a5c2309c0"
},
{
"Region": "us-west-2",
"KeyName": "regionless_kv_service_key",
"FileName": "regionless_kv_service_key_us_west_2.pem",
"AMI": "ami-0bf8f78223ea6f3f6"
},
{
"Region": "us-east-1",
"KeyName": "regionless_kv_service_key",
"FileName": "regionless_kv_service_key_us_east_1.pem",
"AMI": "ami-0729e439b6769d6ab"
},
{
"Region": "us-east-2",
"KeyName": "regionless_kv_service_key",
"FileName": "regionless_kv_service_key_us_east_2.pem",
"AMI": "ami-00978328f54e31526"
}
],
"Stores": [
{
"NamePrefix": "rkv-lab-si",
"Region": "us-east-1",
"AvailabilityZone": "us-east-1a",
"Port": 6666,
"Count": 3,
"InstanceType": "t2.xlarge"
},
{
"NamePrefix": "rkv-lab-si",
"Region": "us-east-1",
"AvailabilityZone": "us-east-1b",
"Port": 6666,
"Count": 3,
"InstanceType": "t2.xlarge"
},
{
"NamePrefix": "rkv-lab-si",
"Region": "us-east-2",
"AvailabilityZone": "us-east-2a",
"Port": 6666,
"Count": 3,
"InstanceType": "t2.xlarge"
},
{
"NamePrefix": "rkv-lab-si",
"Region": "us-west-1",
"AvailabilityZone": "us-west-1b",
"Port": 6666,
"Count": 3,
"InstanceType": "t2.xlarge"
}
]
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
52 changes: 52 additions & 0 deletions scripts/config_examples/test-lab.val.m5a.2xlarge.east
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
set -u

## aws ec2 key pair name
## e.g. KEY_NAME=hwchen01
: $KEY_NAME
: $KEY_FILE #~/.ssh/aws-hwchen01.pem
: $NAME_TAG

export KEY_NAME KEY_FILE NAME_TAG

export SI_DEF_FILE=../si_def.json

## common to lab
export SECURITY_GROUP=regionless_kv_service
export LAB_TAG=rkv_perf_lab #todo: use it to tag all vms of perf lab

## of redis backends
export NUM_OF_SI=2

## disk size
export SI_ROOT_DISK_VOLUME=32

## rkv service
export RKV_INSTANCE_TYPE=m5a.8xlarge
export RKV_AMI=ami-0f1c5fdb1989bb81b
export RKV_VM_NAME=${NAME_TAG}-rkv-lab-rkv
export RKV_REGION=us-east-1
export RKV_AZ=us-east-1a
export RKV_ROOT_DISK_VOLUME=32

## of jaeger server
export JAEGER_REGION=us-east-1
export JAEGER_AZ=us-east-1a
export JAEGER_AMI=ami-0709d88d3f477f93c #hw-ami-jaeger5
export JAEGER_INSTANCE_TYPE=m5a.2xlarge
export JAEGER_ROOT_DISK_VOLUME=200
export JAEGER_VM_NAME=${NAME_TAG}-rkv-lab-jaeger

## of prometheus server

## of go-ycsb client
export YCSB_REGION=us-east-1
export YCSB_AZ=us-east-1a
export YCSB_AMI=ami-0f1c5fdb1989bb81b #hw-ami-go-ycsb5
export YCSB_INSTANCE_TYPE=m5a.8xlarge
export YCSB_ROOT_DISK_VOLUME=50
export YCSB_VM_NAME=${NAME_TAG}-rkv-lab-ycsb

## logging
export GREEN='\033[0;32m'
export LIGHT_GREEN='\033[1;32m'
export NC='\033[0m' # No Color
File renamed without changes.
File renamed without changes.
52 changes: 52 additions & 0 deletions scripts/config_examples/test-lab.val.xlarge
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
set -u

## aws ec2 key pair name
## e.g. KEY_NAME=hwchen01
: $KEY_NAME
: $KEY_FILE #~/.ssh/aws-hwchen01.pem
: $NAME_TAG

export KEY_NAME KEY_FILE NAME_TAG

export SI_DEF_FILE=../si_def.json

## common to lab
export SECURITY_GROUP=regionless_kv_service
export LAB_TAG=rkv_perf_lab #todo: use it to tag all vms of perf lab

## of redis backends
export NUM_OF_SI=2

## disk size
export SI_ROOT_DISK_VOLUME=32

## rkv service
export RKV_INSTANCE_TYPE=t2.xlarge
export RKV_AMI=ami-0bf8f78223ea6f3f6 #hw-ami-rkv-test2
export RKV_VM_NAME=${NAME_TAG}-rkv-lab-rkv
export RKV_REGION=us-west-2
export RKV_AZ=us-west-2b
export RKV_ROOT_DISK_VOLUME=32

## of jaeger server
export JAEGER_REGION=us-west-2
export JAEGER_AZ=us-west-2b
export JAEGER_AMI=ami-0f501c5343cd5d65a #hw-ami-jaeger5
export JAEGER_INSTANCE_TYPE=t2.xlarge
export JAEGER_ROOT_DISK_VOLUME=200
export JAEGER_VM_NAME=${NAME_TAG}-rkv-lab-jaeger

## of prometheus server

## of go-ycsb client
export YCSB_REGION=us-west-2
export YCSB_AZ=us-west-2b
export YCSB_AMI=ami-03fadfb192c131dc0 #hw-ami-go-ycsb5
export YCSB_INSTANCE_TYPE=t2.xlarge
export YCSB_ROOT_DISK_VOLUME=16
export YCSB_VM_NAME=${NAME_TAG}-rkv-lab-ycsb

## logging
export GREEN='\033[0;32m'
export LIGHT_GREEN='\033[1;32m'
export NC='\033[0m' # No Color
52 changes: 52 additions & 0 deletions scripts/config_examples/test-lab.val.xlarge.east
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
set -u

## aws ec2 key pair name
## e.g. KEY_NAME=hwchen01
: $KEY_NAME
: $KEY_FILE #~/.ssh/aws-hwchen01.pem
: $NAME_TAG

export KEY_NAME KEY_FILE NAME_TAG

export SI_DEF_FILE=../si_def.json

## common to lab
export SECURITY_GROUP=regionless_kv_service
export LAB_TAG=rkv_perf_lab #todo: use it to tag all vms of perf lab

## of redis backends
export NUM_OF_SI=2

## disk size
export SI_ROOT_DISK_VOLUME=32

## rkv service
export RKV_INSTANCE_TYPE=t2.xlarge
export RKV_AMI=ami-0729e439b6769d6ab #hw-ami-rkv-test2
export RKV_VM_NAME=${NAME_TAG}-rkv-lab-rkv
export RKV_REGION=us-east-1
export RKV_AZ=us-east-1a
export RKV_ROOT_DISK_VOLUME=32

## of jaeger server
export JAEGER_REGION=us-east-1
export JAEGER_AZ=us-east-1a
export JAEGER_AMI=ami-0709d88d3f477f93c #hw-ami-jaeger5
export JAEGER_INSTANCE_TYPE=t2.xlarge
export JAEGER_ROOT_DISK_VOLUME=200
export JAEGER_VM_NAME=${NAME_TAG}-rkv-lab-jaeger

## of prometheus server

## of go-ycsb client
export YCSB_REGION=us-east-1
export YCSB_AZ=us-east-1a
export YCSB_AMI=ami-0f1c5fdb1989bb81b #hw-ami-go-ycsb5
export YCSB_INSTANCE_TYPE=t2.xlarge
export YCSB_ROOT_DISK_VOLUME=16
export YCSB_VM_NAME=${NAME_TAG}-rkv-lab-ycsb

## logging
export GREEN='\033[0;32m'
export LIGHT_GREEN='\033[1;32m'
export NC='\033[0m' # No Color
4 changes: 2 additions & 2 deletions scripts/select_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ then
exit 0
fi

svc_cfg=test-lab.val.$2
si_cfg=si_def_$1_region_$2.json
svc_cfg=./config_examples/test-lab.val.$2
si_cfg=./config_examples/si_def_$1_region_$2.json

if [[ -f $svc_cfg && -f $si_cfg ]]; then
svc_soft_link=test-lab.val
Expand Down
7 changes: 5 additions & 2 deletions scripts/setup_test_lab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ create_jaeger_vm() {
--block-device-mappings "DeviceName=/dev/sda1,Ebs={VolumeSize=${JAEGER_ROOT_DISK_VOLUME}}" \
--output text \
--query 'Instances[*].InstanceId')
aws ec2 wait instance-status-ok --instance-ids ${jaeger_vmid}
aws ec2 --region ${JAEGER_REGION} wait instance-status-ok --instance-ids ${jaeger_vmid}
}

create_ycsb_vm() {
Expand All @@ -42,7 +42,7 @@ create_ycsb_vm() {
--block-device-mappings "DeviceName=/dev/sda1,Ebs={VolumeSize=${YCSB_ROOT_DISK_VOLUME}}" \
--output text \
--query 'Instances[*].InstanceId')
aws ec2 wait instance-status-ok --instance-ids ${ycsb_vmid}
aws ec2 --region ${YCSB_REGION} wait instance-status-ok --instance-ids ${ycsb_vmid}
}

source common.sh
Expand Down Expand Up @@ -100,12 +100,14 @@ wait

jaeger_vmip=$(aws ec2 describe-instances \
--filters "Name=tag-value,Values=${JAEGER_VM_NAME}" "Name=instance-state-name,Values=running" \
--region ${JAEGER_REGION} \
--query "Reservations[].Instances[].NetworkInterfaces[].PrivateIpAddresses[].Association.PublicIp" \
--output text)
print_green "jaeger vm provisioned, ip addr is ${jaeger_vmip}"

ycsb_vmip=$(aws ec2 describe-instances \
--instance-ids ${ycsb_vmid} \
--region ${YCSB_REGION} \
--filters "Name=tag-value,Values=${YCSB_VM_NAME}" "Name=instance-state-name,Values=running" \
--query "Reservations[].Instances[].NetworkInterfaces[].PrivateIpAddresses[].Association.PublicIp" \
--output text)
Expand All @@ -117,6 +119,7 @@ print_green "ycsb vm provisioned, ip addr is ${ycsb_vmip}"
rkv_vmid=$(aws ec2 describe-instances --filters "Name=tag:Name, Values=${RKV_VM_NAME}" "Name=instance-state-name,Values=running" --output text --query 'Reservations[*].Instances[*].InstanceId')
aws ec2 wait instance-status-ok --instance-ids ${rkv_vmid}
rkv_vmip=$(aws ec2 describe-instances \
--region ${RKV_REGION} \
--filters "Name=tag-value,Values=${RKV_VM_NAME}" "Name=instance-state-name,Values=running" \
--query "Reservations[].Instances[].NetworkInterfaces[].PrivateIpAddresses[].Association.PublicIp" \
--output text)
Expand Down
Loading

0 comments on commit b37c505

Please sign in to comment.