Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -388,3 +388,8 @@ $RECYCLE.BIN/
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/vim,visualstudiocode,go,intellij+all,windows,linux,macos,python


/results
/finalTests
/numCyclesTest
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

# vSwarm-RISCV Serverless Benchmarking Suite
This fork of the original repository contains a port of the benchmark suite to the RISC-V ISA. This work has been developed within the framework of the Vitamin-V project (Horizon Europe 101093062) 2023-2025. Our goal was to remain as close as possible to the structure and implementation of the original repository in order to preserve consistency and comparability. In addition, we provide the [riscv-perf-client](./tools/riscv-perf-client), which enables manual compilation of the client responsible for sending requests to the containers. Furthermore, we also provide two Python scripts: one for executing the functions that were ported, and another for parsing the results and generating a tab-separated .txt file suitable for direct import into spreadsheet software.

If you use this repo, please also cite our IISWC 2025 short paper:

```
@inproceedings {Pournaras:2025,
author = { Pournaras, Georgios and Karakostas, Vasileios and Papadimitriou, George and Gizopoulos, Dimitris },
booktitle = { 2025 IEEE International Symposium on Workload Characterization (IISWC) },
title = {{ Benchmarking Support for RISC-V CPUs in Serverless Computing }},
year = {2025},
volume = {},
ISSN = {},
pages = {520-523},
keywords = {Bridges;Microarchitecture;Runtime;Operating systems;Serverless computing;Computer architecture;Benchmark testing;Market research;Energy efficiency;Optimization},
doi = {10.1109/IISWC66894.2025.00050},
url = {https://doi.ieeecomputersociety.org/10.1109/IISWC66894.2025.00050},
publisher = {IEEE Computer Society},
address = {Los Alamitos, CA, USA},
month =Oct}
```



# vSwarm - Serverless Benchmarking Suite

Expand Down
33 changes: 22 additions & 11 deletions benchmarks/aes/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,18 @@

clean: clean-proto

DOCKER_HUB_ACCOUNT=caldiuoa

ROOT = ../../

ARCH := $(shell uname -m)

ifeq ($(ARCH),riscv64)
DOCKERFILE := docker/riscv.Dockerfile
else
DOCKERFILE := docker/Dockerfile
endif

FUNCTIONS = aes-python aes-nodejs aes-go
ALL_IMAGES = $(addsuffix -image, $(FUNCTIONS))
ALL_LAMBDA_IMAGES = $(addsuffix -lambda-image, $(FUNCTIONS))
Expand All @@ -41,27 +50,29 @@ all-image: $(ALL_IMAGES)

all-lambda-image: $(ALL_LAMBDA_IMAGES)

aes-python-image: docker/Dockerfile python/server.py


aes-python-image: $(DOCKERFILE) python/server.py
DOCKER_BUILDKIT=1 docker buildx build \
--tag vhiveease/aes-python:latest \
--tag $(DOCKER_HUB_ACCOUNT)/aes-python:latest \
--target aesPython \
-f docker/Dockerfile \
-f $(DOCKERFILE) \
$(ROOT) --load


aes-nodejs-image: docker/Dockerfile nodejs/server.js
aes-nodejs-image: $(DOCKERFILE) nodejs/server.js
DOCKER_BUILDKIT=1 docker buildx build --progress=plain \
--tag vhiveease/aes-nodejs:latest \
--tag $(DOCKER_HUB_ACCOUNT)/aes-nodejs:latest \
--target aesNodeJS \
-f docker/Dockerfile \
-f $(DOCKERFILE) \
$(ROOT) --load


aes-go-image: docker/Dockerfile go/server.go
aes-go-image: $(DOCKERFILE) go/server.go
DOCKER_BUILDKIT=1 docker buildx build \
--tag vhiveease/aes-go:latest \
--tag $(DOCKER_HUB_ACCOUNT)/aes-go:latest \
--target aesGo \
-f docker/Dockerfile \
-f $(DOCKERFILE) \
$(ROOT) --load


