From dba39c953d62335d9f40e62fc01f9e06a93ac981 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 7 Oct 2026 10:02:59 +0000 Subject: [PATCH] :recycle: The exporter boots as a queue consumer by default Nothing of the old exporter deserves preserving: once the plan ends there is no HTTP surface, so the default of `PENPOT_EXPORTER_ROLES` stops being `http` and becomes `worker`. The process that dev and deploy have always started (the tmux window's recipe and the compose service, both untouched) now boots the K pollers of the backend queue; `http` stays selectable by env only until the deletion task takes the legacy surfaces away. AI-assisted-by: glm-5.3-flash --- exporter/src/app/config.cljs | 7 ++++--- exporter/src/app/consumer/config.cljs | 18 ++++++++++-------- .../exporter_tests/consumer_config_test.cljs | 7 +++++-- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/exporter/src/app/config.cljs b/exporter/src/app/config.cljs index 48b73f3115..d9829b7ec9 100644 --- a/exporter/src/app/config.cljs +++ b/exporter/src/app/config.cljs @@ -33,9 +33,10 @@ :exporter-max-jobs-per-profile 2 :exporter-queue-max 64 :exporter-job-ttl 3600 - ;; the roles this instance serves: by default only the http service; - ;; `worker` turns the process into a consumer of the backend jobs - :exporter-roles "http" + ;; the roles this instance serves: by default the consumer of the + ;; backend jobs queue; `http` keeps the legacy surfaces alive until + ;; the deletion task takes them away + :exporter-roles "worker" :exporter-worker-concurrency 2 :wasm-worker-pool-max 2 :wasm-worker-pool-min 1 diff --git a/exporter/src/app/consumer/config.cljs b/exporter/src/app/consumer/config.cljs index 02504c75f5..460f634106 100644 --- a/exporter/src/app/consumer/config.cljs +++ b/exporter/src/app/consumer/config.cljs @@ -5,14 +5,16 @@ ;; Copyright (c) KALEIDOS SUBSIDIARY SL (ns app.consumer.config - "The worker role of the exporter configuration. + "The roles of the exporter process. - The exporter process may serve its http surfaces, consume the - backend `:exporter` queue, or both: `PENPOT_EXPORTER_ROLES` names the - roles (`http` by default, `http,worker` during the transition). The - worker pieces never read these values at import time: each accessor - reads the live configuration, so a long-lived process can be - restarted with another role without code changes." + `PENPOT_EXPORTER_ROLES` names the roles the process serves: `http` + serves the surfaces the exporter used to serve (gone once the + deletion task lands), `worker` consumes the backend `:exporter` + queue. The default is `worker`: the exporter is a consumer's process, + and no surface of it needs to be preserved. The worker pieces never + read these values at import time: each accessor reads the live + configuration, so a long-lived process can be restarted with another + role without code changes." (:require [app.config :as cf] [cljs.core :as c] @@ -38,7 +40,7 @@ ([] (roles (cf/get :exporter-roles))) ([spec] (if (nil? spec) - #{:http} + #{:worker} (scan-roles spec)))) (defn worker-enabled? diff --git a/exporter/test/exporter_tests/consumer_config_test.cljs b/exporter/test/exporter_tests/consumer_config_test.cljs index e3f95b6476..a71ce17a01 100644 --- a/exporter/test/exporter_tests/consumer_config_test.cljs +++ b/exporter/test/exporter_tests/consumer_config_test.cljs @@ -13,8 +13,11 @@ [cuerdas.core :as str])) (t/deftest roles-parse-the-env-list - (t/testing "the default keeps the http surfaces only" - (t/is (= #{:http} (ccfg/roles "http")))) + (t/testing "the default serves the worker role only: the exporter is + a consumer's process, no surface needs preserving" + (t/is (= #{:worker} (ccfg/roles nil))) + (t/is (= #{:worker} (ccfg/roles)))) + (t/is (= #{:http} (ccfg/roles "http"))) (t/is (= #{:http :worker} (ccfg/roles "http,worker"))) (t/is (= #{:http :worker} (ccfg/roles "http, worker"))) (t/testing "the parser does not invent roles from noise"