Skip to content

Commit

Permalink
Merge pull request #5 from AirPipeIO/feat/codel
Browse files Browse the repository at this point in the history
feature stack
  • Loading branch information
Kav91 authored Feb 17, 2025
2 parents 579d478 + 62e1778 commit c4441d5
Show file tree
Hide file tree
Showing 30 changed files with 2,934 additions and 1,535 deletions.
26 changes: 3 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.136"
serde_yaml = "0.9"
humantime-serde = "1.1.1"
dashmap = "6.1.0"
uuid = { version = "1.12.0", features = ["v4", "serde"] }
validator = { version = "0.20", features = ["derive"] }
validator_derive = "0.20.0"
Expand All @@ -29,12 +28,14 @@ pingora-http = "0.4.0"
pingora-load-balancing = "0.4.0"
pingora-proxy = "0.4.0"
pingora-core = "0.4.0"
# pingora-core = { path = "/home/kav/dev/rust/pingora/pingora-core" }
notify = "8.0.0"
notify-debouncer-full = "0.5.0"
axum = "0.8.1"
prometheus = { version = "0.13.4", features = ["process"] }
tempfile = "3.15.0"
walkdir = "2.5.0"
libc = "0.2.169"

# logging
slog = { version = "2.7.0" }
Expand Down
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,22 @@ Orbit is a simple, lightweight solution for scaling containers with built-in ser
- Automatic container registration
- Dynamic proxy configuration
- Container Management:
- Automated scaling based on resource usage
- Rolling updates with configurable strategies
- Volume management
- Intelligent Autoscaling:
- CoDel-based (controlled delay) adaptive scaling for latency management (experimental)
- See https://en.wikipedia.org/wiki/CoDel for more
- Resource-based scaling with configurable thresholds
- Relative CPU metrics support
- Health Monitoring:
- TCP health checks
- Customizable health check parameters
- Automatic container recovery
- Resource Management:
- Flexible resource limits (CPU, Memory)
- Network rate limiting
- Volume management with multiple types
- Rolling Updates(experimental):
- Automated image update detection
- Zero-downtime deployments
- Configuration:
- Simple YAML-based service definitions
- Hot reload support
Expand Down
74 changes: 66 additions & 8 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
Orbit provides a HTTP API for monitoring and managing services. The API server runs on port 4112 by default.

## Endpoints
- /status
- /metrics

### Status API

Expand All @@ -14,7 +16,7 @@ Orbit provides a HTTP API for monitoring and managing services. The API server r
GET /status
```

Returns the current status of all services including their containers, ports, and health information.
Returns the current status of all services including their containers, ports, health information, and resource usage statistics.

**Response Format:**
```json
Expand All @@ -24,6 +26,12 @@ Returns the current status of all services including their containers, ports, an
"service_ports": [
number
],
"service_urls": [
{
"url": "string",
"node_port": number
}
],
"pods": [
{
"uuid": "string",
Expand All @@ -43,7 +51,25 @@ Returns the current status of all services including their containers, ports, an
"cpu_percentage": number,
"cpu_percentage_relative": number,
"memory_usage": number,
"memory_limit": number
"memory_limit": number,
"urls": [
{
"url": "string",
"port": number,
"target_url": "string",
"target_port": number
}
],
"health_status": {
"state": "string",
"last_state": "string",
"last_transition": "string",
"restart_count": number,
"last_restart": "string",
"failure_count": number,
"last_failure": "string",
"message": "string"
}
}
]
}
Expand All @@ -58,6 +84,12 @@ Returns the current status of all services including their containers, ports, an
{
"service_name": "web-service",
"service_ports": [80],
"service_urls": [
{
"url": "http://localhost:30080",
"node_port": 30080
}
],
"pods": [
{
"uuid": "550e8400-e29b-41d4-a716-446655440000",
Expand All @@ -77,7 +109,23 @@ Returns the current status of all services including their containers, ports, an
"cpu_percentage": 0.5,
"cpu_percentage_relative": 25.0,
"memory_usage": 52428800,
"memory_limit": 268435456
"memory_limit": 268435456,
"urls": [
{
"url": "http://172.17.0.2:80",
"port": 80,
"target_url": null,
"target_port": null
}
],
"health_status": {
"state": "Healthy",
"last_state": "Starting",
"last_transition": "2024-02-17T10:30:00Z",
"restart_count": 0,
"failure_count": 0,
"message": null
}
}
]
}
Expand All @@ -95,10 +143,21 @@ GET /metrics
```

Returns metrics in Prometheus exposition format, including:
- Service-level metrics
- Container resource usage
- Request statistics
- Volume metrics

**Service-level Metrics:**
- `orbit_services_total` - Total number of services being managed
- `orbit_instances_total` - Total number of container instances
- `orbit_config_reloads_total` - Total number of configuration reloads

**Request Metrics:**
- `orbit_service_request_duration_seconds` - Request duration histograms per service
- `orbit_service_requests_total` - Total requests per service
- `orbit_requests_total` - Total number of requests processed

**Volume Metrics:**
- `orbit_volumes_total` - Total number of named volumes
- `orbit_volume_usage_bytes` - Volume usage in bytes
- `orbit_volume_containers` - Number of containers using each volume

**Example Response:**
```
Expand All @@ -120,5 +179,4 @@ orbit_service_request_duration_seconds_bucket{service="web-service",status="200"
orbit_volume_usage_bytes{volume="data"} 1048576
```


Please check back regularly as we continue to expand the API functionality. For the latest updates, see our [GitHub repository](https://github.com/airpipeio/orbit).
Loading

0 comments on commit c4441d5

Please sign in to comment.