Expand Down Expand Up @@ -91,7 +102,7 @@ aes-go-lambda-image: docker/Dockerfile.Lambda go/server.go
## Push images

push-%: %-image
docker push docker.io/vhiveease/$(subst push-,,$@):latest
docker push docker.io/$(DOCKER_HUB_ACCOUNT)/$(subst push-,,$@):latest

push-%-lambda: %-lambda-image
aws ecr get-login-password --region $(AWS_REGION) | \
Expand All @@ -105,7 +116,7 @@ push: $(addprefix push-, $(FUNCTIONS)) $(addprefix push-, $(addsuffix -lambda, $
## Pull images from docker hub

pull-%:
docker pull docker.io/vhiveease/$(subst pull-,,$@):latest
docker pull docker.io/$(DOCKER_HUB_ACCOUNT)/$(subst pull-,,$@):latest

pull-%-lambda:
docker pull $(AWS_ACCOUNT_ID).dkr.ecr.$(AWS_REGION).amazonaws.com/$(subst pull-,,$@):latest
Expand Down
102 changes: 102 additions & 0 deletions benchmarks/aes/docker/riscv.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# MIT License
#
# Copyright (c) 2022 David Schall and EASE lab
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

# #---------- PYTHON -----------#
# # First stage (Builder):
# # Install gRPC and all other dependencies


# docker build --tag caldiuoa/aes-python:riscv64_noble --target aesPython -f ./docker/Dockerfile ../../
# docker push caldiuoa/aes-python:riscv64_noble
FROM --platform=riscv64 caldiuoa/python-base:3.10-grpc-only-1.71 as aesPythonBuilder

WORKDIR /py
COPY ./benchmarks/aes/python/requirements/requirements-riscv.txt ./requirements.txt
RUN pip3 install --user -r requirements.txt
COPY ./utils/tracing/python/tracing.py ./
COPY ./benchmarks/aes/python/server.py ./
# RUN apt-get update && apt-get install -y libc-ares2 libabsl-dev libprotobuf23
ADD https://raw.githubusercontent.com/vhive-serverless/vSwarm-proto/v0.3.0/proto/aes/aes_pb2_grpc.py ./
ADD https://raw.githubusercontent.com/vhive-serverless/vSwarm-proto/v0.3.0/proto/aes/aes_pb2.py ./proto/aes/

# # Second stage (Runner):
FROM --platform=riscv64 caldiuoa/python-base:3.10-runner as aesPython
# FROM cartesi/python:3.12-slim-noble as aesPython
COPY --from=aesPythonBuilder /root/.local /root/.local
COPY --from=aesPythonBuilder /py /app
COPY --from=aesPythonBuilder /usr/lib/riscv64-linux-gnu/libatomic.so* /usr/lib/riscv64-linux-gnu/

WORKDIR /app
ENV PATH=/root/.local/bin:$PATH
ENV LD_PRELOAD /usr/lib/riscv64-linux-gnu/libatomic.so.1
ENTRYPOINT [ "python", "/app/server.py" ]


#---------- GoLang -----------#
# First stage (Builder):
FROM --platform=riscv64 caldiuoa/go-base:1.21-riscv64 AS aesGoBuilder
USER root
WORKDIR /app/app/
RUN apk add git ca-certificates

COPY ./utils/tracing/go ../../utils/tracing/go
COPY ./benchmarks/aes/go/go.mod ./
COPY ./benchmarks/aes/go/go.sum ./
COPY ./benchmarks/aes/go/server.go ./

RUN go mod tidy
RUN CGO_ENABLED=0 GOARCH=riscv64 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o ./server server.go

# Second stage (Runner):
FROM scratch as aesGo

WORKDIR /app/
COPY --from=aesGoBuilder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=aesGoBuilder /app/app/server .

ENTRYPOINT [ "/app/server" ]


#---------- NodeJS -----------#
# First stage (Builder):
FROM caldiuoa/node-base:jammy-builder AS aesNodeJSBuild
WORKDIR /app/

COPY ./utils/tracing/nodejs ./utils/tracing/nodejs
COPY ./benchmarks/aes/nodejs/package.json ./
RUN npm set progress=false && npm config set depth 0
RUN npm install --only=production

COPY ./benchmarks/aes/nodejs/server.js ./
ADD https://raw.githubusercontent.com/vhive-serverless/vSwarm-proto/v0.3.0/proto/aes/aes.proto ./

# Second stage (Runner):
FROM caldiuoa/node-base:alpine-runner AS aesNodeJS
WORKDIR /app/
COPY --from=aesNodeJSBuild /app/ .

ENTRYPOINT [ "node", "server.js" ]

EXPOSE 50051



9 changes: 9 additions & 0 deletions benchmarks/aes/python/requirements/requirements-riscv.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
opentelemetry-api==1.3.0
opentelemetry-exporter-zipkin==1.3.0
opentelemetry-exporter-zipkin-json==1.3.0
opentelemetry-exporter-zipkin-proto-http==1.3.0
opentelemetry-instrumentation==0.22b0
opentelemetry-instrumentation-grpc==0.22b0
opentelemetry-sdk==1.3.0
opentelemetry-semantic-conventions==0.22b0
pyaes==1.6.1
46 changes: 22 additions & 24 deletions tools/relay/Makefile → ...yamls/docker-compose/dc-aes-go-riscv.yaml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,25 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.


ROOT = ../../

all: relay relay-docker

relay:
go mod tidy
go build -v -o ./server github.com/vhive-serverless/vSwarm/tools/relay

relay-docker:
DOCKER_BUILDKIT=1 \
docker build \
--tag vhiveease/relay:latest \
--target relay \
-f Dockerfile \
$(ROOT)

## Push images
push:
docker push docker.io/vhiveease/relay:latest

## Pull images from docker hub
pull:
docker pull docker.io/vhiveease/relay:latest
version: "3.9"
services:
aes-go:
image: caldiuoa/aes-go:latest
container_name: aes-go
entrypoint:
- /app/server
- --addr=0.0.0.0:50051
ports:
- target: 50051

relay:
image: caldiuoa/relay:latest
entrypoint:
- /app/server
- --addr=0.0.0.0:50000
- --function-endpoint-url=aes-go
- --function-endpoint-port=50051
- --function-name=aes-go
ports:
- published: 50000
target: 50000
46 changes: 46 additions & 0 deletions benchmarks/aes/yamls/docker-compose/dc-aes-nodejs-riscv copy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# MIT License

# Copyright (c) 2022 EASE lab

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:

# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

version: "3.9"
services:
aes-nodejs:
image: caldiuoa/aes-nodejs:latest
container_name: aes-nodejs
entrypoint:
- node
- server.js
- --addr=0.0.0.0
- --port=50051
ports:
- target: 50051

relay:
image: caldiuoa/relay:latest
entrypoint:
- /app/server
- --addr=0.0.0.0:50000
- --function-endpoint-url=aes-nodejs
- --function-endpoint-port=50051
- --function-name=aes-nodejs
ports:
- published: 50000
target: 50000
46 changes: 46 additions & 0 deletions benchmarks/aes/yamls/docker-compose/dc-aes-nodejs-riscv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# MIT License

# Copyright (c) 2022 EASE lab

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:

# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

version: "3.9"
services:
aes-nodejs:
image: caldiuoa/aes-nodejs:latest
container_name: aes-nodejs
entrypoint:
- node
- server.js
- --addr=0.0.0.0
- --port=50051
ports:
- target: 50051

relay:
image: caldiuoa/relay:latest
entrypoint:
- /app/server
- --addr=0.0.0.0:50000
- --function-endpoint-url=aes-nodejs
- --function-endpoint-port=50051
- --function-name=aes-nodejs
ports:
- published: 50000
target: 50000
Loading