Каркас monorepo: scheduler, data_collector, khbuild_assistant_prep, khb_common; миграции; CI/CD
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
48
settings_example.json5
Normal file
48
settings_example.json5
Normal file
@@ -0,0 +1,48 @@
|
||||
// Шаблон единого конфига всех сервисов репозитория khb_microservices.
|
||||
// Скопировать в settings.json5 (он в .gitignore, в git не попадает) и заполнить секреты.
|
||||
{
|
||||
common: {
|
||||
timezone: "America/New_York",
|
||||
database: { url: "postgres://USER:PASSWORD@HOST:5432/postgres" },
|
||||
logLevel: "info",
|
||||
itAlerts: { slackChannelId: "<канал ИТ-команды>", slackBotToken: "<xoxb token>" }, // куда уходят уведомления о сбоях
|
||||
},
|
||||
jobtread: { organizationId: "<org id>", grantKey: "<grant key>" },
|
||||
|
||||
scheduler: {
|
||||
tickSeconds: 10, // как часто проверять условия старта заданий
|
||||
missedGraceSeconds: 60, // позже этого срока задание считается пропущенным (не запускается, только лог)
|
||||
http: { host: "127.0.0.1", port: 8083, token: "<token>" },
|
||||
jobs: [
|
||||
// at - время по common.timezone; days: "daily" | "workdays" (по таблице calendar_day) | ["mon","fri"]
|
||||
{ name: "collect_before_morning", call: { service: "data_collector", method: "POST", path: "/runs" }, at: "05:50", days: "daily" },
|
||||
{ name: "prep_morning", call: { service: "khbuild_assistant_prep", method: "POST", path: "/runs", body: { job: "collect_morning" } }, at: "06:00", days: "daily" },
|
||||
{ name: "collect_before_noon", call: { service: "data_collector", method: "POST", path: "/runs" }, at: "11:40", days: "daily" },
|
||||
{ name: "prep_noon_recheck", call: { service: "khbuild_assistant_prep", method: "POST", path: "/runs", body: { job: "recheck_noon" } }, at: "11:50", days: "daily" },
|
||||
{ name: "retention", call: { service: "data_collector", method: "POST", path: "/retention/run" }, at: "03:30", days: "daily" },
|
||||
],
|
||||
services: {
|
||||
data_collector: { baseUrl: "http://127.0.0.1:8084", token: "<token>" },
|
||||
khbuild_assistant_prep: { baseUrl: "http://127.0.0.1:8085", token: "<token>" },
|
||||
},
|
||||
},
|
||||
|
||||
data_collector: {
|
||||
http: { host: "127.0.0.1", port: 8084, token: "<token>" },
|
||||
sources: ["jobtread"], // источники-зеркала
|
||||
mirror: { maxSnapshotAgeMinutes: 90 },
|
||||
retention: {
|
||||
hourlyKeepHours: 24, dailyKeepDays: 370, dbSizeLimitGb: 30, reducedDaysSteps: [180, 90, 35],
|
||||
failedKeepDays: 10, failedMaxPerDay: 20,
|
||||
},
|
||||
holidays: { country: "US", state: "FL", yearsAhead: 2 }, // импорт в native-таблицу calendar_day (не зеркало)
|
||||
},
|
||||
|
||||
khbuild_assistant_prep: {
|
||||
http: { host: "127.0.0.1", port: 8085, token: "<token>" },
|
||||
requiredTables: ["jt_job", "jt_membership", "jt_task", "jt_task_dependency", "jt_task_assignment"], // от каких таблиц зависит; ошибки других таблиц на сервис не влияют
|
||||
lookaheadWorkDays: 10,
|
||||
modes: ["test"], // какие project.mode обрабатывать
|
||||
agent: { triggerUrl: "<routine api trigger url>", triggerToken: "<token>" },
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user