# awslabs/edo architecture

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

- Interactive diagram: https://gitdiagram.com/awslabs/edo
- Repository: https://github.com/awslabs/edo

## Overview

##### Project type and purpose
- Edo is a Rust-based, next-generation build tool with a CLI front-end and a core library that implements a reproducible, artifact-centric build model.
- It provides four core components—Storage, Source, Environment, Transform—plus a WebAssembly-based plugin system and a Starlark interpreter for configuration.

##### File structure
- Top-level “crates” directory contains:
- edo-core: core library implementing context, scheduler, storage, source, environment, transform, utilities
- edo-plugin-sdk: SDK for writing plugins in Rust that compile to WASM
- edo-starlark: built-in Starlark interpreter for config
- edo-wit: WIT interface definitions for host/plugin APIs
- edo: CLI binary (cmd/checkout, run, list, etc.)
- plugins/edo-core-plugin: reference plugin implementing common back-ends (local, container, Git, OCI, S3, compose, script)
- docs/components and docs/design.md describe the four core components and plugin system.
- examples demonstrate end-to-end usage invoking the CLI, Starlark config, and plugin behavior.

##### README for additional insights
- The Architecture section already sketches a linear pipeline: Transform → Environment → Source → Storage, all glued by Plugin System.
- Key technologies: Rust, WebAssembly (WASM), WIT, Starlark, OCI artifact model, container runtimes (Docker/Podman/Finch), S3, Git.

##### Elements
- Control flow (CLI → Core → Scheduler → Transform → …)
- Data flow (Source → Storage, external fetch/store)

##### Final advice
- Don’t over-modularize; represent each of the four core components plus orchestration and plugin system as distinct modules.
- External dependencies explicitly.
- Plugin lifecycle (host loading WASM, calling plugin hooks) is obvious.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation"
        CLI["edo (binary)"]:::cli
    end

    %% Core Orchestrator & Config
    subgraph "Orchestration & Config"
        Orchestrator["Core Orchestrator"]:::core
        Starlark["Starlark Engine"]:::config
    end

    %% Scheduler & Pipeline
    subgraph "Pipeline Components"
        Scheduler["Scheduler"]:::core
        Transform["Transform Component"]:::core
        Environment["Environment Component"]:::core
        Source["Source Component"]:::core
        Storage["Storage Component"]:::core
    end

    %% Plugin System & Extensions
    subgraph "Plugins & Extensions"
        PluginSystem["Plugin System (WASM host)"]:::plugin
        PluginSDK["Plugin SDK"]:::plugin
        ReferencePlugins["Reference Plugins"]:::plugin
    end

    %% External Dependencies
    subgraph "External Services"
        Container["Container Runtime"]:::external
        Registry["Artifact Registry (OCI)"]:::external
        VCS["VCS (Git)"]:::external
        FS["Local File System"]:::external
        S3["S3 Storage"]:::external
    end

    %% Control Flow
    CLI -->|"command"| Orchestrator
    Orchestrator -->|"parse/evaluate"| Starlark
    Orchestrator -->|"build DAG"| Scheduler
    Scheduler -->|"generate actions"| Transform
    Transform -->|"prepare context"| Environment
    Environment -->|"fetch deps"| Source
    Source -->|"store/fetch"| Storage

    %% Plugin Invocations
    Transform -->|"invoke plugins"| PluginSystem
    Environment -->|"invoke plugins"| PluginSystem
    Orchestrator -->|"plugin hooks"| PluginSystem
    Scheduler -->|"plugin hooks"| PluginSystem
    Storage -->|"plugin hooks"| PluginSystem

    %% Extensions Integration
    PluginSystem <--> PluginSDK
    PluginSystem <--> ReferencePlugins

    %% External Interactions
    Environment -->|"run containers"| Container
    Source -->|"clone/pull"| VCS
    Source -->|"read local"| FS
    Source -->|"pull images"| Registry
    Storage -->|"write local"| FS
    Storage -->|"push/pull"| S3
    Storage -->|"push/pull"| Registry

    %% Click Events
    click CLI "https://github.com/awslabs/edo/tree/main/crates/edo/src"
    click Orchestrator "https://github.com/awslabs/edo/tree/main/crates/edo-core/src/context/"
    click Scheduler "https://github.com/awslabs/edo/tree/main/crates/edo-core/src/scheduler/"
    click Transform "https://github.com/awslabs/edo/blob/main/crates/edo-core/src/transform/mod.rs"
    click Environment "https://github.com/awslabs/edo/tree/main/crates/edo-core/src/environment/"
    click Source "https://github.com/awslabs/edo/tree/main/crates/edo-core/src/source/"
    click Storage "https://github.com/awslabs/edo/tree/main/crates/edo-core/src/storage/"
    click PluginSystem "https://github.com/awslabs/edo/tree/main/crates/edo-core/src/plugin/"
    click PluginSystem "https://github.com/awslabs/edo/tree/main/crates/edo-wit/"
    click Starlark "https://github.com/awslabs/edo/blob/main/crates/edo-starlark/src/lib.rs"
    click PluginSDK "https://github.com/awslabs/edo/blob/main/crates/edo-plugin-sdk/src/lib.rs"
    click ReferencePlugins "https://github.com/awslabs/edo/tree/main/crates/plugins/edo-core-plugin/src/"

    %% Styles
    classDef cli fill:#FFD580,stroke:#E59400,stroke-width:2px
    classDef core fill:#B3E2CD,stroke:#44A02C,stroke-width:2px
    classDef config fill:#EFD3E0,stroke:#E62020,stroke-width:2px
    classDef plugin fill:#DECBE4,stroke:#924E8C,stroke-width:2px
    classDef external fill:#FEE0B6,stroke:#E67819,stroke-width:2px
```
