# nullstone-io/deployment-sdk architecture

> Architecture diagram of the GitHub repository nullstone-io/deployment-sdk, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nullstone-io/deployment-sdk
- Repository: https://github.com/nullstone-io/deployment-sdk

## Overview

##### Main Components

a. Core SDK Layer:
- Main provider interface and contract components
- Core action interfaces (publish, deploy, monitor, log streaming)

b. Cloud Provider Implementations:
- Create two main branches for AWS and GCP services
- Implementations by service type (Container, Serverless, Static Site, Server)

c. Supporting Services:
- Docker integration layer
- Artifact management
- Logging subsystem
- Metrics/Monitoring system

##### Relationship Structure

**Core SDK Layer**
- Provider Interface
- AWS Implementations
- Container Services (ECS, Batch)
- Serverless (Lambda)
- Static Sites (S3)
- Server (Elastic Beanstalk)
- GCP Implementations
- Container Services (GKE)
- Static Sites (GCS)

##### Component Details

- Interfaces (hexagons)
- Implementations (rectangles)
- Supporting services (rounded rectangles)

- AWS services (orange)
- GCP services (blue)
- Core SDK components (green)
- Supporting services (gray)

##### Data Flow Representation

Following flows:
- Artifact publication path
- Deployment execution flow
- Log streaming pathway
- Monitoring data flow

##### Additional Elements

Supporting components:
- Authentication/Credentials management
- Environment variables handling
- Metrics collection and reporting
- Error handling and retry logic

##### Specific Details

For each implementation, show:
- Input/Output interfaces
- Service-specific components (e.g., ECS Task Definitions, Lambda Functions)
- Monitoring and logging integrations
- Resource management capabilities

##### Notes

Annotations for:
- Cross-cutting concerns
- Authentication flows
- Error handling strategies
- Retry mechanisms

Remember to emphasize the extensibility points where new providers can be added, as this appears to be a key design consideration based on the file structure.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Core["Core SDK Layer"]
        PI[Provider Interface]:::core
        PR[Provider Registry]:::core
        LS[Log Streaming]:::core
        DW[Deployment Watcher]:::core
    end

    subgraph Providers["Provider Implementations"]
        subgraph AWS["AWS Services"]
            ECS[ECS Service]:::aws
            BATCH[Batch Service]:::aws
            LAMBDA[Lambda Service]:::aws
            S3[S3 Static Site]:::aws
            EB[Elastic Beanstalk]:::aws
            CW[CloudWatch]:::aws
            ECR[ECR Registry]:::aws
        end

        subgraph GCP["GCP Services"]
            GKE[GKE Service]:::gcp
            GCS[GCS Static Site]:::gcp
            CM[Cloud Monitoring]:::gcp
            CL[Cloud Logging]:::gcp
            GAR[Container Registry]:::gcp
        end
    end

    subgraph Support["Supporting Services"]
        DOCKER[Docker Integration]:::support
        ARTIFACT[Artifact Management]:::support
        K8S[Kubernetes Utils]:::support
        ENV[Environment Variables]:::support
        METRICS[Metrics System]:::support
        LOGGING[Logging System]:::support
    end

    subgraph Auth["Authentication"]
        AWS_CREDS[AWS Credentials]:::auth
        GCP_CREDS[GCP Credentials]:::auth
    end

    subgraph Output["Output Management"]
        OH[Output Handler]:::output
        WM[Workspace Manager]:::output
    end

    PI --> AWS
    PI --> GCP
    PR --> PI
    LS --> CW
    LS --> CL
    DW --> CW
    DW --> CM

    AWS_CREDS --> AWS
    GCP_CREDS --> GCP

    DOCKER --> ECR
    DOCKER --> GAR
    K8S --> GKE

    classDef core fill:#90EE90,stroke:#333,stroke-width:2px
    classDef aws fill:#FF9900,stroke:#333,stroke-width:2px
    classDef gcp fill:#4285F4,stroke:#333,stroke-width:2px
    classDef support fill:#D3D3D3,stroke:#333,stroke-width:2px
    classDef auth fill:#FFB6C1,stroke:#333,stroke-width:2px
    classDef output fill:#DDA0DD,stroke:#333,stroke-width:2px

    click PI "https://github.com/nullstone-io/deployment-sdk/blob/master/app/provider.go"
    click PR "https://github.com/nullstone-io/deployment-sdk/blob/master/contract/registrar.go"
    click LS "https://github.com/nullstone-io/deployment-sdk/blob/master/app/log_streamer.go"
    click DW "https://github.com/nullstone-io/deployment-sdk/blob/master/app/polling_deploy_watcher.go"
    click ECS "https://github.com/nullstone-io/deployment-sdk/tree/master/aws/ecs"
    click BATCH "https://github.com/nullstone-io/deployment-sdk/tree/master/aws/batch"
    click LAMBDA "https://github.com/nullstone-io/deployment-sdk/tree/master/aws/lambda"
    click S3 "https://github.com/nullstone-io/deployment-sdk/tree/master/aws/s3"
    click EB "https://github.com/nullstone-io/deployment-sdk/tree/master/aws/beanstalk"
    click CW "https://github.com/nullstone-io/deployment-sdk/tree/master/aws/cloudwatch"
    click ECR "https://github.com/nullstone-io/deployment-sdk/tree/master/aws/ecr"
    click GKE "https://github.com/nullstone-io/deployment-sdk/tree/master/gcp/gke"
    click GCS "https://github.com/nullstone-io/deployment-sdk/tree/master/gcp/gcs"
    click CM "https://github.com/nullstone-io/deployment-sdk/tree/master/gcp/cloudmonitoring"
    click CL "https://github.com/nullstone-io/deployment-sdk/tree/master/gcp/cloudlogging"
    click GAR "https://github.com/nullstone-io/deployment-sdk/tree/master/gcp/gar"
    click DOCKER "https://github.com/nullstone-io/deployment-sdk/tree/master/docker"
    click ARTIFACT "https://github.com/nullstone-io/deployment-sdk/tree/master/artifacts"
    click K8S "https://github.com/nullstone-io/deployment-sdk/tree/master/k8s"
    click ENV "https://github.com/nullstone-io/deployment-sdk/tree/master/env-vars"
    click METRICS "https://github.com/nullstone-io/deployment-sdk/tree/master/prometheus"
    click LOGGING "https://github.com/nullstone-io/deployment-sdk/tree/master/logging"
    click AWS_CREDS "https://github.com/nullstone-io/deployment-sdk/tree/master/aws/creds"
    click GCP_CREDS "https://github.com/nullstone-io/deployment-sdk/tree/master/gcp/creds"
    click OH "https://github.com/nullstone-io/deployment-sdk/tree/master/outputs"
    click WM "https://github.com/nullstone-io/deployment-sdk/tree/master/workspace"
```
