feat: add worker distributor and model registry
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-01-18 01:46:37 +01:00
parent 54aa310583
commit 2cdab4a1ab
28 changed files with 1169 additions and 29 deletions

View File

@@ -1,4 +1,22 @@
CREATE TABLE worker_register (
worker_id UUID PRIMARY KEY NOT NULL
worker_id UUID PRIMARY KEY NOT NULL
, capacity INTEGER NOT NULL
, heart_beat TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE TABLE model_schedules (
model_name TEXT PRIMARY KEY NOT NULL
, last_run TIMESTAMPTZ
);
CREATE TABLE work_schedule (
schedule_id UUID PRIMARY KEY NOT NULL
, worker_id UUID NOT NULL
, start_run TIMESTAMPTZ NOT NULL
, end_run TIMESTAMPTZ NOT NULL
, updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
, state TEXT NOT NULL
);
CREATE INDEX idx_work_schedule_worker ON work_schedule (worker_id);
CREATE INDEX idx_work_schedule_worker_updated ON work_schedule (worker_id, updated_at DESC);