# spcl/serverless-benchmarks architecture

> Architecture diagram of the GitHub repository spcl/serverless-benchmarks, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/spcl/serverless-benchmarks
- Repository: https://github.com/spcl/serverless-benchmarks

## Overview

##### Main Components
- Benchmark Applications & Experiments – As evidenced by the “benchmarks” directory that holds various microbenchmarks, webapps benchmarks, multimedia tests, scientific experiments, and utilities. These benchmarks are the payloads (or tests) that are deployed and measured.
- Platform-Specific Modules – Located in the “sebs” directory (with subdirectories for aws, azure, gcp, openwhisk, local). These modules encapsulate the provider-specific logic for deploying functions, container management, resource configuration, triggers, and storage interfaces.
- Deployment & Build Tools – The presence of “install.py”, “scripts/”, and “tools/” indicates automated build/deployment workflows. This layer handles the orchestration of the experiments and benchmark deployment.
- Configuration & Documentation – “config” folder (with example JSON files) provides system configurations, while the “docs” folder contains design and usage guides.
- Docker & Containerization – Multiple “dockerfiles” directories for each cloud provider and language (nodejs, python) show that containerized function packaging is a core element.
- Testing & CI – The “tests” directory and integration with CI pipelines (CircleCI, GitHub actions) confirm continuous integration and regression testing as integral parts.

##### Relationship and Block Interactions
- Orchestration Layer: At the top, include a central orchestration module (triggered via the install script and deployment APIs) that uses configuration files (from “config”) to decide which platform to deploy.
- Function Deployment Pipeline: Within each platform module, show the flow through container building (using Dockerfiles), packaging (scripts and tools), deployment, and later invocation. This may further reference the “dockerfiles” and “tools/build_docker_images.py”.
- Benchmark Engine: Include a section representing the benchmark engine which runs experiments. This engine (supported by processes in “sebs/experiments” and “scripts/”) provides workload stimuli to the deployed FaaS functions.

##### Important Architectural Patterns and Design Principles
- Modularity – The clear separation between provider-specific modules and the central orchestration layer demonstrates a plug-in architecture that favors extensibility.
- Containerization – Use of Docker for building function containers is a key element that decouples the benchmark runtime environment from each cloud’s underlying infrastructure.
- Automation – Automated deployment and measurements are core to the design. Emphasize the automation flow starting from input (configuration) to function deployment, automatic triggering, and collection of benchmarks.
- CI/CD Integration – CD pipelines are supported as shown by CircleCI and GitHub config files. They continuously build, test, and deploy the system’s components.

##### Relevant Technologies, Frameworks, and Libraries
- Docker for containerization and deployment.
- Python (with virtual environment and pip) as the primary scripting and orchestration language.
- Node.js components (noticeable in benchmarks and providers) for non-Python function implementations.
- Cloud provider SDKs/APIs (for AWS, Azure, GCP, OpenWhisk) wrapped in the sebs provider modules.
- CI/CD tooling such as CircleCI and GitHub Actions for automated testing and integration.

