rskit-workload 0.2.0-alpha.2

Provider-based workload orchestration: lifecycle Manager trait, config, and component
Documentation

rskit-workload — Provider-Based Workload Orchestration

Provider-agnostic contract for deploying and managing long-running workloads (containers, pods, or any runtime unit) with an explicit backend registry and a lifecycle-managed component.

CI crates.io docs.rs License: MIT

Mirrors gokit's workload package: the same concept and vocabulary, in idiomatic Rust. This crate owns the orchestration contract only — concrete backends (Docker, Kubernetes, …) live in separate adapter crates that register a ManagerFactory; no backend is wired in implicitly.

Features

  • Manager trait: deploy / stop / remove / restart / status / wait / logs / list / health check
  • Optional capability traits: ExecCapable, StatsCapable, LogStreamer, EventWatcher, SystemInfoCapable, DiskUsageCapable, ImageInspector, ImageEventWatcher
  • WorkloadRegistry — explicit, injected backend selection by provider name
  • WorkloadComponentrskit-component lifecycle (start / stop / health)
  • WorkloadState / RestartPolicy enums and CPU/memory quantity helpers

Usage

[dependencies]
rskit-workload = "0.2.0-alpha.2"
use rskit_workload::{WorkloadComponent, WorkloadConfig};
use rskit_component::Component;

# #[tokio::main]
# async fn main() -> rskit_errors::AppResult<()> {
let component = WorkloadComponent::new(WorkloadConfig::default());
component.start().await?;
assert!(component.health().is_healthy());
component.stop().await?;
# Ok(())
# }

Register a backend factory into a WorkloadRegistry, then pass it to WorkloadComponent::with_registry with an enabled WorkloadConfig to run a real provider.

License

MIT