-
Notifications
You must be signed in to change notification settings - Fork 99
New CLI options #243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
New CLI options #243
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 0d220b7
[system] Additional logging
mcopik e41e04b
[system] Add CLI tool to update SeBS images
mcopik 50886e6
[storage] Make container removal optional
mcopik 313f69c
[system] Add CLI option to just build code package
mcopik cb98ffc
[system] Fix wrong logging in cache
mcopik e137545
[system] Update build routine to also work with containers
mcopik b48b696
[docs] Document new build option
mcopik c26adfe
[system] Refactor tools script for Docker build: add Docker tag gener…
mcopik b2ba550
[system] Update local images due to end of support for older Debian v…
mcopik dda3179
[azure] Deprecate Python 3.7 and 3.8 - EOL
mcopik 502f731
[azure] Upgrade Node for manage image
mcopik 5bb6d4a
[dev] Linting
mcopik 73a9cb6
[system] Replace build_docker_images script with a native CLi integra…
mcopik 572939b
[aws] Deprecate Python 3.8
mcopik 37ab1fa
[system] Linting
mcopik 2ffaeb5
[system] Remove unnecessary tool
mcopik 9edb151
[system] Update changelog
mcopik 01b535f
[docs] Add developer guide
mcopik 62b292f
[aws] Pin specific images
mcopik 611efa7
[docs] Minor fixes
mcopik cdfcad0
[aws] Fix bug in incorrect login to ECR
mcopik 050e958
[gcp] Add missing dependency
mcopik 7a223ef
[dev] Linting
mcopik ab15ddb
[system][aws] Add feature of cleaning resources, implemented for AWS.
mcopik c3c31dd
[docs] Expand documentation on resource allocation
mcopik c4058ca
Merge remote-tracking branch 'origin/master' into feature/better-cli
mcopik dbf2787
[dev] Linting
mcopik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| ``` | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| <!-- Content loaded from docs/resource-management.md at Sphinx build time --> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 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)
@azure/functions4.x), you need:Practical takeaway
Sources: [1] [2] [3]
🏁 Script executed:
Repository: spcl/serverless-benchmarks
Length of output: 349
🏁 Script executed:
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
📝 Committable suggestion
🤖 Prompt for AI Agents