Infrastructure and Application(s)#

In ECLYPSE, both the infrastructure and applications are modelled as graphs enriched with resource-related attributes (assets) and dynamic behaviour (update policies). These are represented using two core classes:

  • Infrastructure – models a multi-layered infrastructure, made of nodes and links with their capabilities

  • Application – models a multi-service application, made of services and interactions with their requirements

The two classes share many structural similarities, but differ in purpose and in the parameters used at initialisation.

from eclypse import policies
from eclypse.graph.infrastructure import Infrastructure

infrastructure = Infrastructure(
    infrastructure_id="infra",
    update_policies=[
        policies.failure.availability_flap(0.01, up_probability=0.2),
        policies.distribution.uniform(
            node_assets=["cpu", "ram"],
            edge_assets=["latency", "bandwidth"],
            node_distribution=(0.95, 1.05),
            edge_distribution=(0.95, 1.05),
        ),
    ],
    node_assets=[...],
    edge_assets=[...],
    resource_init="min",
    seed=42,
    path_assets_aggregators=...,
    path_algorithm=...,
)

Key parameters:

  • infrastructure_id: identifier of the infrastructure

  • update_policies: list of update policies for infrastructure resources

  • node_assets / edge_assets: available capabilities (asset values) of nodes and links

  • resource_init: initialisation of resources (min or max)

  • seed: random seed for reproducibility

  • path_assets_aggregators: aggregators for each link asset evaluation across paths

  • path_algorithm: path logic to retrieve and check the paths among nodes

from eclypse import policies
from eclypse.graph.application import Application

application = Application(
    application_id="app",
    update_policies=[
        policies.after(
            50,
            policies.degrade.reduce(
                factor=0.6,
                epochs=200,
                node_assets=["cpu", "ram"],
                edge_assets=["bandwidth"],
            ),
        ),
        policies.after(
            50,
            policies.degrade.increase(
                factor=1.6667,
                epochs=200,
                edge_assets=["latency"],
            ),
        ),
    ],
    node_assets=[...],
    edge_assets=[...],
    requirement_init="min",
    seed=42,
    flows=[["serviceA", "serviceB"], ...],
)

Key parameters:

  • application_id: identifier of the application

  • update_policies: list of update policies for application requirements

  • node_assets / edge_assets: resource requirements (asset values) of services and links

  • requirement_init: initialisation of resources (min or max)

  • seed: random seed for reproducibility

  • flows: list of service chains or communication flows

These classes inherit from a common base (AssetGraph) and can be extended or composed via utility functions and default builders.

Defining the topologies#

Once you have defined an Infrastructure or an Application object, you can incrementally add nodes (or services) and edges (or interactions) to describe its structure.

Both classes expose two methods:

These methods allow you to associate assets and automatically validate their values, according to the asset definitions you provided during initialisation.

from eclypse.graph.infrastructure import Infrastructure
from eclypse.graph.assets.defaults import cpu, ram, latency, bandwidth

infra = Infrastructure(infrastructure_id="my-infra",
    node_assets={"cpu": cpu, "ram": ram},
    edge_assets={"latency": latency, "bandwidth": bandwidth},
    ...)

# Add two compute node
infra.add_node("node-1", cpu=4.0, ram=8.0)
infra.add_node("node-2", cpu=8.0, ram=16.0, strict=False)

# Add a link with latency and bandwidth
infra.add_edge(
    "node-1", "node-2",
    latency=10.0,
    bandwidth=100.0,
    symmetric=True  # optional bidirectional link
)
  • strict=True (default): raises an error if asset values are inconsistent

  • symmetric=True: adds the edge in both directions

from eclypse.graph.application import Application
from eclypse.graph.assets.defaults import cpu, ram, latency, bandwidth

app = Application(application_id="my-app",
    node_assets={"cpu": cpu, "ram": ram},
    edge_assets={"latency": latency, "bandwidth": bandwidth},
    ...)

# Add a service with specific resource requirements
app.add_node("service-A", cpu=1.0, ram=0.5)
app.add_node("service-B", cpu=2.0, ram=1.0, strict=False)

# Add a directional communication between services
app.add_edge(
    "service-A", "service-B",
    latency=5.0,
    bandwidth=10.0,
    symmetric=False
)
  • strict=True (default): raises an error if requirements are outside defined bounds

  • symmetric=False (default): adds the edge in one direction only

If you’re building an application to run in emulation mode rather than simulation, each service must be implemented with actual logic and remote execution support.

See the Emulation guide for details.

Note

All assets passed to add_node() or add_edge() are checked against the declared asset definitions. If validation fails and strict is True, an exception is raised. Otherwise, a warning is logged.

Default builders#

ECLYPSE provides several built-in builder functions that allow you to quickly instantiate commonly used topologies and reference applications.

These builders return fully initialised Application or Infrastructure objects with predefined assets and flows.

You can import infrastructure builders from:

from eclypse.builders.infrastructure import (
    get_b_cube,
    get_continuum_tiered,
    get_fat_tree,
    get_backbone,
    get_caida,
    get_gabriel,
    get_orion_cev,
    get_sndlib,
    get_topohub,
    get_topology_zoo,
    get_hierarchical,
    get_mec_5g,
    get_multi_region_wan,
    get_random,
    get_scale_free,
    get_small_world,
    get_star,
)

ECLYPSE includes several off-the-shelf infrastructure builders across generic generators, architecture patterns, and named references. For the full list, see eclypse.builders.infrastructure.

Category

Builders

Generic generators

get_star, get_random, get_hierarchical, get_fat_tree, get_b_cube, get_small_world, get_scale_free

Architecture patterns

get_continuum_tiered, get_mec_5g, get_multi_region_wan, get_industrial_tsn, get_factory_cells, get_vehicular_edge

References

get_orion_cev, get_topohub, get_topology_zoo, get_sndlib, get_backbone, get_caida, get_gabriel

Example:

from eclypse.builders.infrastructure import get_fat_tree

infra = get_fat_tree(k=4)

ECLYPSE includes several built-in application builders, all collected in the eclypse.builders.application package. Sock Shop remains the reference example used throughout this section, using get_sock_shop().

For simulation-only task DAGs, ECLYPSE also provides workflow builders in eclypse.builders.workflow. These builders use WfCommons to generate workflows and normalise file-size-derived storage and dependency bandwidth values from bytes to MiB before assigning them to the default ECLYPSE assets.

from eclypse.builders.application import get_sock_shop

app = get_sock_shop()

This application contains multiple interconnected services and representative communication flows. For the full list of built-in applications, see eclypse.builders.application.

Tip

Builders are useful for prototyping or benchmarking standard scenarios. All returned graphs are mutable and can be extended using the standard interface.