feat(billing): finalize tenant subscription entitlements and platform stabilization fixes
Some checks failed
ci / ui (push) Failing after 30s
images / build-and-push (push) Failing after 20s
ci / rust (push) Failing after 2m41s

This commit is contained in:
2026-03-30 21:46:26 +03:00
parent 2595e7f1c5
commit 63ca237178
8 changed files with 292 additions and 1250 deletions

View File

@@ -38,10 +38,9 @@ async fn serve() {
settings.shard_id.clone(),
));
spawn_health_probe(admin.clone(), settings.clone());
spawn_placement_watcher(admin.placement_manager(), settings.clone());
let storage = StorageClient::open(settings.storage_path.clone()).unwrap();
spawn_health_probe(admin.clone(), settings.clone(), storage.clone());
spawn_placement_watcher(admin.placement_manager(), settings.clone());
let stream = StreamClient::new(settings.nats_url.clone()).await.unwrap();
let _ = stream.setup_stream().await;
let executor = RuntimeExecutor::new();
@@ -115,10 +114,10 @@ fn load_settings() -> Settings {
Settings::from_env().unwrap_or_default()
}
fn spawn_health_probe(admin: Arc<AdminServer>, settings: Settings) {
fn spawn_health_probe(admin: Arc<AdminServer>, settings: Settings, storage: StorageClient) {
tokio::spawn(async move {
loop {
let storage_ok = StorageClient::open(settings.storage_path.clone()).is_ok();
let storage_ok = storage.check_health().is_ok();
admin.health_checker().set_storage_healthy(storage_ok);
let stream_ok = tokio::time::timeout(Duration::from_secs(1), async {

File diff suppressed because it is too large Load Diff

View File

@@ -29,7 +29,7 @@
"eslint-plugin-react-refresh": "^0.5.2",
"globals": "^17.4.0",
"jsdom": "^27.0.0",
"typescript": "~5.9.3",
"typescript": "^5.7.3",
"typescript-eslint": "^8.57.0",
"vite": "^8.0.1",
"vitest": "^3.2.4"

View File

@@ -34,6 +34,7 @@ services:
command:
- |
set -euo pipefail
sleep 5
mc alias set local http://minio:9000 minioadmin minioadmin
mc mb -p local/cloudlysis-docs || true
mc mb -p local/cloudlysis-loki || true
@@ -53,6 +54,7 @@ services:
BIN: gateway
depends_on:
- nats
user: root
environment:
GATEWAY_ADDR: 0.0.0.0:8080
GATEWAY_GRPC_ADDR: 0.0.0.0:8081
@@ -74,6 +76,7 @@ services:
BIN: aggregate
depends_on:
- nats
user: root
environment:
AGGREGATE_NATS_URL: nats://nats:4222
AGGREGATE_STORAGE_PATH: /data
@@ -94,6 +97,7 @@ services:
BIN: projection
depends_on:
- nats
user: root
environment:
PROJECTION_NATS_URL: nats://nats:4222
PROJECTION_STREAM_NAME: AGGREGATE_EVENTS
@@ -117,6 +121,7 @@ services:
BIN: runner
depends_on:
- nats
user: root
environment:
RUNNER_NATS_URL: nats://nats:4222
RUNNER_STORAGE_PATH: /data/runner.mdbx

View File

@@ -2,8 +2,8 @@ FROM node:20-alpine AS builder
WORKDIR /app
COPY control/ui/package.json control/ui/package-lock.json ./
RUN npm ci
COPY control/ui/package.json ./
RUN npm install
COPY control/ui .
RUN npm run build

View File

@@ -0,0 +1 @@
projections: {}

View File

@@ -112,6 +112,7 @@ async fn serve() {
worker_ready,
worker_obs,
worker_tenant_placement,
Some(http_state.storage.clone()),
)
.await
});

View File

@@ -53,6 +53,7 @@ pub async fn run_projection_with_signals(
ready: Arc<AtomicBool>,
observability: Observability,
tenant_placement: TenantPlacement,
storage: Option<KvClient>,
) -> Result<(), ProjectionError> {
match settings.consumer_mode {
crate::config::ConsumerMode::Single => {
@@ -63,6 +64,7 @@ pub async fn run_projection_with_signals(
ready: Some(ready),
observability: Some(observability),
tenant_placement: Some(tenant_placement),
storage,
..RunOptions::default()
},
)
@@ -76,6 +78,7 @@ pub async fn run_projection_with_signals(
ready: Some(ready),
observability: Some(observability),
tenant_placement: Some(tenant_placement),
storage,
..RunOptions::default()
},
)