Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5b6bc1f
[gcp] Add package deployment type to distinguish between gen1 and gen2
mcopik Apr 28, 2026
f61eb44
[gcp] Expose system variant for gen2 in the CLI
mcopik Apr 28, 2026
75c9936
[system] Add new functionalities to support multiple system variants
mcopik Apr 28, 2026
e29485d
[system] Support system variant suffices in function names
mcopik Apr 28, 2026
cb3a950
[dev] Linting
mcopik Apr 28, 2026
4abda81
[system] Forgotten function
mcopik Apr 28, 2026
abd97ec
[gcp] Implement basic functionalities of gen2 functions
mcopik Apr 28, 2026
e1da8e7
[system] Strengthen cache with per-instance locks and atomic replacement
mcopik Apr 28, 2026
1ff2b79
[dev] Linting
mcopik Apr 28, 2026
7db15cd
[system] First step towards ntroducing system variant
mcopik Apr 28, 2026
bea57da
[system] Introduce system variant everywhere
mcopik Apr 28, 2026
8469a53
[system] Remove container flags from the CLI directly
mcopik Apr 28, 2026
a5e8985
[system] Update configs with the new defaults
mcopik Apr 28, 2026
2bb0dd8
[experiment] Adapt to current interface
mcopik Apr 28, 2026
534b145
[system] Add default system variant
mcopik Apr 28, 2026
bb0c306
[system] Simplifications and corrections
mcopik Apr 28, 2026
b4f0789
[gcp] Adapt to the new interface
mcopik Apr 28, 2026
8525df1
[docs] Update
mcopik Apr 28, 2026
fa11328
[regression] Attempt to serialize gcp groups
mcopik Apr 28, 2026
82330de
[gcp] No ARM on GCP
mcopik Apr 28, 2026
eeb813b
[ci] Bump regression tests for GCP - serialized
mcopik Apr 29, 2026
a3811fd
[dev] Linting
mcopik Apr 29, 2026
9df3d12
[gcp] Fix regression
mcopik Apr 29, 2026
31eeead
[gcp] Additional check for correctness
mcopik Apr 29, 2026
e72b864
[docs] Update signature
mcopik Apr 29, 2026
2bc79d0
[gcp] Use previous language style always for storing container info
mcopik Apr 29, 2026
754ed43
[gcp] Fix envs for gen2 deployment
mcopik Apr 29, 2026
3a8b8ac
[system] Make code package size computing consistent
mcopik Apr 29, 2026
0a908f9
[system] Simplify and update caching
mcopik Apr 29, 2026
fa42a0a
[system] Fix bug in cache initialization
mcopik Apr 29, 2026
4557bb8
[gcp] Improve metrics polling for function v1
mcopik Apr 29, 2026
b6b6847
[system] Update cache modification methods
mcopik Apr 29, 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
2 changes: 1 addition & 1 deletion .github/workflows/_regression-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
uv pip install .
- name: Run regression tests
timeout-minutes: 10
timeout-minutes: 20
run: |
source .venv/bin/activate
uv run sebs benchmark regression test \
Expand Down
2 changes: 1 addition & 1 deletion configs/cpp.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"update_storage": false,
"download_results": false,
"architecture": "x64",
"container_deployment": true,
"system_variant": "package",
"runtime": {
"language": "cpp",
"version": "all"
Expand Down
4 changes: 2 additions & 2 deletions configs/example.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"update_code": false,
"update_storage": false,
"download_results": false,
"architecture": "x64",
"container_deployment": true,
"architecture": "x64",
"system_variant": "package",
"runtime": {
"language": "python",
"version": "3.11"
Expand Down
6 changes: 3 additions & 3 deletions configs/java.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"update_storage": false,
"download_results": false,
"architecture": "x64",
"container_deployment": false,
"system_variant": "package",
"runtime": {
"language": "java",
"version": "11"
"language": "java",
"version": "11"
},
"type": "invocation-overhead",
"perf-cost": {
Expand Down
2 changes: 1 addition & 1 deletion configs/nodejs.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"update_storage": false,
"download_results": false,
"architecture": "x64",
"container_deployment": true,
"system_variant": "package",
"runtime": {
"language": "nodejs",
"version": "20"
Expand Down
2 changes: 1 addition & 1 deletion configs/python.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"update_storage": false,
"download_results": false,
"architecture": "x64",
"container_deployment": true,
"system_variant": "package",
"runtime": {
"language": "python",
"version": "3.11"
Expand Down
6 changes: 3 additions & 3 deletions configs/systems.json
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,11 @@
}
},
"architecture": [
"x64",
"arm64"
"x64"
],
"deployments": [
"package",
"function-gen1",
"function-gen2",
"container"
]
},
Expand Down
2 changes: 1 addition & 1 deletion docs/modularity.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ This function has been retrieved from the cache and requires refreshing function
In practice, this is often limited to updating logging handlers - see existing implementations for details.

```python
def update_function(self, function: Function, code_package: Benchmark, container_deployment: bool, container_uri: str):
def update_function(self, function: Function, code_package: Benchmark, system_variant: SystemVariant, container_uri: str | None):
```
Comment on lines +378 to 379
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 | 🟡 Minor

Update the create_function() snippet in the same section.

update_function() is now documented with SystemVariant, but the create_function() example a few lines above still shows the old signature. Keeping both side by side will send new provider implementations to the wrong interface.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/modularity.md` around lines 378 - 379, The create_function() example is
out of sync with the updated update_function() signature; update the
create_function() snippet to match the new interface by adding the SystemVariant
parameter and the container_uri: str | None parameter (and use the same types
Function and Benchmark) so both examples use the same signature shape; adjust
any example calls/placeholder variables in the create_function() snippet to
accept and pass a SystemVariant and optional container_uri to avoid confusing
new provider implementations.


This function updates the function's code and configuration in the platform.
Expand Down
41 changes: 36 additions & 5 deletions docs/platforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,11 @@ or in the JSON input configuration:

### Deployment Modes

SeBS models two GCP deployment targets:
SeBS models three GCP deployment targets:

1. `function-gen1`: the first Google Cloud Functions Gen1 path.
2. `container`: direct container deployment to Cloud Run.

We plan also to add support for `function-gen2`, the current Google Cloud Functions Gen2 path.
2. `function-gen2`: Google Cloud Functions Gen2 package deployment.
3. `container`: direct container deployment to Cloud Run.
These deployment types intentionally share a single GCP backend in SeBS, but they are not identical in packaging, naming, scaling, or performance behavior.

On GCP, there are two different concurrency layers that should not be confused:
Expand Down Expand Up @@ -259,6 +258,37 @@ Gen1 configuration currently exposes instance-scaling controls:

Use Gen1 when you want the most established GCP path in SeBS and do not need container-level runtime tuning.

### Function Gen2

Gen2 reuses the same local ZIP packaging flow as Gen1, but deploys through the Cloud Functions v2 API. It is selected directly through the experiment-level `system_variant`:

```json
"deployment": {
"name": "gcp",
"gcp": {
"region": "europe-west1",
"project_name": "your-gcp-project-id",
"credentials": "/path/to/project-credentials.json",
"configuration": {
"function-gen2": {
"vcpus": 1,
"gcp-concurrency": 80,
"worker-concurrency": 1,
"worker-threads": 8,
"min-instances": 0,
"max-instances": 20,
"cpu-boost": false,
"cpu-throttle": true
}
}
}
}
```
Comment thread
coderabbitai[bot] marked this conversation as resolved.

Set `experiments.system_variant` to one of `function-gen1`, `function-gen2`, or `container`. From the CLI and regression workflows, the same selection is exposed through the generic `--system-variant` option.

Gen1 and Gen2 package deployments use separate SeBS cache identities and separate cloud function names with short `-gen1` and `-gen2` suffixes. This avoids control-plane races when switching between package modes. In practice, regression and benchmark runs should still select one GCP package mode at a time for a given run.

### Cloud Run Container Deployments

Container deployments are the currently implemented Cloud Run-based path in SeBS. They are selected with container deployment and use a provider-specific function image built from `Dockerfile.function`.
Expand Down Expand Up @@ -298,7 +328,8 @@ Cloud Run containers can [execute in two environments](https://docs.cloud.google

The current GCP backend has the following practical limits:
* Gen1 is the primary managed-functions deployment path today.
* Gen2 is planned and partially modeled in configuration, but not yet fully deployed through a dedicated strategy.
* Gen2 supports the ZIP package deployment path and HTTP triggers.
* Library-trigger direct invocation remains Gen1-only.
* Cloud Run containers are implemented today and provide the most tuning control.
* GCP deployments currently reject `arm64`, as arm64 instances are not available for GCR.
* C++ packaging is not supported on GCP (but possible to be implemented on containers).
Expand Down
23 changes: 12 additions & 11 deletions sebs/aws/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from sebs.benchmark import Benchmark
from sebs.cache import Cache
from sebs.config import SeBSConfig
from sebs.experiments.config import SystemVariant
from sebs.utils import LoggingHandlers
from sebs.faas.function import Function, ExecutionResult, Trigger, FunctionConfig
from sebs.faas.system import System
Expand Down Expand Up @@ -191,7 +192,7 @@ def package_code(
architecture: str,
benchmark: str,
is_cached: bool,
) -> Tuple[str, int]:
) -> Tuple[str, float]:
"""
Package code for deployment to AWS Lambda.

Expand Down Expand Up @@ -321,7 +322,7 @@ def create_function(
self,
code_package: Benchmark,
func_name: str,
container_deployment: bool,
system_variant: SystemVariant,
container_uri: str | None,
) -> "LambdaFunction":
"""
Expand All @@ -333,8 +334,8 @@ def create_function(
Args:
code_package: Benchmark code package
func_name: Name of the function
container_deployment: Whether to use container deployment
container_uri: URI of the container image (if container_deployment=True)
system_variant: Selected deployment variant
container_uri: URI of the container image (if container deployment is selected)

Returns:
LambdaFunction: The created or updated Lambda function
Expand Down Expand Up @@ -366,7 +367,7 @@ def create_function(
self.config.resources.lambda_role(self.session),
function_cfg,
)
self.update_function(lambda_function, code_package, container_deployment, container_uri)
self.update_function(lambda_function, code_package, system_variant, container_uri)
lambda_function.updated_code = True
# TODO: get configuration of REST API
except self.client.exceptions.ResourceNotFoundException:
Expand All @@ -379,7 +380,7 @@ def create_function(
"Code": {},
}

if container_deployment:
if system_variant.is_container:
create_function_params["PackageType"] = "Image"
create_function_params["Code"] = {"ImageUri": container_uri}
Comment on lines +383 to 385
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

Reject a missing image URI before calling the Lambda image path.

Both container branches pass container_uri straight into AWS even though the signature allows None. If the image build/cache lookup fails upstream, this turns into a generic boto3 parameter validation error instead of a clear deployment failure.

💡 Minimal fix
-            if system_variant.is_container:
+            if system_variant.is_container:
+                if container_uri is None:
+                    raise RuntimeError("Container URI is required for container deployment")
                 create_function_params["PackageType"] = "Image"
                 create_function_params["Code"] = {"ImageUri": container_uri}
                 self.logging.info(
                     "Creating function {} from container {}".format(func_name, container_uri)
                 )
-        if system_variant.is_container:
+        if system_variant.is_container:
+            if container_uri is None:
+                raise RuntimeError("Container URI is required for container deployment")
             self.client.update_function_code(FunctionName=name, ImageUri=container_uri)

Also applies to: 490-492

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sebs/aws/aws.py` around lines 383 - 385, The container branch uses
system_variant.is_container to set create_function_params["PackageType"]="Image"
and create_function_params["Code"]={"ImageUri": container_uri} without
validating container_uri; update the logic to explicitly check that
container_uri is not None (and non-empty) before assigning ImageUri and
raise/return a clear deployment error if missing, and apply the same guard to
the second container branch around the other create_function_params assignment
(the block at ~490-492) so AWS never receives a None ImageUri and the failure
message is actionable.

self.logging.info(
Expand Down Expand Up @@ -467,7 +468,7 @@ def update_function(
self,
function: Function,
code_package: Benchmark,
container_deployment: bool,
system_variant: SystemVariant,
container_uri: str | None,
):
"""
Expand All @@ -480,13 +481,13 @@ def update_function(
Args:
function: The function to update
code_package: Benchmark code package
container_deployment: Whether to use container deployment
container_uri: URI of the container image (if container_deployment=True)
system_variant: Selected deployment variant
container_uri: URI of the container image (if container deployment is selected)
"""
name = function.name
function = cast(LambdaFunction, function)

if container_deployment:
if system_variant.is_container:
self.client.update_function_code(FunctionName=name, ImageUri=container_uri)
else:
code_size = code_package.code_size
Expand Down Expand Up @@ -612,7 +613,7 @@ def default_function_name(
code_package.language_version,
code_package.architecture,
)
if code_package.container_deployment:
if code_package.system_variant.is_container:
func_name = f"{func_name}-docker"
return AWS.format_function_name(func_name)

Expand Down
19 changes: 10 additions & 9 deletions sebs/azure/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
from sebs.benchmark import Benchmark
from sebs.cache import Cache
from sebs.config import SeBSConfig
from sebs.experiments.config import SystemVariant
from sebs.utils import LoggingHandlers, execute
from sebs.faas.function import Function, FunctionConfig, ExecutionResult
from sebs.faas.system import System
Expand Down Expand Up @@ -220,7 +221,7 @@ def package_code(
architecture: str,
benchmark: str,
is_cached: bool,
) -> Tuple[str, int]:
) -> Tuple[str, float]:
"""Package function code for Azure Functions deployment.

Creates the proper directory structure and configuration files
Expand All @@ -237,7 +238,7 @@ def package_code(
architecture: Target architecture (currently unused)
benchmark: Name of the benchmark
is_cached: Whether the package is from cache
container_deployment: Whether to use container deployment
system_variant: Selected deployment variant

Returns:
Tuple of (directory_path, code_size_bytes, container_uri)
Expand Down Expand Up @@ -504,7 +505,7 @@ def update_function(
self,
function: Function,
code_package: Benchmark,
container_deployment: bool,
system_variant: SystemVariant,
container_uri: str | None,
) -> None:
"""Update existing Azure Function with new code.
Expand All @@ -517,14 +518,14 @@ def update_function(
Args:
function: Function instance to update
code_package: New benchmark code package
container_deployment: Whether using container deployment
system_variant: Selected deployment variant
container_uri: Container URI (unused for Azure)

Raises:
NotImplementedError: If container deployment is requested.
"""

if container_deployment:
if system_variant.is_container:
raise NotImplementedError("Container deployment is not supported in Azure")

assert code_package.has_input_processed
Expand Down Expand Up @@ -752,7 +753,7 @@ def create_function(
self,
code_package: Benchmark,
func_name: str,
container_deployment: bool,
system_variant: SystemVariant,
container_uri: str | None,
) -> AzureFunction:
"""Create new Azure Function.
Expand All @@ -764,7 +765,7 @@ def create_function(
Args:
code_package: Benchmark code package to deploy
func_name: Name for the Azure Function App
container_deployment: Whether to use container deployment
system_variant: Selected deployment variant
container_uri: Container URI (unused for Azure)

Returns:
Expand All @@ -775,7 +776,7 @@ def create_function(
RuntimeError: If function creation fails.
"""

if container_deployment:
if system_variant.is_container:
raise NotImplementedError("Container deployment is not supported in Azure")

language = code_package.language_name
Expand Down Expand Up @@ -852,7 +853,7 @@ def create_function(
)

# update existing function app
self.update_function(function, code_package, container_deployment, container_uri)
self.update_function(function, code_package, system_variant, container_uri)

self.cache_client.add_function(
deployment_name=self.name(),
Expand Down
Loading
Loading