Skip to content

Commit ad7bcbb

Browse files
authored
Feat/add oss multi arch comp metal amd arm intel redis latest (#140)
* Add deployment for comparing Redis versions (7.2, 8.0) on multiple archs (amd, intel, arm) * Add deployment for comparing Redis on multiple archs (amd, intel, arm) using metal instances
1 parent 8dea99d commit ad7bcbb

File tree

18 files changed

+766
-0
lines changed

18 files changed

+766
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#cloud-config
2+
3+
package_update: true
4+
package_upgrade: true
5+
packages:
6+
- git
7+
- build-essential
8+
- autoconf
9+
- automake
10+
- libpcre3-dev
11+
- libevent-dev
12+
- pkg-config
13+
- zlib1g-dev
14+
- libssl-dev
15+
- libtool
16+
- ca-certificates
17+
- wget
18+
19+
# Create the memtier installation script
20+
write_files:
21+
- path: /tmp/install_memtier.sh
22+
permissions: "0755"
23+
content: |
24+
#!/bin/bash
25+
26+
set -e # exit immediately on error
27+
28+
# Clone memtier benchmark
29+
cd /tmp
30+
rm -rf memtier_benchmark
31+
git clone https://github.com/RedisLabs/memtier_benchmark.git
32+
cd memtier_benchmark
33+
34+
# Build and install
35+
autoreconf -ivf
36+
./configure
37+
make -j
38+
sudo make install
39+
40+
echo "Memtier benchmark installed successfully"
41+
42+
# Run the installation script
43+
runcmd:
44+
- [bash, /tmp/install_memtier.sh]
45+
- [echo, "Cloud-init installation completed"]
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
resource "aws_instance" "client" {
2+
ami = var.client_instance_ami
3+
instance_type = var.client_instance_type
4+
subnet_id = data.terraform_remote_state.shared_resources.outputs.subnet_public_us_east_2b_id
5+
vpc_security_group_ids = ["${data.terraform_remote_state.shared_resources.outputs.performance_cto_sg_id}"]
6+
key_name = var.key_name
7+
placement_group = data.terraform_remote_state.shared_resources.outputs.placement_group_name_us_east_2b
8+
availability_zone = "us-east-2b"
9+
10+
user_data = file("./client-cloud-init-memtier.yaml") # Use cloud-init to install memtier benchmark
11+
12+
root_block_device {
13+
volume_size = var.instance_volume_size
14+
volume_type = var.instance_volume_type
15+
encrypted = var.instance_volume_encrypted
16+
delete_on_termination = true
17+
tags = merge(
18+
local.base_tags,
19+
{
20+
Name = "ebs_block_device-${var.setup_name}-CLIENT"
21+
}
22+
)
23+
}
24+
25+
tags = merge(
26+
local.base_tags,
27+
{
28+
Name = "${var.setup_name}-CLIENT"
29+
InstanceType = var.client_instance_type
30+
}
31+
)
32+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
################################################################################
3+
# This is the bucket holding this specific setup tfstate
4+
################################################################################
5+
terraform {
6+
backend "s3" {
7+
bucket = "performance-cto-group"
8+
key = "benchmarks/infrastructure/oss-multi-arch-comp-amd-arm-intel-4xlarge-redis-7.2-redis-8.0.0.tfstate"
9+
region = "us-east-1"
10+
}
11+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#cloud-config
2+
3+
package_update: true
4+
package_upgrade: true
5+
packages:
6+
- git
7+
- dpkg-dev
8+
- gcc
9+
- g++
10+
- libc6-dev
11+
- libssl-dev
12+
- make
13+
- cmake
14+
- clang
15+
- automake
16+
- autoconf
17+
- libtool
18+
- ca-certificates
19+
- wget
20+
21+
# Create the Redis installation script
22+
write_files:
23+
- path: /tmp/install_redis.sh
24+
permissions: "0755"
25+
content: |
26+
#!/bin/bash
27+
28+
set -e # exit immediately on error
29+
30+
GH_ORG=${1:-"redis"}
31+
GH_REPO=${2:-"redis"}
32+
COMMIT=${3:-"HEAD"}
33+
FOLDER=${4:-${GH_REPO}}
34+
35+
echo "Installing ${GH_ORG}/${GH_REPO} at commit ${COMMIT} in folder ${FOLDER}"
36+
rm -rf ${FOLDER}
37+
git clone https://github.com/${GH_ORG}/${GH_REPO} ${FOLDER}
38+
39+
cd ${FOLDER}
40+
git checkout ${COMMIT}
41+
42+
make distclean
43+
make BUILD_TLS=yes -j
44+
45+
echo "Installed successfully"
46+
47+
# Run the installation script
48+
runcmd:
49+
- [su, ubuntu, -c, "/tmp/install_redis.sh redis redis 7.2 ~/redis-7.2"]
50+
- [su, ubuntu, -c, "/tmp/install_redis.sh redis redis 8.0.0 ~/redis-8.0.0"]
51+
- [echo, "Cloud-init installation completed"]
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
resource "aws_instance" "server" {
2+
for_each = var.server_instances_configs # Create instances for each architecture
3+
ami = each.value.ami
4+
instance_type = each.value.instance_type
5+
subnet_id = data.terraform_remote_state.shared_resources.outputs.subnet_public_us_east_2b_id
6+
vpc_security_group_ids = ["${data.terraform_remote_state.shared_resources.outputs.performance_cto_sg_id}"]
7+
key_name = var.key_name
8+
placement_group = data.terraform_remote_state.shared_resources.outputs.placement_group_name_us_east_2b
9+
availability_zone = "us-east-2b"
10+
11+
user_data = file("./db-cloud-init-dbs.yaml") # Use cloud-init to install Redis versions
12+
13+
root_block_device {
14+
volume_size = var.instance_volume_size
15+
volume_type = var.instance_volume_type
16+
encrypted = var.instance_volume_encrypted
17+
delete_on_termination = true
18+
tags = merge(
19+
local.base_tags,
20+
{
21+
Name = "ebs_block_device-${var.setup_name}-${each.value.arch_label}"
22+
}
23+
)
24+
}
25+
26+
tags = merge(
27+
local.base_tags,
28+
{
29+
Name = "${var.setup_name}-${each.value.arch_label}"
30+
Architecture = each.value.arch_label
31+
InstanceType = each.value.instance_type
32+
}
33+
)
34+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
output "all_server_public_ips" {
2+
value = {
3+
for k, v in var.server_instances_configs : v.name => aws_instance.server[k].public_ip
4+
}
5+
}
6+
7+
output "all_server_private_ips" {
8+
value = {
9+
for k, v in var.server_instances_configs : v.name => aws_instance.server[k].private_ip
10+
}
11+
}
12+
13+
output "client_public_ip" {
14+
value = ["${aws_instance.client[*].public_ip}"]
15+
}
16+
17+
output "client_private_ip" {
18+
value = ["${aws_instance.client[*].private_ip}"]
19+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# provider
2+
provider "aws" {
3+
region = var.region
4+
}
5+
6+
################################################################################
7+
# This is the shared resources bucket key -- you will need it across environments like security rules,etc...
8+
# !! do not change this !!
9+
################################################################################
10+
data "terraform_remote_state" "shared_resources" {
11+
backend = "s3"
12+
config = {
13+
bucket = "performance-cto-group"
14+
key = "benchmarks/infrastructure/shared_resources.tfstate"
15+
region = "us-east-1"
16+
}
17+
}
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
################################################################################
2+
# Variables used for deployment tag
3+
################################################################################
4+
5+
variable "setup_name" {
6+
description = "setup name"
7+
default = "oss-multi-arch-comp-amd-arm-intel-4xlarge-redis-7.2-redis-8.0.0"
8+
}
9+
10+
variable "github_actor" {
11+
description = "The name of the person or app that initiated the deployment."
12+
default = "N/A"
13+
}
14+
15+
variable "github_org" {
16+
description = "The owner name. For example, RedisModules."
17+
default = "N/A"
18+
}
19+
20+
variable "github_repo" {
21+
description = "The owner and repository name. For example, octocat/Hello-World."
22+
default = "N/A"
23+
}
24+
25+
variable "github_sha" {
26+
description = "The commit SHA that triggered the deployment."
27+
default = "N/A"
28+
}
29+
30+
variable "timeout_secs" {
31+
description = "The maximum time to wait prior destroying the VM via the watchdog."
32+
default = "3600"
33+
}
34+
35+
variable "triggering_env" {
36+
description = "The triggering environment. For example circleci."
37+
default = "N/A"
38+
}
39+
40+
variable "environment" {
41+
description = "The cost tag."
42+
default = "N/A"
43+
}
44+
45+
variable "redis_module" {
46+
description = "redis_module"
47+
default = "N/A"
48+
}
49+
50+
################################################################################
51+
# Instance(s) options
52+
################################################################################
53+
54+
variable "region" {
55+
default = "us-east-2"
56+
}
57+
58+
variable "server_instances_configs" {
59+
description = "Configuration for each instance type"
60+
type = map(object({
61+
name = string
62+
instance_type = string
63+
ami = string
64+
arch_label = string
65+
}))
66+
default = {
67+
"amd" = {
68+
name = "AMD m7a.4xlarge"
69+
instance_type = "m7a.4xlarge"
70+
ami = "ami-04f167a56786e4b09" # Ubuntu 24.04 LTS x86_64
71+
arch_label = "AMD"
72+
},
73+
"intel" = {
74+
name = "Intel m7i.4xlarge"
75+
instance_type = "m7i.4xlarge"
76+
ami = "ami-04f167a56786e4b09" # Ubuntu 24.04 LTS x86_64
77+
arch_label = "INTEL"
78+
},
79+
"arm" = {
80+
name = "ARM m8g.4xlarge"
81+
instance_type = "m8g.4xlarge"
82+
ami = "ami-0ae6f07ad3a8ef182" # Ubuntu 24.04 LTS ARM64
83+
arch_label = "ARM"
84+
}
85+
}
86+
}
87+
88+
variable "client_instance_ami" {
89+
description = "AMI for aws EC2 instance - Ubuntu 24.04 LTS x86_64"
90+
default = "ami-04f167a56786e4b09"
91+
}
92+
93+
variable "client_instance_type" {
94+
description = "type for aws EC2 instance"
95+
default = "c6in.8xlarge"
96+
}
97+
98+
variable "instance_volume_size" {
99+
description = "EC2 instance volume_size"
100+
default = "128"
101+
}
102+
103+
variable "instance_volume_type" {
104+
description = "EC2 instance volume_type"
105+
default = "gp3"
106+
}
107+
108+
109+
variable "instance_volume_encrypted" {
110+
description = "EC2 instance instance_volume_encrypted"
111+
default = "false"
112+
}
113+
114+
################################################################################
115+
# SSH Access
116+
################################################################################
117+
variable "private_key" {
118+
description = "private key"
119+
default = "/tmp/benchmarks.redislabs.pem"
120+
}
121+
122+
variable "key_name" {
123+
description = "key name"
124+
default = "perf-cto-us-east-2"
125+
}
126+
127+
variable "ssh_user" {
128+
description = "ssh_user"
129+
default = "ubuntu"
130+
}
131+
132+
# Define base tags that are common to multiple resources
133+
locals {
134+
base_tags = {
135+
Environment = var.environment
136+
setup = var.setup_name
137+
redis_module = var.redis_module
138+
triggering_env = var.triggering_env
139+
github_actor = var.github_actor
140+
github_org = var.github_org
141+
github_repo = var.github_repo
142+
github_sha = var.github_sha
143+
timeout_secs = var.timeout_secs
144+
}
145+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#cloud-config
2+
3+
package_update: true
4+
package_upgrade: true
5+
packages:
6+
- python3-pip
7+
- docker.io
8+
- python3.12-venv
9+
10+
# Run the installation script
11+
runcmd:
12+
- [mkdir, /home/ubuntu/redis-benchmarks-specification-venv]
13+
- [python3, -m, venv, /home/ubuntu/redis-benchmarks-specification-venv/]
14+
- [
15+
/home/ubuntu/redis-benchmarks-specification-venv/bin/pip,
16+
install,
17+
redis-benchmarks-specification,
18+
]
19+
- [usermod, -aG, docker, ubuntu]
20+
- [echo, "Cloud-init installation completed"]

0 commit comments

Comments
 (0)