# digital-ai/release-integration-template-python architecture

> Architecture diagram of the GitHub repository digital-ai/release-integration-template-python, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/digital-ai/release-integration-template-python
- Repository: https://github.com/digital-ai/release-integration-template-python

## Overview

##### Project Type and Purpose
- This is a **container-based plugin template** for Digital.ai Release.
- It provides Python-based “tasks” (hello, sample_release_api_task, sample_server_task) packaged as Docker images.
- A local dev environment spins up:
- a Release server
- a Docker registry
- a remote-runner service

##### File Structure
- **Top-level**
- build.sh / build.bat – build & publish plugin artifacts (zip + Docker image)
- project.properties – plugin metadata (name, version)
- requirements.txt – Python dependencies
- .xebialabs/config.yaml – Release server connection & upload settings
- **dev-environment/**
- docker-compose.yaml – defines three services:
– digitalai-release  (the server)
– digitalai-release-remote-runner (executes containers)
– digitalai-release-setup (initial configuration)
- Each service has its own Dockerfile
- **src/**
- Python task modules implementing the plugin’s logic
- **resources/**
- plugin-version.properties, type-definitions.yaml – type schemas & versioning
- **tests/**
- unit/integration tests for your tasks

##### Extract Key Architectural Insights from README
- The dev environment uses Docker Compose to stand up a full Release stack.
- build.sh/upload scripts drive the CI flow:
1. package code → zip
2. docker build → push to the registry
3. (optionally) upload zip to the Release server via SDK/CLI

##### Main Components
a. **Developer Workstation** (IDE, build scripts)
b. **Local Docker Registry** (container-registry)
c. **Digital.ai Release Server** (docker-compose service)
d. **Remote-Runner Service** (executes plugin containers)
e. **Plugin Container** (your Python code inside a Docker image)
f. **Plugin ZIP Artifact** (uploaded to server via .xebialabs config)

##### Relationships & Data Flows
- Developer triggers `build.sh` / `build.bat` →
- Packages code into ZIP →
– Pushes ZIP to Release Server (via SDK CLI, using .xebialabs/config.yaml)
- Builds Docker image →
– Tags & pushes image to the local registry (container-registry:5000)
- Release Server UI / API:
- Lists available plugins (from uploaded ZIP)
- When a release pipeline runs:
– Server posts a “run task” request to Remote-Runner
- Remote-Runner pulls the plugin image from registry →
- Starts the plugin container →
– Container executes your Python task (hello.py, sample_*.py)
– Task uses the Release SDK to call back into the server’s REST API
– Logs & results flow back to the Release server UI

##### Architectural Patterns & Principles
- **Microservices / Containerization**: each service in its own Docker container
- **Separation of Concerns**:
- Build & packaging layer (developer scripts)
- Orchestration layer (docker-compose, Release server)
- Execution layer (remote-runner + plugin container)
- **Configuration as Code**: docker-compose.yaml, .xebialabs/config.yaml, project.properties

##### Critical Elements
- **Component Names** matching folder names (dev-environment/digitalai-release, remote-runner, src module names)
- **Artifacts**: plugin ZIP, Docker image, test reports
- **Data flows** with arrowheads and labels

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Developer Workstation"
        direction TB
        DT_sh["build.sh"]:::devtools
        DT_bat["build.bat"]:::devtools
        DT_prop["project.properties"]:::devtools
        DT_cfg[".xebialabs/config.yaml"]:::devtools
        DT_req["requirements.txt"]:::devtools
        DT_readme["README.md"]:::devtools
        ZIP["Plugin ZIP Artifact"]:::devtools
        IMG["Docker Image"]:::devtools
    end

    subgraph "Dev Environment"
        direction TB
        REG["Local Docker Registry"]:::external
        REL["Digital.ai Release Server"]:::core
        RUN["Remote-Runner Service"]:::core
        SET["Initial Setup Service"]:::core
    end

    PLUGIN["Plugin Container"]:::plugin

    %% Build flows
    DT_sh -->|"package ZIP"| ZIP
    DT_sh -->|"build Docker image"| IMG
    IMG -->|"docker push"| REG
    ZIP -->|"ZIP upload (SDK CLI)"| REL

    %% Runtime flows
    REL -->|"run task request (HTTP REST API)"| RUN
    RUN -->|"docker pull"| REG
    RUN -->|"start container"| PLUGIN
    PLUGIN -->|"REST API calls & logs"| REL

    %% Click Events
    click DT_sh "https://github.com/digital-ai/release-integration-template-python/blob/main/./build.sh"
    click DT_bat "https://github.com/digital-ai/release-integration-template-python/blob/main/./build.bat"
    click DT_prop "https://github.com/digital-ai/release-integration-template-python/blob/main/./project.properties"
    click DT_cfg "https://github.com/digital-ai/release-integration-template-python/blob/main/.xebialabs/config.yaml"
    click DT_req "https://github.com/digital-ai/release-integration-template-python/blob/main/./requirements.txt"
    click DT_readme "https://github.com/digital-ai/release-integration-template-python/blob/main/./README.md"
    click REG "https://github.com/digital-ai/release-integration-template-python/blob/main/./dev-environment/docker-compose.yaml"
    click REL "https://github.com/digital-ai/release-integration-template-python/tree/main/./dev-environment/digitalai-release/Dockerfile"
    click RUN "https://github.com/digital-ai/release-integration-template-python/tree/main/./dev-environment/digitalai-release-remote-runner/Dockerfile"
    click PLUGIN "https://github.com/digital-ai/release-integration-template-python/tree/main/./Dockerfile"

    classDef devtools fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef core fill:#FFA500,stroke:#000,stroke-width:1px
    classDef plugin fill:#90EE90,stroke:#000,stroke-width:1px
    classDef external fill:#D3D3D3,stroke:#000,stroke-width:1px
```
