Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f861525
[system] Add CLI option to just build code package
mcopik Jul 8, 2024
0d220b7
[system] Additional logging
mcopik Jul 8, 2024
e41e04b
[system] Add CLI tool to update SeBS images
mcopik Jul 13, 2024
50886e6
[storage] Make container removal optional
mcopik Mar 26, 2025
313f69c
[system] Add CLI option to just build code package
mcopik Jul 8, 2024
cb98ffc
[system] Fix wrong logging in cache
mcopik Mar 7, 2026
e137545
[system] Update build routine to also work with containers
mcopik Mar 7, 2026
b48b696
[docs] Document new build option
mcopik Mar 7, 2026
c26adfe
[system] Refactor tools script for Docker build: add Docker tag gener…
mcopik Mar 8, 2026
b2ba550
[system] Update local images due to end of support for older Debian v…
mcopik Mar 8, 2026
dda3179
[azure] Deprecate Python 3.7 and 3.8 - EOL
mcopik Mar 8, 2026
502f731
[azure] Upgrade Node for manage image
mcopik Mar 8, 2026
5bb6d4a
[dev] Linting
mcopik Mar 8, 2026
73a9cb6
[system] Replace build_docker_images script with a native CLi integra…
mcopik Mar 8, 2026
572939b
[aws] Deprecate Python 3.8
mcopik Mar 8, 2026
37ab1fa
[system] Linting
mcopik Mar 8, 2026
2ffaeb5
[system] Remove unnecessary tool
mcopik Mar 8, 2026
9edb151
[system] Update changelog
mcopik Mar 8, 2026
01b535f
[docs] Add developer guide
mcopik Mar 8, 2026
62b292f
[aws] Pin specific images
mcopik Mar 8, 2026
611efa7
[docs] Minor fixes
mcopik Mar 8, 2026
cdfcad0
[aws] Fix bug in incorrect login to ECR
mcopik Mar 8, 2026
050e958
[gcp] Add missing dependency
mcopik Mar 8, 2026
7a223ef
[dev] Linting
mcopik Mar 8, 2026
ab15ddb
[system][aws] Add feature of cleaning resources, implemented for AWS.
mcopik Mar 9, 2026
c3c31dd
[docs] Expand documentation on resource allocation
mcopik Mar 10, 2026
c4058ca
Merge remote-tracking branch 'origin/master' into feature/better-cli
mcopik Mar 10, 2026
dbf2787
[dev] Linting
mcopik Mar 10, 2026
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
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@

### Improvements