##### Elements
- Supporting modules like testing, configuration, and logging.
- Sub-components (such as container build pipelines, CI/CD flows, and results aggregation).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Benchmark & Experiment Layer
    subgraph "Benchmark & Experiment Layer"
        B["Benchmark Applications"]:::benchmarks
        E["Experiment Engine"]:::benchmarks
    end

    %% Configuration & Documentation Layer
    subgraph "Configuration & Docs"
        CF["Configuration Files"]:::configuration
        DOC["Documentation"]:::configuration
    end

    %% Orchestration Layer
    subgraph "Orchestration Layer"
        C1["Configuration Loader"]:::orchestration
        C2["Deployment Orchestrator"]:::orchestration
        DO1["Deployment Orchestration (install.py)"]:::deployment
        DO2["Deployment Scripts (scripts/)"]:::deployment
        DPT["Build Tools (build_docker_images.py)"]:::deployment
        DF["Dockerfiles"]:::containerization
        C3["Docker Build Process"]:::containerization
        C4["Result Collector"]:::orchestration
    end

    %% Cloud Provider Modules
    subgraph "Cloud Provider Modules"
        A["AWS Provider Module"]:::cloud
        Az["Azure Provider Module"]:::cloud
        G["GCP Provider Module"]:::cloud
        O["OpenWhisk Provider Module"]:::cloud
        L["Local Provider Module"]:::cloud
    end

    %% CI/CD & Testing Layer
    subgraph "CI/CD & Testing"
        T["Tests & Integration"]:::testing
        CI["CI Pipelines (.circleci/)"]:::testing
        CI2["CI Pipelines (.github/)"]:::testing
    end

    %% Connections for Configuration & Docs
    CF --> C1
    DOC --> C1

    %% Connections in Orchestration Layer
    C1 --> C2
    DO1 --> C2
    DO2 --> C2
    CI --> C2
    T  --> C2
    DPT --> DF
    DF --> C3
    C2 --> C3

    %% Orchestration triggers Cloud Deployment
    C2 --> A
    C2 --> Az
    C2 --> G
    C2 --> O
    C2 --> L

    %% Docker Build Process also feeds Cloud Modules
    C3 --> A
    C3 --> Az
    C3 --> G
    C3 --> O
    C3 --> L

    %% Experiment Engine interactions
    B --> E
    E --> C2
    E --> A
    E --> Az
    E --> G
    E --> O
    E --> L

    %% Cloud Modules send results to Result Collector
    A --> C4
    Az --> C4
    G --> C4
    O --> C4
    L --> C4

    %% Result Collector returns results to Experiment Engine
    C4 --> E

    %% Click Events
    click B "https://github.com/spcl/serverless-benchmarks/tree/master/benchmarks/"
    click E "https://github.com/spcl/serverless-benchmarks/tree/master/sebs/experiments/"
    click A "https://github.com/spcl/serverless-benchmarks/tree/master/sebs/aws/"
    click Az "https://github.com/spcl/serverless-benchmarks/tree/master/sebs/azure/"
    click G "https://github.com/spcl/serverless-benchmarks/tree/master/sebs/gcp/"
    click O "https://github.com/spcl/serverless-benchmarks/tree/master/sebs/openwhisk/"
    click L "https://github.com/spcl/serverless-benchmarks/tree/master/sebs/local/"
    click DO1 "https://github.com/spcl/serverless-benchmarks/blob/master/install.py"
    click DO2 "https://github.com/spcl/serverless-benchmarks/tree/master/scripts/"
    click DPT "https://github.com/spcl/serverless-benchmarks/blob/master/tools/build_docker_images.py"
    click CF "https://github.com/spcl/serverless-benchmarks/tree/master/config/"
    click DOC "https://github.com/spcl/serverless-benchmarks/tree/master/docs/"
    click DF "https://github.com/spcl/serverless-benchmarks/tree/master/dockerfiles/"
    click T "https://github.com/spcl/serverless-benchmarks/tree/master/tests/"
    click CI "https://github.com/spcl/serverless-benchmarks/tree/master/.circleci/"
    click CI2 "https://github.com/spcl/serverless-benchmarks/tree/master/.github/"

    %% Styles
    classDef benchmarks fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef orchestration fill:#FFD700,stroke:#000,stroke-width:1px;
    classDef cloud fill:#90EE90,stroke:#000,stroke-width:1px;
    classDef configuration fill:#87CEFA,stroke:#000,stroke-width:1px;
    classDef deployment fill:#DDA0DD,stroke:#000,stroke-width:1px;
    classDef containerization fill:#D3D3D3,stroke:#000,stroke-width:1px;
    classDef testing fill:#FFB6C1,stroke:#000,stroke-width:1px;
```
