-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlib.rs
More file actions
131 lines (115 loc) · 4.75 KB
/
lib.rs
File metadata and controls
131 lines (115 loc) · 4.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
//! # RustKernel Core
//!
//! Core abstractions, traits, and registry for the RustKernels GPU kernel library.
//!
//! This crate provides:
//! - Domain and kernel type definitions
//! - Kernel metadata and configuration
//! - Trait definitions for batch and ring kernels
//! - Kernel registry with auto-discovery
//! - Licensing and feature gating system
//! - Actix actor integration for GPU-backed actors
//! - Runtime lifecycle management
//! - Enterprise security, observability, and resilience patterns
//! - Deep integration with ringkernel-core 0.4.2 (domain conversion, K2K, enterprise re-exports)
#![warn(missing_docs)]
#![warn(clippy::all)]
// Core modules
pub mod domain;
pub mod error;
pub mod k2k;
pub mod kernel;
pub mod license;
pub mod messages;
pub mod registry;
pub mod slo;
pub mod test_kernels;
pub mod traits;
// Enterprise modules (with ringkernel-core 0.4.2 bridging)
pub mod config;
pub mod memory;
pub mod observability;
pub mod resilience;
pub mod runtime;
pub mod security;
// Re-exports from ringkernel-core for convenience
pub use ringkernel_core::{
HlcTimestamp, MessageHeader, MessageId, MessageQueue, RingContext, RingKernelError, RingMessage,
};
// Re-export types from specific modules
pub use ringkernel_core::hlc::HlcClock;
pub use ringkernel_core::k2k::{K2KBroker, K2KEndpoint, K2KMessage};
pub use ringkernel_core::message::MessageEnvelope;
pub use ringkernel_core::runtime::{
KernelHandle, KernelId, KernelState, LaunchOptions, RingKernelRuntime,
};
// New re-exports from ringkernel-core 0.4.2
pub use ringkernel_core::control::ControlBlock;
pub use ringkernel_core::k2k::{DeliveryStatus, K2KConfig};
pub use ringkernel_core::message::{CorrelationId as RingCorrelationId, Priority};
pub use ringkernel_core::runtime::{Backend, KernelStatus, RuntimeMetrics};
// Re-export ringkernel-core submodules for advanced consumers
pub use ringkernel_core::checkpoint;
pub use ringkernel_core::dispatcher;
pub use ringkernel_core::health;
pub use ringkernel_core::pubsub;
/// Direct access to the full RingKernel 0.4.2 API.
///
/// For advanced usage, you can access the complete ringkernel-core API through this module.
pub mod ring {
pub use ringkernel_core::*;
}
/// Prelude module for convenient imports
pub mod prelude {
pub use crate::domain::Domain;
pub use crate::error::{KernelError, Result};
pub use crate::k2k::{
FanOutTracker, IterativeConvergenceSummary, IterativeState, K2KControlMessage, K2KPriority,
K2KWorkerResult, PipelineTracker, ScatterGatherState, kernel_id_to_u64,
};
pub use crate::kernel::{KernelMetadata, KernelMode};
pub use crate::license::{DevelopmentLicense, License, LicenseError, LicenseValidator};
pub use crate::messages::{
BatchMessage, CorrelationId, KernelRequest, KernelResponse, KernelResult,
};
pub use crate::registry::{KernelRegistry, RegistryStats};
pub use crate::slo::{SLOResult, SLOValidator};
pub use crate::test_kernels::{EchoKernel, MatMul, ReduceSum, VectorAdd};
pub use crate::traits::{
BatchKernel, BatchKernelDyn, CheckpointableKernel, DegradableKernel, ExecutionContext,
GpuKernel, HealthStatus, IterativeKernel, KernelConfig, RingKernelDyn, RingKernelHandler,
SecureRingContext, TypeErasedBatchKernel, TypeErasedRingKernel,
};
// Runtime lifecycle
pub use crate::runtime::{
KernelRuntime, LifecycleState, RuntimeBuilder, RuntimeConfig, RuntimeHandle, RuntimePreset,
RuntimeStats,
};
// Resilience patterns
pub use crate::resilience::{
CircuitBreaker, CircuitBreakerConfig, CircuitState, DeadlineContext, HealthCheck,
HealthCheckResult, HealthProbe, RecoveryPolicy, ResilienceConfig, RetryConfig,
TimeoutConfig,
};
// Security
pub use crate::security::{
AuthConfig, KernelPermission, Permission, PermissionSet, Role, SecurityConfig,
SecurityContext, TenantId,
};
// Memory management
pub use crate::memory::{
AnalyticsContext, AnalyticsContextManager, InterPhaseReduction, KernelMemoryManager,
MemoryConfig, MemoryError, MemoryStats, PressureLevel, ReductionConfig, SyncMode,
};
// Production configuration
pub use crate::config::{ProductionConfig, ProductionConfigBuilder};
// Re-exports from ringkernel-core
pub use ringkernel_core::k2k::{K2KBroker, K2KEndpoint};
pub use ringkernel_core::runtime::{KernelHandle, KernelId, KernelState, LaunchOptions};
pub use ringkernel_core::{HlcTimestamp, MessageId, RingContext, RingMessage};
// New re-exports from ringkernel-core 0.4.2
pub use ringkernel_core::control::ControlBlock;
pub use ringkernel_core::k2k::K2KConfig;
pub use ringkernel_core::message::Priority;
pub use ringkernel_core::runtime::{Backend, KernelStatus, RuntimeMetrics};
}