* Integrated SeBS container management into main CLI driver (#243).
* New option of building FaaS code package without actual deployment (#243).
* Comprehensive docstrings across codebase (#244)
* Sphinx-based HTML documentation with API reference (#244)
* Update linting process (#241)
Expand All @@ -84,8 +86,11 @@
### Deprecations

* Python 3.6 no longer supported on all platforms
* AWS: Python 3.8 is no longer supported.
* Azure: Python 3.7 and 3.8 no longer supported.
* GCP: Node.js 14 and 16 are deprecated.
* Node.js 8, 10, 12 deprecated on various platforms
* Older runtime versions phased out across AWS, Azure, and GCP.
* Older runtime versions phased out on Azure.

### Contributors

Expand Down
22 changes: 9 additions & 13 deletions config/systems.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
"nodejs": {
"base_images": {
"x64": {
"14": "node:14-slim",
"16": "node:16-slim",
"18": "node:18-slim",
"20": "node:20-slim"
"14": "ubuntu:22.04",
"16": "ubuntu:22.04",
"18": "ubuntu:22.04",
"20": "ubuntu:22.04"
}
},
"images": [
Expand All @@ -74,16 +74,14 @@
"python": {
"base_images": {
"x64": {
"3.11": "amazon/aws-lambda-python:3.11",
"3.10": "amazon/aws-lambda-python:3.10",
"3.9": "amazon/aws-lambda-python:3.9",
"3.8": "amazon/aws-lambda-python:3.8"
"3.11": "amazon/aws-lambda-python:3.11.2024.05.23.18",
"3.10": "amazon/aws-lambda-python:3.10.2024.06.19.12",
"3.9": "amazon/aws-lambda-python:3.9.2024.05.21.00"
},
"arm64": {
"3.11": "amazon/aws-lambda-python:3.11.2024.05.23.17",
"3.10": "amazon/aws-lambda-python:3.10.2024.06.19.11",
"3.9": "amazon/aws-lambda-python:3.9.2024.05.20.23",
"3.8": "amazon/aws-lambda-python:3.8.2024.09.05.16"
"3.9": "amazon/aws-lambda-python:3.9.2024.05.20.23"
}
},
"images": [
Expand All @@ -103,7 +101,7 @@
"nodejs": {
"base_images": {
"x64": {
"16": "amazon/aws-lambda-nodejs:16"
"16": "amazon/aws-lambda-nodejs:16.2024.09.06.14"
},
"arm64": {
"16": "amazon/aws-lambda-nodejs:16.2024.09.06.13"
Expand Down Expand Up @@ -176,8 +174,6 @@
"python": {
"base_images": {
"x64": {
"3.7": "mcr.microsoft.com/azure-functions/python:3.0-python3.7",
"3.8": "mcr.microsoft.com/azure-functions/python:3.0-python3.8",
"3.9": "mcr.microsoft.com/azure-functions/python:3.0-python3.9",
"3.10": "mcr.microsoft.com/azure-functions/python:4-python3.10",
"3.11": "mcr.microsoft.com/azure-functions/python:4-python3.11"
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/azure/Dockerfile.manage
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN apt-get clean && apt-get update\
&& apt-get update\
&& apt-get install -y azure-cli azure-functions-core-tools-3\
# Install NodeJS 14.x to test functions locally with func host
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt-get install -y nodejs\
&& curl -sL https://deb.nodesource.com/setup_18.x | bash - && apt-get install -y nodejs\
Comment on lines 16 to +18
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

Azure Functions Core Tools Node.js 18 compatibility requirements

💡 Result:

What you need for Node.js 18 with Azure Functions Core Tools

1) Azure-hosted support status (important)

As of the current Azure Functions runtime support matrix, Node.js 18 isn’t listed as a supported Node.js version for Azure Functions apps (supported versions shown are Node 20 (GA), Node 22 (GA), Node 24 (Preview)). That means Node 18 is effectively unsupported for production on Azure Functions even if it may still run in some setups. [1]

2) If you still want to run Node 18 (typically local / legacy scenarios)

  • Use Azure Functions runtime v4 (Functions Core Tools v4 targets the v4 runtime).
  • For the Node.js programming model v4 (@azure/functions 4.x), you need:
    • Functions runtime >= v4.25 when running in Azure, or
    • Azure Functions Core Tools >= 4.0.5382 when running locally. [2][3]
  • The Node.js developer reference shows Node 18 as compatible with:
    • Programming model v4.x on Functions runtime v4.25+
    • Programming model v3.x on Functions runtime v4.x [3]

Practical takeaway

  • For Azure deployment today: target Node 20/22 (or 24 preview), not 18. [1]
  • For local dev / older apps: Core Tools v4.0.5382+ + Functions runtime v4.25+ is the key threshold if you’re using the Node programming model v4. [2][3]

Sources: [1] [2] [3]


🏁 Script executed:

# Check npm registry for azure-functions-core-tools versions and their dependencies
curl -s https://registry.npmjs.org/azure-functions-core-tools | jq '.versions | keys | .[-20:]'

Repository: spcl/serverless-benchmarks

Length of output: 349


🏁 Script executed:

# Get more details on the latest versions
curl -s https://registry.npmjs.org/azure-functions-core-tools | jq '.versions | to_entries | map(select(.key >= "4.0.0")) | .[0:5] | map({version: .key, engines: .value.engines})'

Repository: spcl/serverless-benchmarks

Length of output: 487


Upgrade Azure Functions Core Tools to v4 for Node.js 18 compatibility.

Azure Functions Core Tools v3 does not support Node.js 18. For local development with Node.js 18, Core Tools v4.0.5382+ is required. Additionally, Node.js 18 itself is unsupported in production on Azure Functions (use Node 20, 22, or 24 instead). Update the Core Tools version and fix the stale comment on line 17 that still references Node 14.x.

Suggested fix
-  && apt-get install -y azure-cli azure-functions-core-tools-3\
+  && apt-get install -y azure-cli azure-functions-core-tools-4\
-# Install NodeJS 14.x to test functions locally with func host
+# Install NodeJS 18.x to test functions locally with func host
   && curl -sL https://deb.nodesource.com/setup_18.x | bash - && apt-get install -y nodejs\
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
&& apt-get install -y azure-cli azure-functions-core-tools-3\
# Install NodeJS 14.x to test functions locally with func host
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt-get install -y nodejs\
&& curl -sL https://deb.nodesource.com/setup_18.x | bash - && apt-get install -y nodejs\
&& apt-get install -y azure-cli azure-functions-core-tools-4\
# Install NodeJS 18.x to test functions locally with func host
&& curl -sL https://deb.nodesource.com/setup_18.x | bash - && apt-get install -y nodejs\
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@dockerfiles/azure/Dockerfile.manage` around lines 16 - 18, The Dockerfile
currently installs azure-functions-core-tools-3 which is incompatible with
Node.js 18 and still has a stale comment referencing Node 14.x; update the
installation to Azure Functions Core Tools v4 (ensure version >= 4.0.5382)
instead of v3 and change the comment to reflect Node 18 (or note production
recommendation of Node 20/22/24), e.g., replace references to
azure-functions-core-tools-3 with the v4 package/source and update the comment
about Node version accordingly where the Node setup and install lines (curl |
bash setup_18.x and apt-get install nodejs) are located.

&& apt-get purge -y --auto-remove curl lsb-release gnupg

# https://github.com/moby/moby/issues/20295
Expand Down
10 changes: 8 additions & 2 deletions dockerfiles/local/nodejs/Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
ARG VERSION
ENV NVM_DIR=/nvm

RUN apt-get update\
&& apt-get install -y --no-install-recommends zip gosu\
&& apt-get purge -y --auto-remove
&& apt-get install -y --no-install-recommends ca-certificates zip gosu wget\
&& apt-get purge -y --auto-remove \
&& update-ca-certificates \
&& mkdir -p ${NVM_DIR} && wget -O- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash \
&& . ${NVM_DIR}/nvm.sh && nvm install ${VERSION} && nvm alias default ${VERSION} && nvm use default

RUN mkdir -p /sebs/
COPY dockerfiles/nodejs_installer.sh /sebs/installer.sh
Expand All @@ -12,5 +17,6 @@ RUN chmod +x /sebs/entrypoint.sh

# useradd and groupmod is installed in /usr/sbin which is not in PATH
ENV SCRIPT_FILE=/mnt/function/package.sh
ENV PATH="$NVM_DIR/versions/node/v$(cat $NVM_DIR/alias/default)/bin:$PATH"
CMD /bin/bash /sebs/installer.sh
ENTRYPOINT ["/sebs/entrypoint.sh"]
17 changes: 12 additions & 5 deletions dockerfiles/local/nodejs/Dockerfile.run
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
ARG VERSION
ENV NVM_DIR=/nvm

RUN deps=''\
&& apt-get update\
&& apt-get install -y --no-install-recommends curl net-tools gosu python3 sudo ${deps}\
&& apt-get purge -y --auto-remove ${deps}
RUN apt-get update\
&& apt-get install -y --no-install-recommends ca-certificates zip gosu curl net-tools python3 sudo\
&& apt-get purge -y --auto-remove \
&& update-ca-certificates \
&& mkdir -p ${NVM_DIR} && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash \
&& . ${NVM_DIR}/nvm.sh && nvm install ${VERSION} && nvm alias default ${VERSION} && nvm use default

ENV SCRIPT_FILE=/mnt/function/package.sh
ENV PATH="$NVM_DIR/versions/node/v$(cat $NVM_DIR/alias/default)/bin:$PATH"

RUN mkdir -p /sebs
RUN cd /sebs/ && npm install -g uuid strftime express minio
RUN . ${NVM_DIR}/nvm.sh && cd /sebs/ && npm install -g uuid strftime express minio
# NODE_PATH=$(npm root --quiet -g)
# https://github.com/moby/moby/issues/29110
ENV NODE_PATH=/usr/local/lib/node_modules
Expand Down
123 changes: 123 additions & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Developer Guide

This guide provides essential information for developers contributing to SeBS.

## Table of Contents

- [Code Quality](#code-quality)
- [Docker Images](#docker-images)
- [Project Structure](#project-structure)

## Code Quality

SeBS enforces code quality through four tools:
* **Black** formats Python code to ensure consistent style across the codebase.
* **mypy** performs static type checking to catch type-related errors.
* **flake8** checks for style violations, unused imports, and potential bugs.
* **interrogate** checks that all classes and methods have Python docstrings.

Run `tools/linting.py sebs` to apply formatting and check code quality.

## Docker Images

SeBS uses Docker images for building functions and running benchmarks:
* **build**: For installing dependencies in an environment matching the execution sandbox
* **run**: Language-based images for local function invocations
* **manage**: Management images (e.g., Azure CLI for resource management)
* **dependencies**: Special images for C++ dependencies (OpenCV, Boost, etc.)
* **function**: Benchmark-specific images for container deployments

### Docker Image Naming Convention

Infrastructure images follow this naming pattern:
```
{repository}:{type}.{platform}[.{language}[.{version}]]-{sebs-version}
```

Examples:
- `spcleth/serverless-benchmarks:build.aws.python.3.9-1.2.0`
- `spcleth/serverless-benchmarks:run.local.nodejs.16-1.2.0`
- `spcleth/serverless-benchmarks:manage.azure-1.2.0`

### Docker Image Build

Our CLI provides image management for all images except for `function` images,
as these are built and pushed as part of the benchmark deployment process:

```bash
# Build all images for all platforms
./sebs.py docker build

# Build all images for a specific platform
./sebs.py docker build --deployment aws

# Build images for a specific language and version
./sebs.py docker build --deployment aws --language python --language-version 3.9

# Build specific image type
./sebs.py docker build --deployment aws --language python --image-type build

# Build for specific architecture
./sebs.py docker build --deployment aws --architecture x64

# Build C++ dependencies
./sebs.py docker build --deployment local --language cpp --image-type dependencies --dependency-type opencv
```

### Pushing Images

Push locally-built infrastructure images to DockerHub (requires authentication):

```bash
# Push all images for a platform
./sebs.py docker push --deployment aws
```

## Project Structure

```
sebs/
├── sebs.py # Main CLI entry point
├── install.py # Installation script
├── sebs/ # Main Python package
│ ├── __init__.py
│ ├── sebs.py # Core SeBS class
│ ├── cache.py # Caching system of cloud resources
│ ├── benchmark.py # Benchmark core class
│ ├── docker_builder.py # Docker image build/push operations
│ ├── config.py # SeBS configuration management
│ ├── faas/ # FaaS platform abstractions
│ │ ├── system.py # Base FaaS system
│ │ ├── function.py # Functions and triggers
│ │ ├── storage.py # Storage abstractions
│ │ └── container.py # Platform Docker containers
│ ├── aws/ # AWS Lambda implementation
│ ├── azure/ # Azure Functions implementation
│ ├── gcp/ # Google Cloud Functions implementation
│ ├── openwhisk/ # OpenWhisk implementation
│ ├── local/ # Local Docker deployment
│ ├── storage/ # Storage implementations (Minio, ScyllaDB)
│ ├── experiments/ # Experiment implementations
│ └── regression.py # Regression testing
├── benchmarks/ # Benchmark source code
│ ├── 000.microbenchmarks/ # Microbenchmarks (sleep, experiments)
│ ├── 100.webapps/ # Web application benchmarks
│ ├── 200.multimedia/ # Multimedia processing benchmarks
│ ├── 300.utilities/ # Utility benchmarks
│ ├── 400.inference/ # ML inference benchmarks
│ ├── 500.scientific/ # Scientific computing benchmarks
│ └── wrappers/ # Platform-specific wrappers
├── benchmarks-data/ # Git submodule with input data
├── dockerfiles/ # Dockerfiles for all image types
│ ├── aws/
│ ├── azure/
│ ├── gcp/
│ ├── local/
│ └── openwhisk/
├── config/ # Configuration files
│ ├── example.json # Example configuration
│ └── systems.json # System/platform definitions
├── tools/ # Utility scripts
├── docs/ # Documentation
```

60 changes: 60 additions & 0 deletions docs/resource-management.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Resource Management

SeBS allocates cloud resources automatically on first use and reuses them across subsequent runs.
This document explains how resources are identified, named, and cleaned up.

## Resource ID

Every SeBS deployment is assigned a **`resources_id`** — a short, unique identifier that acts as a namespace for all cloud resources belonging to that deployment.
It is stored in the `Resources` base class (`sebs/faas/config.py`) and persisted in the local cache so that subsequent runs reuse the same resources rather than allocating new ones. The ID is generated in one of two ways:

- **Without a user prefix**: an 8-character UUID fragment, e.g. `a1b2c3d4`
- **With a user prefix**: `{prefix}-{8-char UUID}`, e.g. `myexp-a1b2c3d4`

The prefix is optional and can be supplied via the platform configuration.
When a prefix is provided, SeBS first scans existing cloud resources for a deployment whose ID contains that prefix and reuses it if found.
A new ID is only generated when no match exists.

After a deployment's resources are created, their identifiers are written to the local cache:
This means a typical repeated benchmark run performs no cloud resource allocation at all.

## Resource Naming

Every cloud object created by SeBS embeds the `resources_id` in its name.
This guarantees isolation between concurrent deployments (different users, CI runs, or experiments) and makes it straightforward to identify which resources belong to which deployment.

### Storage Buckets

Bucket names follow the pattern `sebs-{type}-{resources_id}`, where `type` is one of three predefined bucket roles:

| Type | Bucket name | Purpose |
|---|---|---|
| `deployment` | `sebs-deployment-{resources_id}` | Function deployment packages (ZIP files, containers) |
| `benchmarks` | `sebs-benchmarks-{resources_id}` | Benchmark input data |
| `experiments` | `sebs-experiments-{resources_id}` | Experiment results and output data |

### Serverless Functions

Each platform uses the same logical structure but applies platform-specific formatting rules. The general pattern is:

```
sebs-{resources_id}-{benchmark}-{language}-{language-version}-{architecture}[-docker]
```

For container-based AWS Lambda deployments the suffix `-docker` is appended to the function name.
Cloud platforms might apply additional character substitutions (`.` → `-`, `_` → `-`) to comply with their naming rules.

### AWS-Specific Resources

The AWS ECR repository used for container images is named `sebs-benchmarks-{resources_id}`, matching the benchmarks bucket pattern.


## Cleanup

Because every resource name embeds `resources_id`, SeBS can reliably enumerate and delete all resources associated with a deployment:
* Serverless functions
* Storage buckets and their contents
* NoSQL tables
* Platform-specific ancillary resources (HTTP APIs, CloudWatch log groups, ECR repositories, CosmosDB accounts, etc.)

After cleanup, the corresponding cache entries are removed so that a subsequent run starts fresh.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def replace_details_link(m):

# Pages whose content is loaded from docs/*.md one level above docs/source/
_DOC_PAGES = frozenset(
{"usage", "build", "design", "experiments", "modularity", "platforms", "storage"}
{"usage", "build", "design", "experiments", "modularity", "platforms", "storage", "resource-management"}
)


Expand Down
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ SeBS: Serverless Benchmark Suite
design
modularity
storage
resource-management

.. toctree::
:maxdepth: 2
Expand Down
1 change: 1 addition & 0 deletions docs/source/resource-management.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- Content loaded from docs/resource-management.md at Sphinx build time -->
Loading