Skip to main content

Environment Isolation and Orchestration for Microservices

Project description

Servos - Service Environment Isolation & Orchestration System

License Python PyPI Docker PyPI version Build Status

A lightweight Python library for environment isolation, Docker orchestration, and multi-platform service deployment. Extracted from the ProServe framework to provide focused environment isolation capabilities.

๐Ÿš€ Part of the modular ecosystem: ProServe (core framework) โ€ข Servos (isolation) โ€ข EDPMT (hardware) โ€ข wmlog (logging)

๐ŸŽฏ Overview

Servos provides robust environment isolation and orchestration for running services across multiple platforms including Arduino, MicroPython, ARM64, and x86_64 architectures. It offers containerized execution environments with automatic platform detection and deployment.

๐Ÿ—๏ธ Architecture

Servos Ecosystem Integration

graph TB
    subgraph "Modular Ecosystem"
        ProServe[ProServe Framework<br/>Core Microservices]
        Servos[Servos<br/>Environment Isolation]
        EDPMT[EDPMT Framework<br/>Hardware Control]
        wmlog[wmlog<br/>Centralized Logging]
    end
    
    ProServe --> Servos
    EDPMT --> Servos
    Servos --> wmlog
    
    subgraph "Servos Core Architecture"
        IsolationManager[IsolationManager<br/>Process/Container Management]
        PlatformDetector[PlatformDetector<br/>Auto-Detection]
        EnvironmentConfig[EnvironmentConfig<br/>Resource Limits]
        ContainerOrchestrator[Container Orchestrator<br/>Docker Management]
    end
    
    Servos --> IsolationManager
    Servos --> PlatformDetector
    Servos --> EnvironmentConfig
    Servos --> ContainerOrchestrator
    
    subgraph "Platform Support"
        Arduino[Arduino<br/>AVR/ESP32/STM32]
        MicroPython[MicroPython<br/>ESP32/CircuitPython]
        ARM64[ARM64<br/>Raspberry Pi/M1]
        x86_64[x86_64<br/>Standard PC/Server]
    end
    
    PlatformDetector --> Arduino
    PlatformDetector --> MicroPython
    PlatformDetector --> ARM64
    PlatformDetector --> x86_64
    
    subgraph "Isolation Modes"
        ProcessIsolation[Process Isolation<br/>Native Execution]
        DockerIsolation[Docker Containers<br/>Full Isolation]
        ResourceLimits[Resource Limits<br/>CPU/Memory/Time]
        NetworkIsolation[Network Isolation<br/>Controlled Access]
    end
    
    IsolationManager --> ProcessIsolation
    IsolationManager --> DockerIsolation
    IsolationManager --> ResourceLimits
    IsolationManager --> NetworkIsolation
    
    subgraph "Docker Environments"
        ArduinoContainer[Arduino Container<br/>PlatformIO/Toolchain]
        MicroPyContainer[MicroPython Container<br/>Firmware/Tools]
        ARM64Container[ARM64 Container<br/>Cross-compilation]
        x86Container[x86_64 Container<br/>Standard Runtime]
    end
    
    DockerIsolation --> ArduinoContainer
    DockerIsolation --> MicroPyContainer
    DockerIsolation --> ARM64Container
    DockerIsolation --> x86Container

Detailed Servos Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                           Servos Architecture                              โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                             โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”‚
โ”‚  โ”‚                         CLI Interface                               โ”‚     โ”‚
โ”‚  โ”‚                                                                     โ”‚     โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚   servos    โ”‚ โ”‚   servos    โ”‚ โ”‚   servos    โ”‚ โ”‚     servos      โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚   detect    โ”‚ โ”‚list-platformsโ”‚ โ”‚   version   โ”‚ โ”‚    <command>    โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚             โ”‚ โ”‚             โ”‚ โ”‚             โ”‚ โ”‚                 โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚โ€ข Auto-detectโ”‚ โ”‚โ€ข Show all   โ”‚ โ”‚โ€ข Version    โ”‚ โ”‚โ€ข Custom         โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚  current    โ”‚ โ”‚  supported  โ”‚ โ”‚  info       โ”‚ โ”‚  isolation      โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚  platform   โ”‚ โ”‚  platforms  โ”‚ โ”‚โ€ข Build      โ”‚ โ”‚  commands       โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚โ€ข Hardware   โ”‚ โ”‚โ€ข Docker     โ”‚ โ”‚  metadata   โ”‚ โ”‚โ€ข Interactive    โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚  details    โ”‚ โ”‚  images     โ”‚ โ”‚โ€ข CLI help   โ”‚ โ”‚  shell          โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚โ€ข System     โ”‚ โ”‚โ€ข Capabilitiesโ”‚ โ”‚             โ”‚ โ”‚                 โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚  info       โ”‚ โ”‚             โ”‚ โ”‚             โ”‚ โ”‚                 โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚     โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ”‚
โ”‚                                โ”‚                                             โ”‚
โ”‚                                โ–ผ                                             โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”‚
โ”‚  โ”‚                      Core Isolation Engine                         โ”‚     โ”‚
โ”‚  โ”‚                                                                     โ”‚     โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚ Isolation   โ”‚ โ”‚  Platform   โ”‚ โ”‚Environment  โ”‚ โ”‚   Container     โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚  Manager    โ”‚ โ”‚  Detector   โ”‚ โ”‚   Config    โ”‚ โ”‚  Orchestrator   โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚             โ”‚ โ”‚             โ”‚ โ”‚             โ”‚ โ”‚                 โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚โ€ข Process    โ”‚ โ”‚โ€ข Hardware   โ”‚ โ”‚โ€ข Resource   โ”‚ โ”‚โ€ข Docker API     โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚  Spawn      โ”‚ โ”‚  Detection  โ”‚ โ”‚  Limits     โ”‚ โ”‚โ€ข Image Build    โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚โ€ข Container  โ”‚ โ”‚โ€ข Arch Query โ”‚ โ”‚โ€ข CPU/Memory โ”‚ โ”‚โ€ข Container      โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚  Create     โ”‚ โ”‚โ€ข OS Info    โ”‚ โ”‚โ€ข Network    โ”‚ โ”‚  Lifecycle      โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚โ€ข Security   โ”‚ โ”‚โ€ข Feature    โ”‚ โ”‚  Rules      โ”‚ โ”‚โ€ข Volume Mount   โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚  Sandbox    โ”‚ โ”‚  Support    โ”‚ โ”‚โ€ข Time Limitsโ”‚ โ”‚โ€ข Health Check   โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚โ€ข Resource   โ”‚ โ”‚โ€ข Embedded   โ”‚ โ”‚โ€ข User/Group โ”‚ โ”‚โ€ข Log Stream     โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚  Monitor    โ”‚ โ”‚  Board ID   โ”‚ โ”‚  Mapping    โ”‚ โ”‚โ€ข Network Setup  โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚     โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ”‚
โ”‚                                โ”‚                                             โ”‚
โ”‚                                โ–ผ                                             โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”‚
โ”‚  โ”‚                    Platform-Specific Environments                  โ”‚     โ”‚
โ”‚  โ”‚                                                                     โ”‚     โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚   Arduino   โ”‚ โ”‚MicroPython  โ”‚ โ”‚   ARM64     โ”‚ โ”‚     x86_64      โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚Environment  โ”‚ โ”‚ Environment โ”‚ โ”‚Environment  โ”‚ โ”‚   Environment   โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚             โ”‚ โ”‚             โ”‚ โ”‚             โ”‚ โ”‚                 โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚โ€ข PlatformIO โ”‚ โ”‚โ€ข MicroPythonโ”‚ โ”‚โ€ข Cross-     โ”‚ โ”‚โ€ข Standard       โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚  Toolchain  โ”‚ โ”‚  Runtime    โ”‚ โ”‚  compilationโ”‚ โ”‚  Runtime        โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚โ€ข AVR-GCC    โ”‚ โ”‚โ€ข CircuitPy  โ”‚ โ”‚โ€ข QEMU       โ”‚ โ”‚โ€ข Python 3.8+   โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚โ€ข ESP-IDF    โ”‚ โ”‚  Support    โ”‚ โ”‚  Emulation  โ”‚ โ”‚โ€ข Build Tools    โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚โ€ข STM32Cube  โ”‚ โ”‚โ€ข Firmware   โ”‚ โ”‚โ€ข RPi Tools  โ”‚ โ”‚โ€ข Dev Libraries  โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚โ€ข Board      โ”‚ โ”‚  Upload     โ”‚ โ”‚โ€ข Native     โ”‚ โ”‚โ€ข Testing        โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚  Configs    โ”‚ โ”‚โ€ข Serial     โ”‚ โ”‚  Execution  โ”‚ โ”‚  Framework      โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚โ€ข Flash      โ”‚ โ”‚โ€ข Debug      โ”‚ โ”‚โ€ข Profiling  โ”‚ โ”‚โ€ข Debug Tools    โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚  Tools      โ”‚ โ”‚โ€ข Serial     โ”‚ โ”‚  Tools      โ”‚ โ”‚โ€ข Performance    โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚     โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ”‚
โ”‚                                โ”‚                                             โ”‚
โ”‚                                โ–ผ                                             โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”‚
โ”‚  โ”‚                      Docker Integration                            โ”‚     โ”‚
โ”‚  โ”‚                                                                     โ”‚     โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚  Arduino    โ”‚ โ”‚ MicroPython โ”‚ โ”‚   ARM64     โ”‚ โ”‚     x86_64      โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚ Container   โ”‚ โ”‚  Container  โ”‚ โ”‚  Container  โ”‚ โ”‚   Container     โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚             โ”‚ โ”‚             โ”‚ โ”‚             โ”‚ โ”‚                 โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚โ€ข Ubuntu     โ”‚ โ”‚โ€ข Python 3.x โ”‚ โ”‚โ€ข Multi-arch โ”‚ โ”‚โ€ข Ubuntu/Alpine  โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚  Base       โ”‚ โ”‚  Base       โ”‚ โ”‚  Support    โ”‚ โ”‚  Base           โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚โ€ข PlatformIO โ”‚ โ”‚โ€ข MicroPythonโ”‚ โ”‚โ€ข Cross-comp โ”‚ โ”‚โ€ข Python 3.8+   โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚  Install    โ”‚ โ”‚  Tools      โ”‚ โ”‚  Toolchain  โ”‚ โ”‚โ€ข Development    โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚โ€ข Serial     โ”‚ โ”‚โ€ข esptool    โ”‚ โ”‚โ€ข QEMU User  โ”‚ โ”‚  Environment    โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚  Support    โ”‚ โ”‚โ€ข ampy       โ”‚ โ”‚  Mode       โ”‚ โ”‚โ€ข Build Utils    โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚โ€ข USB/GPIO   โ”‚ โ”‚โ€ข rshell     โ”‚ โ”‚โ€ข Native     โ”‚ โ”‚โ€ข Package        โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚  Access     โ”‚ โ”‚โ€ข mpremote   โ”‚ โ”‚  Runtime    โ”‚ โ”‚  Managers       โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚โ€ข Firmware   โ”‚ โ”‚โ€ข Firmware   โ”‚ โ”‚โ€ข Debug      โ”‚ โ”‚โ€ข Testing        โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚  Flash      โ”‚ โ”‚  Management โ”‚ โ”‚  Support    โ”‚ โ”‚  Frameworks     โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚     โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ”‚
โ”‚                                โ”‚                                             โ”‚
โ”‚                                โ–ผ                                             โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”‚
โ”‚  โ”‚                        Integration Layer                           โ”‚     โ”‚
โ”‚  โ”‚                                                                     โ”‚     โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚   wmlog     โ”‚ โ”‚  ProServe   โ”‚ โ”‚    EDPMT    โ”‚ โ”‚     Docker      โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚  Logging    โ”‚ โ”‚ Framework   โ”‚ โ”‚  Hardware   โ”‚ โ”‚     Engine      โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚             โ”‚ โ”‚             โ”‚ โ”‚ Management  โ”‚ โ”‚                 โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚โ€ข Structured โ”‚ โ”‚โ€ข Service    โ”‚ โ”‚โ€ข Device     โ”‚ โ”‚โ€ข Container      โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚  Logging    โ”‚ โ”‚  Framework  โ”‚ โ”‚  Control    โ”‚ โ”‚  Runtime        โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚โ€ข Real-time  โ”‚ โ”‚โ€ข Manifest   โ”‚ โ”‚โ€ข GPIO/I2C   โ”‚ โ”‚โ€ข Image          โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚  Stream     โ”‚ โ”‚  Driven     โ”‚ โ”‚โ€ข Sensor     โ”‚ โ”‚  Management     โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚โ€ข Context    โ”‚ โ”‚โ€ข Multi-env  โ”‚ โ”‚  Reading    โ”‚ โ”‚โ€ข Volume         โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚  Enrichment โ”‚ โ”‚  Deploy     โ”‚ โ”‚โ€ข Hardware   โ”‚ โ”‚  Management     โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚โ€ข WebSocket  โ”‚ โ”‚โ€ข Discovery  โ”‚ โ”‚  Testing    โ”‚ โ”‚โ€ข Network        โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚โ€ข MQTT       โ”‚ โ”‚โ€ข Migration  โ”‚ โ”‚โ€ข Firmware   โ”‚ โ”‚  Management     โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚โ€ข Console    โ”‚ โ”‚โ€ข Auto Scale โ”‚ โ”‚  Upload     โ”‚ โ”‚โ€ข Resource       โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ”‚  Output     โ”‚ โ”‚โ€ข Load Bal.  โ”‚ โ”‚โ€ข Monitor    โ”‚ โ”‚  Monitoring     โ”‚  โ”‚     โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚     โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โœจ Features

๐Ÿ”ง Component Layers

graph TB
    CLI[CLI Interface] --> Core[Core Isolation]
    CLI --> Platform[Platform Detection]
    
    Core --> Docker[Docker Manager]
    Platform --> Docker
    
    Docker --> Arduino[Arduino Container]
    Docker --> MicroPython[MicroPython Container]  
    Docker --> ARM64[ARM64 Container]
    Docker --> x86[x86_64 Container]
    
    Arduino --> Hardware1[Arduino Hardware]
    MicroPython --> Hardware2[ESP32/CircuitPython]
    ARM64 --> Hardware3[Raspberry Pi/Apple M1]
    x86 --> Hardware4[Standard PC/Server]

๐Ÿš€ Quick Start

Installation

# Basic installation
pip install servos

# With all optional dependencies
pip install servos[all]

# With Docker support
pip install servos[docker]

# For MicroPython development
pip install servos[micropython]

# For Arduino development  
pip install servos[arduino]

Basic Usage

from servos import IsolationManager, PlatformDetector

# Detect current platform
detector = PlatformDetector()
platform = detector.detect_platform()
print(f"Detected platform: {platform}")

# Create isolated environment
manager = IsolationManager(platform=platform)
result = manager.execute_isolated("my_script.py")

CLI Usage

# Detect current platform
servos detect

# Run script in isolated environment
servos isolate my_script.py

# List supported platforms
servos list-platforms

# Show version information
servos version

๐ŸŒ Supported Platforms

Platform Description Container Use Cases
arduino Arduino & compatible MCUs โœ… IoT, embedded systems
micropython MicroPython environments โœ… ESP32, CircuitPython
arm64 ARM64 processors โœ… Raspberry Pi, Apple M1
x86_64 Standard x86_64 โœ… PCs, servers
rpi-arm Raspberry Pi ARM โœ… Pi-specific projects

๐Ÿ“ฆ Package Structure

servos/
โ”œโ”€โ”€ servos/
โ”‚   โ”œโ”€โ”€ __init__.py              # Main package interface
โ”‚   โ”œโ”€โ”€ cli.py                   # Command-line interface
โ”‚   โ”œโ”€โ”€ core/
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ””โ”€โ”€ isolation.py         # Core isolation management
โ”‚   โ””โ”€โ”€ isolation/
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ”œโ”€โ”€ extended_environments.py  # Extended isolation
โ”‚       โ””โ”€โ”€ platforms/           # Platform-specific code
โ”œโ”€โ”€ docker/                      # Container definitions
โ”‚   โ”œโ”€โ”€ arduino/                 # Arduino container
โ”‚   โ”œโ”€โ”€ micropython/            # MicroPython container
โ”‚   โ”œโ”€โ”€ arm64/                  # ARM64 container
โ”‚   โ””โ”€โ”€ x86_64/                 # x86_64 container
โ”œโ”€โ”€ tests/                      # Test suite
โ”œโ”€โ”€ setup.py                    # Package configuration
โ”œโ”€โ”€ requirements.txt            # Dependencies
โ”œโ”€โ”€ Makefile                    # Build automation
โ””โ”€โ”€ README.md                   # This file

๐Ÿ”จ Development

Local Development

# Clone and setup
git clone https://github.com/servos/servos.git
cd servos

# Install in development mode
make install

# Run tests
make test

# Build package
make build

# Format code
make format

Building Containers

The Docker environments are automatically built when needed, but you can also build them manually:

# Build specific platform container
docker build -f docker/arduino/Dockerfile -t servos:arduino .
docker build -f docker/micropython/Dockerfile -t servos:micropython .
docker build -f docker/arm64/Dockerfile -t servos:arm64 .
docker build -f docker/x86_64/Dockerfile -t servos:x86_64 .

๐Ÿงช Testing

# Run all tests
make test

# Run specific test
python -m pytest tests/test_isolation.py

# Run with coverage
python -m pytest --cov=servos tests/

๐Ÿ“š API Reference

IsolationManager

Main class for managing environment isolation:

from servos import IsolationManager, EnvironmentConfig

config = EnvironmentConfig()
manager = IsolationManager(platform="arduino", config=config)
result = manager.execute_isolated("blink_led.py")

PlatformDetector

Automatic platform detection:

from servos.isolation.platforms import PlatformDetector

detector = PlatformDetector()
platform = detector.detect_platform()
architecture = detector.get_architecture()

๐Ÿ”— Integration with ProServe

Servos is designed to work seamlessly with the ProServe framework:

# In your ProServe service manifest
dependencies:
  - servos>=1.0.0

# Use in ProServe services
from servos import IsolationManager
from proserve import Service

class MyService(Service):
    def __init__(self):
        self.isolation = IsolationManager()
    
    async def handle_request(self, request):
        result = self.isolation.execute_isolated("user_script.py")
        return {"status": "success", "result": result}

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the Apache Software License 2.0 - see the LICENSE file for details.

๐Ÿ‘จโ€๐Ÿ’ป Author

Tom Sapletta

๐Ÿ™ Acknowledgments

  • Extracted from the ProServe framework
  • Built for the EDPMT (Electronic Device Programming & Management Tool) ecosystem
  • Inspired by modern containerization and microservices architectures

Servos - Making environment isolation simple and powerful! ๐Ÿš€

Documentation

Python Packages

Explore the ecosystem of Python packages related to Servos:

  • ProServe - Core microservices framework
  • Servos - Environment isolation and orchestration
  • wmlog - Centralized structured logging
  • SELLM - AI-powered manifest generator
  • EDPMT - Hardware control framework for IoT

Why Servos?

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

servos-1.0.5.tar.gz (50.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

servos-1.0.5-py3-none-any.whl (47.0 kB view details)

Uploaded Python 3

File details

Details for the file servos-1.0.5.tar.gz.

File metadata

  • Download URL: servos-1.0.5.tar.gz
  • Upload date:
  • Size: 50.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for servos-1.0.5.tar.gz
Algorithm Hash digest
SHA256 7445b23f6f7faa177d41b82f8dff1c3205c423c234e37b1855f097190fb7d9cc
MD5 a140120afe419e78a70f374af7ce32eb
BLAKE2b-256 8e97eb013d3d8ea8849bc6840b47410393329d6414e2562432779f2233c0b5fc

See more details on using hashes here.

File details

Details for the file servos-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: servos-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 47.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for servos-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 640baae22c28de19d287e78619bd98b300e87ad721de70bade3f783d064bb8db
MD5 74388c9ffd6cad1bbca0ef48c18ff96a
BLAKE2b-256 32c47d58a5baa87917f41d97e9ce34ad805a7a467f1f8efd6625a1e7b636481e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page