OmniAgent is a robust, cross-platform container management and deployment agent built in Rust. It provides a RESTful API interface to Docker operations, making it easier to manage containerized applications across distributed environments.
- π³ Complete Docker Management: Control containers, images, volumes, and networks through a simple API
- π Real-time Metrics: Prometheus-compatible metrics for monitoring system and container performance
- π Auto-Discovery: Self-initializes Docker if not already running (platform aware)
- π Secure API: Built-in token-based authentication system
- π Cross-Platform: Runs on Linux, macOS, and Windows
- π Efficient: Small memory footprint and fast performance with Rust
- π‘ Heartbeat System: Built-in communication with centralized director services
- π Extensible: Modular design makes it easy to add new features
docker run -d --name omniagent \
-p 8081:8081 \
-p 2375:2375 \
-v /var/run/docker.sock:/var/run/docker.sock \
ghcr.io/yourusername/omniagent:latest- Download the latest binary for your platform from the Releases page.
- Make it executable (Linux/macOS):
chmod +x omni-agent - Run it:
./omni-agent
Prerequisites: Rust and Cargo installed
# Clone the repository
git clone https://github.com/yourusername/OmniAgent.git
cd OmniAgent
# Build the project
cargo build --release
# Run the agent
./target/release/omni-agentOmniAgent exposes a RESTful API on port 8081. Here are the core endpoints:
GET /api/containers- List all containersGET /api/containers/{id}- Get container detailsPOST /api/containers- Create a new containerPOST /api/containers/{id}/start- Start a containerPOST /api/containers/{id}/stop- Stop a containerPOST /api/containers/{id}/restart- Restart a containerDELETE /api/containers/{id}- Remove a containerGET /api/containers/{id}/logs- Get container logsPOST /api/containers/{id}/exec- Execute a command in a container
GET /api/images- List all imagesPOST /api/images/pull- Pull an imageDELETE /api/images/{id}- Remove an imagePOST /api/images/build- Build an imageGET /api/images/{id}- Get image details
GET /api/volumes- List all volumesPOST /api/volumes- Create a volumeGET /api/volumes/{name}- Get volume detailsDELETE /api/volumes/{name}- Remove a volumePOST /api/volumes/prune- Prune unused volumes
GET /api/networks- List all networksPOST /api/networks- Create a networkGET /api/networks/{id}- Get network detailsDELETE /api/networks/{id}- Remove a networkPOST /api/networks/{id}/connect- Connect a container to a networkPOST /api/networks/{id}/disconnect- Disconnect a container from a networkPOST /api/networks/prune- Prune unused networks
GET /api/system/health- Get system healthGET /api/system/metrics- Get system metricsGET /api/system/events- Get system eventsPOST /api/system/prune- Prune unused Docker resources
GET /api/agent/status- Get agent statusPOST /api/agent/register- Register agent with a directorPOST /api/agent/update- Update agent configuration
Metrics are exposed in Prometheus format at /metrics and in JSON format at /metrics/json.
OmniAgent follows a modular architecture:
- Docker Manager: Core component for interacting with Docker
- API Layer: Provides RESTful endpoints
- Authentication: Token-based authentication system
- Metrics Collector: Gathers system and container metrics
- Models: Data structures for API communication
OmniAgent supports:
- Linux (x86_64, ARM64, ARMv7)
- macOS (x86_64, ARM64)
- Windows (x86_64, i686, ARM64)
Each platform has platform-specific optimizations for Docker communication.
OmniAgent is designed to be packed into the VM images OmniDirectory deploys. This allows the platform to manage apps easily within a given worker.
OmniAgent can be registered with a central director service for fleet management:
curl -X POST http://localhost:8081/api/agent/register \
-H "Content-Type: application/json" \
-d '{"director_url": "http://director.example.com", "token": "your-token"}'Create complex container configurations:
curl -X POST http://localhost:8081/api/containers \
-H "Content-Type: application/json" \
-d '{
"name": "my-app",
"image": "nginx:latest",
"ports": [{"host": 8080, "container": 80, "protocol": "tcp"}],
"environment": {"DEBUG": "true", "NODE_ENV": "production"},
"volumes": [{"host": "/data", "container": "/app/data", "read_only": false}],
"restart_policy": "always"
}'cargo testcargo build --target x86_64-unknown-linux-gnu
cargo build --target aarch64-apple-darwin
cargo build --target x86_64-pc-windows-msvcThis project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Project Link: https://github.com/OmniCloudOrg/OmniAgent
- Issue Tracker: https://github.com/OmniCloudOrg/OmniAgent/issues
Made with β€οΈ by Tristan J. Poland and the OmniCloud Community