Skip to content

Commit d0ac6e9

Browse files
LakshmanLakshman
authored andcommitted
Addressing comments.
Signed-off-by: Lakshman <Lakshman@node-000.lakshman-266241.rperf-pg0.wisc.cloudlab.us>
1 parent 5c382aa commit d0ac6e9

File tree

10 files changed

+30
-32
lines changed

10 files changed

+30
-32
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ benchmarks/compression/files/img4.jpg filter=lfs diff=lfs merge=lfs -text
3232
benchmarks/compression/files/img1.jpg filter=lfs diff=lfs merge=lfs -text
3333
benchmarks/compression/files/img2.jpg filter=lfs diff=lfs merge=lfs -text
3434
benchmarks/compression/files/img3.jpg filter=lfs diff=lfs merge=lfs -text
35+
*.json.gz filter=lfs diff=lfs merge=lfs -text

benchmarks/graph-bfs/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MIT License
22
#
3-
# Copyright (c) 2022 David Schall and EASE lab
3+
# Copyright (c) 2025 EASE lab
44
#
55
# Permission is hereby granted, free of charge, to any person obtaining a copy
66
# of this software and associated documentation files (the "Software"), to deal
@@ -30,8 +30,8 @@ COPY ./benchmarks/graph-bfs/python/requirements.txt ./
3030
RUN pip3 install --user -r requirements.txt
3131
COPY ./utils/tracing/python/tracing.py ./
3232
COPY ./benchmarks/graph-bfs/python/server.py ./
33-
ADD https://raw.githubusercontent.com/vhive-serverless/vSwarm-proto/refs/heads/graph-benchmark/proto/graph_bfs/graph_bfs_pb2_grpc.py ./
34-
ADD https://raw.githubusercontent.com/vhive-serverless/vSwarm-proto/refs/heads/graph-benchmark/proto/graph_bfs/graph_bfs_pb2.py ./proto/graph_bfs/
33+
ADD https://raw.githubusercontent.com/vhive-serverless/vSwarm-proto/refs/heads/main/proto/graph_bfs/graph_bfs_pb2_grpc.py ./
34+
ADD https://raw.githubusercontent.com/vhive-serverless/vSwarm-proto/refs/heads/main/proto/graph_bfs/graph_bfs_pb2.py ./proto/graph_bfs/
3535

3636
# Second stage (Runner):
3737
FROM vhiveease/python-slim:latest as graphBfsPython

benchmarks/graph-bfs/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MIT License
22

3-
# Copyright (c) 2022 EASE lab
3+
# Copyright (c) 2025 EASE lab
44

55
# Permission is hereby granted, free of charge, to any person obtaining a copy
66
# of this software and associated documentation files (the "Software"), to deal
@@ -20,7 +20,7 @@
2020
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
# SOFTWARE.
2222

23-
FUNCTIONS = graph-bfs-python
23+
FUNCTIONS = graph-bfs-python-image
2424
ALL_IMAGES = $(FUNCTIONS)
2525

2626
ROOT = ../../

benchmarks/graph-bfs/python/server.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# MIT License
44

5-
# Copyright (c) 2022 EASE lab
5+
# Copyright (c) 2025 EASE lab
66

77
# Permission is hereby granted, free of charge, to any person obtaining a copy
88
# of this software and associated documentation files (the "Software"), to deal
@@ -54,46 +54,46 @@
5454
parser.add_argument("-a", "--addr", dest="addr", default="0.0.0.0", help="IP address")
5555
parser.add_argument("-p", "--port", dest="port", default="50051", help="serve port")
5656
parser.add_argument("-zipkin", "--zipkin", dest="url", default="http://0.0.0.0:9411/api/v2/spans", help="Zipkin endpoint url")
57+
parser.add_argument("--vertices", dest="vertices", default="100000", help="Number of vertices")
58+
parser.add_argument("--edges", dest="edges", default="1000000", help="Number of edges")
59+
5760
args = parser.parse_args()
5861

62+
63+
5964
if tracing.IsTracingEnabled():
6065
tracing.initTracer("graph_bfs", url=args.url)
6166
tracing.grpcInstrumentClient()
6267
tracing.grpcInstrumentServer()
6368

