Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fts_benchmarking_tool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
santosh8
fts_benchmarking_tool
Commits
5f3f81ed
Commit
5f3f81ed
authored
2 years ago
by
CK Phani Datta
Browse files
Options
Downloads
Patches
Plain Diff
added dynamo db changes
parent
b17c9efe
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fts_benchmarking_tool.py
+22
-9
22 additions, 9 deletions
fts_benchmarking_tool.py
main.tf
+21
-39
21 additions, 39 deletions
main.tf
with
43 additions
and
48 deletions
fts_benchmarking_tool.py
+
22
−
9
View file @
5f3f81ed
...
...
@@ -8,6 +8,9 @@ parser.add_argument('--load', type=int, help='load on the system', required=True
parser
.
add_argument
(
'
--db
'
,
type
=
str
,
help
=
'
name of the database
'
,
required
=
True
)
parser
.
add_argument
(
'
--endpoint
'
,
type
=
str
,
help
=
'
db endpoint
'
,
required
=
True
)
parser
.
add_argument
(
'
--workload
'
,
type
=
str
,
help
=
'
workload a or b or c
'
,
required
=
True
)
parser
.
add_argument
(
'
--pk
'
,
type
=
str
,
help
=
'
primary key for dynamodb
'
,
required
=
False
)
parser
.
add_argument
(
'
--tablename
'
,
type
=
str
,
help
=
'
table name for dynamodb
'
,
required
=
False
)
parser
.
add_argument
(
'
--region
'
,
type
=
str
,
help
=
'
region
'
,
required
=
False
)
args
=
parser
.
parse_args
()
max_vms
=
args
.
max_vms
...
...
@@ -15,30 +18,41 @@ load = args.load
db
=
args
.
db
endpoint
=
args
.
endpoint
workload
=
args
.
workload
pk
=
args
.
pk
tablename
=
args
.
tablename
region
=
args
.
region
def
get_load_command
(
db
,
load
,
vm
):
ret
=
[]
if
db
==
"
redis
"
:
for
thread
in
[
10
,
50
,
100
,
500
]:
for
thread
in
[
10
,
50
,
100
,
500
]:
threads
=
thread
//
vm
ret
.
append
(
"
./bin/ycsb load redis -p recordcount={} -p redis.host=
'
{}
'
-p redis.port=6379 -P workloads/workload{} -p redis.cluster=true > /tmp/redis_load_out_{}_{}.txt
"
.
format
(
load
//
vm
,
endpoint
,
workload
,
threads
,
vm
))
elif
db
==
"
memcached
"
:
for
thread
in
[
10
,
50
,
100
,
500
]:
for
thread
in
[
10
,
50
,
100
,
500
]:
threads
=
thread
//
vm
ret
.
append
(
"
./bin/ycsb load memcached -p recordcount={} -P workloads/workload{} -p memcached.hosts={}:11211> /tmp/memcached_load_out_{}_{}.txt
"
.
format
(
load
//
vm
,
workload
,
endpoint
,
threads
,
vm
))
elif
db
==
"
dynamodb
"
:
for
thread
in
[
10
,
50
,
100
,
500
]:
threads
=
thread
//
vm
ret
.
append
(
"
./bin/ycsb load dynamodb -s -p recordcount={} -p dynamodb.endpoint=
'
{}
'
-P workloads/workload{} -p dynamodb.primaryKey={} -p dynamodb.tablename={} -p dynamodb.region={} > /tmp/dynamodb_load_out_{}_{}.txt
"
.
format
(
load
//
vm
,
endpoint
,
workload
,
pk
,
tablename
,
region
,
threads
,
vm
))
return
ret
[
0
]
def
get_run_command
(
db
,
load
,
vm
):
ret
=
[]
if
db
==
"
redis
"
:
for
thread
in
[
10
,
50
,
100
,
500
]:
for
thread
in
[
10
,
50
,
100
,
500
]:
threads
=
thread
//
vm
ret
.
append
(
"
./bin/ycsb run redis -p operationcount={} -p redis.host=
'
{}
'
-p redis.port=6379 -P workloads/workload{} -p redis.cluster=true> /tmp/redis_run_out_{}_{}.txt
"
.
format
(
load
//
vm
,
endpoint
,
workload
,
threads
,
vm
))
elif
db
==
"
memcached
"
:
for
thread
in
[
10
,
50
,
100
,
500
]:
for
thread
in
[
10
,
50
,
100
,
500
]:
threads
=
thread
//
vm
ret
.
append
(
"
./bin/ycsb run memcached -p operationcount={} -P workloads/workload{} -p memcached.hosts={}:11211> /tmp/memcached_run_out_{}_{}.txt
"
.
format
(
load
//
vm
,
workload
,
endpoint
,
threads
,
vm
))
elif
db
==
"
dynamodb
"
:
for
thread
in
[
10
,
50
,
100
,
500
]:
threads
=
thread
//
vm
ret
.
append
(
"
./bin/ycsb run dynamodb -p operationcount={} -p dynamodb.endpoint=
'
{}
'
-P workloads/workload{} -p dynamodb.primaryKey={} -p dynamodb.tablename={} -p dynamodb.region={} > /tmp/dynamodb_run_out_{}_{}.txt
"
.
format
(
load
//
vm
,
endpoint
,
workload
,
pk
,
tablename
,
region
,
threads
,
vm
))
return
ret
...
...
@@ -48,14 +62,13 @@ for vm in range(1,max_vms+1):
ips
=
[]
with
open
(
"
terraform.tfstate
"
)
as
tf
:
data
=
json
.
load
(
tf
)
print
(
"
data ---->
"
,
data
)
ips
=
json
.
loads
(
data
[
"
outputs
"
][
"
ec2_public_ip
"
][
"
value
"
])
for
thread
in
[
10
,
50
,
100
,
500
]:
threads
=
thread
//
vm
for
ip
in
ips
:
rep_ip
=
ip
.
replace
(
"
.
"
,
"
_
"
)
if
thread
==
10
//
vm
:
os
.
system
(
"
sudo scp -o StrictHostKeyChecking=no -i cca.pem ec2-user@{}:/tmp/{}_load_out_{}_{}.txt ./{}_load_out_{}_{}_{}.txt
"
.
format
(
ip
,
db
,
threads
,
vm
,
db
,
rep_ip
,
threads
,
vm
))
os
.
system
(
"
sudo scp -o StrictHostKeyChecking=no -i cca.pem ec2-user@{}:/tmp/{}_run_out_{}_{}.txt ./{}_run_out_{}_{}_{}.txt
"
.
format
(
ip
,
db
,
threads
,
vm
,
db
,
rep_ip
,
threads
,
vm
))
os
.
system
(
"
sudo terraform destroy -var=
'
instance_count={}
'
-var=
'
runcmd1={}
'
-var=
'
runcmd2={}
'
-var=
'
runcmd3={}
'
-var=
'
runcmd4={}
'
-var=
'
loadcmd={}
'
-auto-approve
"
.
format
(
vm
,
run_commands
[
0
],
run_commands
[
1
],
run_commands
[
2
],
run_commands
[
3
],
get_load_command
(
db
,
load
,
vm
)))
os
.
system
(
"
sudo python3 Graphs.py
"
)
\ No newline at end of file
os
.
system
(
"
sudo scp -o StrictHostKeyChecking=no -i ycsb-key-pair.pem ec2-user@{}:/tmp/{}_load_out_{}_{}.txt ./{}_load_out_{}_{}_{}.txt
"
.
format
(
ip
,
db
,
threads
,
vm
,
db
,
rep_ip
,
threads
,
vm
))
os
.
system
(
"
sudo scp -o StrictHostKeyChecking=no -i ycsb-key-pair.pem ec2-user@{}:/tmp/{}_run_out_{}_{}.txt ./{}_run_out_{}_{}_{}.txt
"
.
format
(
ip
,
db
,
threads
,
vm
,
db
,
rep_ip
,
threads
,
vm
))
os
.
system
(
"
sudo terraform destroy -var=
'
instance_count={}
'
-var=
'
runcmd1={}
'
-var=
'
runcmd2={}
'
-var=
'
runcmd3={}
'
-var=
'
runcmd4={}
'
-var=
'
loadcmd={}
'
-auto-approve
"
.
format
(
vm
,
run_commands
[
0
],
run_commands
[
1
],
run_commands
[
2
],
run_commands
[
3
],
get_load_command
(
db
,
load
,
vm
)))
\ No newline at end of file
This diff is collapsed.
Click to expand it.
main.tf
+
21
−
39
View file @
5f3f81ed
...
...
@@ -25,60 +25,42 @@ variable "loadcmd" {
provider
"aws"
{
access_key
=
""
secret_key
=
""
region
=
"us-east-
2
"
access_key
=
"
AKIAYJPIDJWHZID2HUUK
"
secret_key
=
"
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
"
region
=
"us-east-
1
"
}
# resource "aws_security_group" "allowallfts" {
# name_prefix = "allowallfts"
# ingress {
# from_port = 0
# to_port = 65535
# protocol = "tcp"
# cidr_blocks = ["0.0.0.0/0"]
# }
# egress {
# from_port = 0
# to_port = 65535
# protocol = "tcp"
# cidr_blocks = ["0.0.0.0/0"]
# }
# }
resource
"aws_instance"
"test_master"
{
count
=
var
.
instance_count
ami
=
"ami-06
d5c50c30a35fb8
8"
ami
=
"ami-06
a0cd9728546d17
8"
instance_type
=
"t2.medium"
key_name
=
"
cca
"
key_name
=
"
ycsb-key-pair
"
vpc_security_group_ids
=
[
"sg-0
c8877cfa1f19cd8a
"
"sg-0
b48727ff340e3719
"
]
connection
{
type
=
"ssh"
user
=
"ec2-user"
private_key
=
file
(
"
cca
.pem"
)
private_key
=
file
(
"
ycsb-key-pair
.pem"
)
host
=
self
.
public_ip
}
provisioner
"remote-exec"
{
inline
=
[
"set -e"
,
"sudo yum install -y telnet python3
7
maven"
,
"sudo amazon-linux-extras install java-openjdk11 -y"
,
"sudo curl -O --location https://github.com/brianfrankcooper/YCSB/releases/download/0.17.0/ycsb-0.17.0.tar.gz"
,
"sudo tar xfvz ycsb-0.17.0.tar.gz"
,
"cd ycsb-0.17.0"
,
"
${
var
.
loadcmd
}
"
,
"
${
var
.
runcmd1
}
"
,
"
${
var
.
runcmd2
}
"
,
"
${
var
.
runcmd3
}
"
,
"
${
var
.
runcmd4
}
"
]
}
inline
=
[
"set -e"
,
"sudo yum install -y telnet python3 maven"
,
"sudo amazon-linux-extras install java-openjdk11 -y"
,
"sudo curl -O --location https://github.com/brianfrankcooper/YCSB/releases/download/0.17.0/ycsb-0.17.0.tar.gz"
,
"sudo tar xfvz ycsb-0.17.0.tar.gz"
,
"cd ycsb-0.17.0"
,
"
${
var
.
loadcmd
}
"
,
"
${
var
.
runcmd1
}
"
,
"
${
var
.
runcmd2
}
"
,
"
${
var
.
runcmd3
}
"
,
"
${
var
.
runcmd4
}
"
]
}
}
output
"ec2_public_ip"
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment