Scaphandre is a Rust-based CLI tool for monitoring electric power and energy consumption of hosts and processes. It reads RAPL (Running Average Power Limit) energy counters from Linux sysfs or Windows MSR, computes per-process power attribution using CPU usage ratios, and exports metrics via multiple backends: Prometheus (HTTP scrape or push gateway), JSON, stdout, Riemann, Warp10, and QEMU for virtual machines. The architecture is modular, built on `Sensor` and `Exporter` traits, allowing easy extension. It is packaged for Docker, Kubernetes (Helm chart), Linux (RPM/DEB), and Windows (installer with custom driver). The project is production-ready, actively maintained, and backed by extensive documentation and CI/CD pipelines. It is intended for infrastructure sustainability monitoring and carbon footprint tracking.
Nanocl is a distributed container orchestration system designed as a Kubernetes alternative, focusing on simplicity and declarative state management. The system manages workloads termed 'Cargoes' (containers), 'VMs', and 'Jobs' using Docker as the underlying runtime. It features a client-server architecture with a CLI (`nanocl`), a central daemon (`nanocld`), and auxiliary sidecar services for proxying (`ncproxy`) and DNS (`ncdns`). The architecture relies on Rust for performance and safety, utilizing `ntex` for async HTTP handling and `diesel` for database persistence. The core operational model is driven by declarative Statefiles (YAML/TOML/JSON) processed with Liquid templating. These files define the desired infrastructure state, which the daemon reconciles against the actual runtime state. The system integrates directly with the Docker daemon via the `bollard` library to manage container lifecycles, networking, and images. It features a robust event-driven architecture where state changes trigger sidecar updates, such as Nginx configuration regeneration for routing. The codebase demonstrates a modular design with shared crates for error handling, stubs, and utilities. It implements a generic repository pattern for database access and abstract lifecycle traits for resource management. The API is versioned and documented via OpenAPI/Swagger, supporting RESTful CRUD operations and real-time event streaming. While the project shows strong architectural patterns, it carries medium technical drift due to API versioning fragmentation and heavy dependency on Docker API behavior.
This repository implements a Terraform provider for managing Incus, a container and virtual machine orchestration platform. It provides full CRUD operations for Incus resources such as instances, networks, storage pools, profiles, projects, certificates, cluster groups, and server configuration, along with corresponding data sources for reading existing state. The provider is built using the Terraform Plugin Framework (v1.19.0) with some fallback to Plugin SDK v2, and communicates with Incus via its client library (github.com/lxc/incus/v7). Key entry points include the main.go provider server, internal/provider/provider.go for resource registration, and individual resource files under internal/{certificate,cluster,image,instance,network,profile,project,server,storage}. The provider supports multiple remotes, OIDC authentication, clustering, and PKI, and includes a code generation tool (cmd/generate-datasources) that produces consistent data source implementations and documentation from a YAML configuration and Go templates. Acceptance tests require a live Incus environment and cover complex scenarios like instance lifecycle, exec triggers, file uploads, and import. The codebase is well-structured with shared utilities in internal/common for config/device/file/import handling, and demonstrates a consistent pattern for state synchronization and error handling. However, it carries some technical debt from its fork of the LXD provider, including dual SDK usage and heavy boilerplate that could benefit from further abstraction.