64-
def graph_bfs(dur):
69+
70+
def graph_bfs(g, dur, num_vertices):
6571
"""
66-
Builds a large random graph and performs random BFS traversals for the specified duration (in milliseconds).
72+
Performs random BFS traversals for the specified duration (in milliseconds).
6773
Returns the number of BFS traversals performed.
6874
"""
69-
# Parameters for a massive graph (adjust as needed for your system's memory)
70-
num_vertices = 100000 # 100k nodes
71-
num_edges = 1000000 # 1M edges
72-
73-
# Build a random graph
74-
g = igraph.Graph.Erdos_Renyi(n=num_vertices, m=num_edges, directed=False)
75-
7675
start_time = time.time()
7776
bfs_count = 0
7877
dur_sec = dur / 1000.0
79-
8078
while (time.time() - start_time) < dur_sec:
8179
root = random.randint(0, num_vertices - 1)
82-
# Perform BFS from a random root
8380
_ = g.bfs(root)
8481
bfs_count += 1
85-
8682
return bfs_count
8783

8884

85+
8986
class GraphBFSBenchmark(graph_bfs_pb2_grpc.GraphBFSBenchmarkServicer):
87+
def __init__(self):
88+
self.num_vertices = int(args.vertices)
89+
num_edges = int(args.edges)
90+
self.g = igraph.Graph.Erdos_Renyi(n=self.num_vertices, m=num_edges, directed=False)
9091

9192
def GetBfs(self, request, context):
9293
with tracing.Span("Run graph_bfs"):
93-
dur = int(request.name) # Duration the function must run for in milliseconds
94-
bfs_count = graph_bfs(dur)
94+
dur = int(request.name) # Duration the function must run for in milliseconds
95+
bfs_count = graph_bfs(self.g, dur, self.num_vertices)
9596

96-
gid = syscall(104)
9797
msg = f"fn: graph_bfs | duration_ms: {dur} | bfs_count: {bfs_count} | runtime: python"
9898
return graph_bfs_pb2.GraphBFSBenchmarkReply(message=msg)
9999

benchmarks/graph-bfs/yamls/docker-compose/dc-graph-bfs-python.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MIT License
22

3-
# Copyright (c) 2022 EASE lab
3+
# Copyright (c) 2025 EASE lab
44

55
# Permission is hereby granted, free of charge, to any person obtaining a copy
66
# of this software and associated documentation files (the "Software"), to deal
@@ -30,6 +30,8 @@ services:
3030
- /app/server.py
3131
- --addr=0.0.0.0
3232
- --port=50051
33+
- --vertices=100000
34+
- --edges=1000000
3335
ports:
3436
- target: 50051
3537

benchmarks/graph-bfs/yamls/knative/kn-graph-bfs-python.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MIT License
22

3-
# Copyright (c) 2022 EASE lab
3+
# Copyright (c) 2025 EASE lab
44

55
# Permission is hereby granted, free of charge, to any person obtaining a copy
66
# of this software and associated documentation files (the "Software"), to deal
@@ -42,4 +42,6 @@ spec:
4242
- image: docker.io/vhiveease/graph-bfs-python:latest
4343
args:
4444
- --addr=0.0.0.0
45-
- --port=50051
45+
- --port=50051
46+
- --vertices=100000
47+
- --edges=1000000

tools/invoker/client.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,6 @@ func runExperiment(endpoints []*endpoint.Endpoint, runDuration int, targetRPS fl
142142
}
143143
}
144144
latSlice.Lock()
145-
var maxLatency int64
146-
maxLatency = 0
147-
for _, value := range latSlice.slice {
148-
if value > maxLatency {
149-
maxLatency = value
150-
}
151-
}
152145
latSlice.slice = []int64{}
153146
latSlice.Unlock()
154147
profSlice.Lock()

tools/profiler/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ optional arguments:
5353
python3 main.py profile
5454
```
5555

56-
The functions to be profiled are stored in an input JSON file named `config.json` by default(the user can utilize `-config` or `--config_file` to change this argument). The standard structure of this file is a list of json objects: a list of `predeployment-commands`, `postdeployment-commands` and `yaml-location`. A compressed config file consisting of all the functions that can currently be profiled in the vSwarm suite has been provided.
56+
The functions to be profiled are stored in an input JSON file named `config.json` by default (the user can utilize `-config` or `--config_file` to change this argument). The standard structure of this file is a list of JSON objects: a list of `predeployment-commands`, `postdeployment-commands`, and `yaml-location`. A compressed config file consisting of all the functions that can currently be profiled in the vSwarm suite has been provided.
5757

5858
An example input file can look like this:
5959
```json

tools/profiler/config.json.gz

-1.38 KB
Binary file not shown.

tools/profiler/profile.json.gz

-29 KB
Binary file not shown.

0 commit comments

Comments
 (0)