@malloy-publisher/server 0.12.4 → 0.12.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/instrumentation.mjs +95 -10
- package/dist/package_load_worker.mjs +94 -9
- package/dist/server.mjs +840 -631
- package/package.json +2 -1
package/dist/instrumentation.mjs
CHANGED
|
@@ -107,8 +107,11 @@ function setting(entry) {
|
|
|
107
107
|
type: entry.type,
|
|
108
108
|
default: entry.default,
|
|
109
109
|
description: entry.description,
|
|
110
|
+
...entry.notes !== undefined ? { notes: entry.notes } : {},
|
|
111
|
+
...entry.defaultText !== undefined ? { defaultText: entry.defaultText } : {},
|
|
110
112
|
kind: entry.kind ?? "server",
|
|
111
113
|
secret: entry.secret ?? false,
|
|
114
|
+
...entry.masked ? { masked: true } : {},
|
|
112
115
|
aliases: entry.aliases ?? {}
|
|
113
116
|
};
|
|
114
117
|
}
|
|
@@ -277,6 +280,7 @@ var init_access = __esm(() => {
|
|
|
277
280
|
type: boolean(),
|
|
278
281
|
default: false,
|
|
279
282
|
description: "Allow publisher connections, which make this server call a configured connectionUri.",
|
|
283
|
+
notes: "Set to `true` to allow `publisher`-type proxy connections (Publisher-to-Publisher). See [connections.md](connections.md).",
|
|
280
284
|
aliases: {
|
|
281
285
|
env: ["PUBLISHER_ALLOW_PROXY_CONNECTIONS"],
|
|
282
286
|
today: { reads: "exactly-true" }
|
|
@@ -287,6 +291,7 @@ var init_access = __esm(() => {
|
|
|
287
291
|
type: boolean(),
|
|
288
292
|
default: false,
|
|
289
293
|
description: "Allow setupSQL on environment-authored DuckDB connections.",
|
|
294
|
+
notes: "Set to `true` to let environment-level `duckdb` connections carry `setupSQL`. Unset, a connection with `setupSQL` is refused at config load, on create and update, and by the connection test. `setupSQL` runs arbitrary DuckDB statements on the server, including writing host files and loading extensions, so enable it only where the people who author connections are trusted with the host. Refused under `EXTENSION_FETCH_POLICY=local-only` either way. Same boolean spellings as `PUBLISHER_ALLOW_UNVERIFIED_SSH_HOST_KEY`; any other value fails config load.",
|
|
290
295
|
aliases: { env: ["PUBLISHER_ALLOW_DUCKDB_SETUP_SQL"] }
|
|
291
296
|
}),
|
|
292
297
|
setting({
|
|
@@ -294,6 +299,7 @@ var init_access = __esm(() => {
|
|
|
294
299
|
type: boolean(),
|
|
295
300
|
default: false,
|
|
296
301
|
description: "Accept a bastion host key no connection pins.",
|
|
302
|
+
notes: "Set to `true` to let an SSH-proxy connection whose `ssh.hostKey` is not pinned connect anyway, logging a warning each time. Unset, such a tunnel is refused, because an unverified host key means a MITM on the publisher-to-bastion hop cannot be detected. Accepts the same spellings as every other boolean here -- `true`, `1`, `yes`, `on`, case-insensitive and trimmed. Any other value fails config load rather than opting in silently. See [connections.md](connections.md).",
|
|
297
303
|
aliases: { env: ["PUBLISHER_ALLOW_UNVERIFIED_SSH_HOST_KEY"] }
|
|
298
304
|
}),
|
|
299
305
|
setting({
|
|
@@ -301,6 +307,7 @@ var init_access = __esm(() => {
|
|
|
301
307
|
type: oneOf(["any", "destinations-only", "off"]),
|
|
302
308
|
default: "any",
|
|
303
309
|
description: "Where an s3 connection may use the host's credentials: any, destinations-only or off.",
|
|
310
|
+
notes: "Where an S3 connection or attachment may use `provider: credential_chain`, which makes DuckDB resolve the **host's own** credentials (an EKS pod's IRSA role, an EC2 instance profile) instead of a configured key pair. `any`: allowed everywhere. `destinations-only`: allowed on a [storage destination](connections.md#storage-destinations) and on an admin-API catalog, and refused on an environment connection or attachment, which an author may supply. A destination is declared by whoever writes the environment (its config file, or `storageDestinations` on `POST`/`PATCH /environments`), so under this policy keep those writes to operators. `off`: refused everywhere. A refused config fails at load, on create and update, and by the connection test, with an error naming the policy. Any other value fails startup.",
|
|
304
311
|
aliases: { env: ["S3_CREDENTIAL_CHAIN_POLICY"] }
|
|
305
312
|
}),
|
|
306
313
|
setting({
|
|
@@ -308,6 +315,7 @@ var init_access = __esm(() => {
|
|
|
308
315
|
type: string(),
|
|
309
316
|
secret: true,
|
|
310
317
|
description: "Secret a request presents in x-publisher-bypass-authorize to skip #(authorize) gates.",
|
|
318
|
+
notes: "A secret that, sent in the `x-publisher-bypass-authorize` header, skips `#(authorize)` gates for that request. Unset, the header does nothing. See [authorize-bypass-deployment.md](authorize-bypass-deployment.md).",
|
|
311
319
|
aliases: { env: ["PUBLISHER_BYPASS_AUTHORIZE_SECRET"] }
|
|
312
320
|
}),
|
|
313
321
|
setting({
|
|
@@ -315,6 +323,7 @@ var init_access = __esm(() => {
|
|
|
315
323
|
type: oneOf(["error", "warn", "info", "verbose", "debug", "silly"]),
|
|
316
324
|
default: "debug",
|
|
317
325
|
description: "Least severe level logged.",
|
|
326
|
+
notes: "One of `error`, `warn`, `info`, `verbose`, `debug`, `silly`.",
|
|
318
327
|
aliases: { env: ["LOG_LEVEL"], today: { invalid: "warn" } }
|
|
319
328
|
}),
|
|
320
329
|
setting({
|
|
@@ -322,6 +331,7 @@ var init_access = __esm(() => {
|
|
|
322
331
|
type: boolean(),
|
|
323
332
|
default: true,
|
|
324
333
|
description: "Log response bodies.",
|
|
334
|
+
notes: "Set to `true` or `1` to suppress response-body logging.",
|
|
325
335
|
aliases: {
|
|
326
336
|
env: ["DISABLE_RESPONSE_LOGGING"],
|
|
327
337
|
negated: true,
|
|
@@ -333,6 +343,7 @@ var init_access = __esm(() => {
|
|
|
333
343
|
type: integer({ min: 0 }),
|
|
334
344
|
default: 0,
|
|
335
345
|
description: "Seconds to report draining before closing the listeners on shutdown.",
|
|
346
|
+
notes: "After SIGTERM, how long to keep serving in-flight and new requests (readiness reports not-ready immediately) before the server starts refusing new traffic.",
|
|
336
347
|
aliases: {
|
|
337
348
|
env: ["SHUTDOWN_DRAIN_DURATION_SECONDS"],
|
|
338
349
|
flags: ["--shutdown_drain_duration_seconds"]
|
|
@@ -343,6 +354,7 @@ var init_access = __esm(() => {
|
|
|
343
354
|
type: integer({ min: 0 }),
|
|
344
355
|
default: 0,
|
|
345
356
|
description: "Seconds to wait after closing the listeners before exiting.",
|
|
357
|
+
notes: "Time to wait for in-flight requests to drain before forcing close.",
|
|
346
358
|
aliases: {
|
|
347
359
|
env: ["SHUTDOWN_GRACEFUL_CLOSE_TIMEOUT_SECONDS"],
|
|
348
360
|
flags: ["--shutdown_graceful_close_timeout_seconds"]
|
|
@@ -360,6 +372,8 @@ var init_admin = __esm(() => {
|
|
|
360
372
|
key: "admin.port",
|
|
361
373
|
type: integer({ min: 0, max: 65535 }),
|
|
362
374
|
description: "Port of the admin API; unset turns the listener off.",
|
|
375
|
+
notes: "Port for the admin API (`admin-api-doc.yaml`): the operator's surface: the DuckLake catalogs in `PUBLISHER_ADMIN_CATALOG_DATABASE` as resources (create a catalog, load a file into a table, list and drop tables, reclaim old snapshots' storage), and watch mode as one resource, `GET`/`PUT`/`DELETE /watch-mode` (the main API's `/watch-mode/status`, `start` and `stop` are deprecated). Off unless set. Unauthenticated, like the main API. See [ducklake.md](ducklake.md#managing-ducklake-catalogs-the-admin-api).",
|
|
376
|
+
defaultText: "_unset_ (off)",
|
|
363
377
|
aliases: {
|
|
364
378
|
env: ["PUBLISHER_ADMIN_PORT"],
|
|
365
379
|
flags: ["--admin_port"]
|
|
@@ -369,7 +383,8 @@ var init_admin = __esm(() => {
|
|
|
369
383
|
key: "admin.host",
|
|
370
384
|
type: string(),
|
|
371
385
|
default: "127.0.0.1",
|
|
372
|
-
description: "Host the admin API binds to; host does not move it.",
|
|
386
|
+
description: "Host the admin API binds to; {host} does not move it.",
|
|
387
|
+
notes: "Host binding for the admin API. Deliberately not moved by `PUBLISHER_HOST`: putting the main API on every interface does not expose the admin operations. Widen it only inside the network the orchestrator calls from, never behind a public ingress.",
|
|
373
388
|
aliases: { env: ["PUBLISHER_ADMIN_HOST"], flags: ["--admin_host"] }
|
|
374
389
|
}),
|
|
375
390
|
setting({
|
|
@@ -377,18 +392,22 @@ var init_admin = __esm(() => {
|
|
|
377
392
|
type: string(),
|
|
378
393
|
secret: true,
|
|
379
394
|
description: "libpq connection string of the database the admin API finds DuckLake catalogs in.",
|
|
395
|
+
notes: "A libpq connection string (keyword or `postgres://` form) for the Postgres database holding the catalogs the admin API manages. Unset, the admin API's catalog routes answer `503 CATALOG_DATABASE_NOT_CONFIGURED`.",
|
|
380
396
|
aliases: { env: ["PUBLISHER_ADMIN_CATALOG_DATABASE"] }
|
|
381
397
|
}),
|
|
382
398
|
setting({
|
|
383
399
|
key: "admin.storage.provider",
|
|
384
400
|
type: oneOf(["s3", "s3_credential_chain", "gcs"]),
|
|
385
401
|
description: "Object store the catalogs' data paths are read and written with.",
|
|
402
|
+
notes: "The credential the admin API reads and writes catalogs' data paths with: `s3` (with `PUBLISHER_ADMIN_STORAGE_KEY_ID`, `PUBLISHER_ADMIN_STORAGE_SECRET`, and optionally `PUBLISHER_ADMIN_STORAGE_REGION` and `PUBLISHER_ADMIN_STORAGE_ENDPOINT`), `s3_credential_chain` (the host's identity; optional region), or `gcs` (an HMAC key pair in the key id and secret variables). An unknown value or missing key fails startup.",
|
|
403
|
+
defaultText: "_unset_ (local paths)",
|
|
386
404
|
aliases: { env: ["PUBLISHER_ADMIN_STORAGE_PROVIDER"] }
|
|
387
405
|
}),
|
|
388
406
|
setting({
|
|
389
407
|
key: "admin.storage.keyId",
|
|
390
408
|
type: string(),
|
|
391
409
|
description: "Access key id (s3) or HMAC key id (gcs).",
|
|
410
|
+
masked: true,
|
|
392
411
|
aliases: { env: ["PUBLISHER_ADMIN_STORAGE_KEY_ID"] }
|
|
393
412
|
}),
|
|
394
413
|
setting({
|
|
@@ -424,13 +443,16 @@ var init_launch = __esm(() => {
|
|
|
424
443
|
default: ".",
|
|
425
444
|
kind: "launch",
|
|
426
445
|
description: "Directory served from, resolved against the working directory.",
|
|
446
|
+
notes: "Where Publisher keeps its own storage (`publisher_data/`, `publisher.db`), and where it looks for `publisher.config.json` when `--config` is not passed.",
|
|
447
|
+
defaultText: "`.` (cwd)",
|
|
427
448
|
aliases: { env: ["SERVER_ROOT"], flags: ["--server_root"] }
|
|
428
449
|
}),
|
|
429
450
|
setting({
|
|
430
451
|
key: "config",
|
|
431
452
|
type: string(),
|
|
432
453
|
kind: "launch",
|
|
433
|
-
description: "Path to publisher.config.json; default
|
|
454
|
+
description: "Path to publisher.config.json; default: the one in the server root.",
|
|
455
|
+
notes: "Path to the `publisher.config.json` to read, instead of the one in the server root. A path that does not exist is reported at startup, and the server starts with no environments.",
|
|
434
456
|
aliases: { env: ["PUBLISHER_CONFIG_PATH"], flags: ["--config"] }
|
|
435
457
|
}),
|
|
436
458
|
setting({
|
|
@@ -438,7 +460,9 @@ var init_launch = __esm(() => {
|
|
|
438
460
|
type: boolean(),
|
|
439
461
|
default: (resolving) => !resolving.isSet("root") && !resolving.isSet("config") && resolving.env("NODE_ENV") !== "test",
|
|
440
462
|
kind: "launch",
|
|
441
|
-
description: "Serve the bundled sample config when the server root has none; on when neither root nor config is given.",
|
|
463
|
+
description: "Serve the bundled sample config when the server root has none; on when neither {root} nor {config} is given.",
|
|
464
|
+
notes: "Set to `true` to fall back to the sample config bundled inside the installed package when neither `--config` is passed nor a `publisher.config.json` exists at the server root. The server sets this itself on a zero-flag start (so a bare `npx @malloy-publisher/server` boots the samples); passing `--config` or `--server_root` leaves it unset. Because the bundled config lives inside the install, relative package locations resolve against the server root in this mode rather than the config's directory.",
|
|
465
|
+
defaultText: "on unless a `--server_root` or `--config` flag is given; never in tests",
|
|
442
466
|
aliases: {
|
|
443
467
|
env: ["PUBLISHER_USE_BUNDLED_DEFAULT"],
|
|
444
468
|
today: { reads: "exactly-true", defaultFromFlags: true }
|
|
@@ -450,6 +474,7 @@ var init_launch = __esm(() => {
|
|
|
450
474
|
default: false,
|
|
451
475
|
kind: "launch",
|
|
452
476
|
description: "Wipe persisted storage and re-sync it from the config.",
|
|
477
|
+
notes: "Set to `true` (or pass `--init`) to **wipe persisted storage** (`publisher_data/`) and re-sync it from the config on boot. A first boot with empty storage loads the config automatically, so you only need this to reset state or pick up config changes. Also exposed as the `start:init` / `start:dev:init` scripts.",
|
|
453
478
|
aliases: {
|
|
454
479
|
env: ["INITIALIZE_STORAGE"],
|
|
455
480
|
flags: ["--init"],
|
|
@@ -462,6 +487,7 @@ var init_launch = __esm(() => {
|
|
|
462
487
|
default: [],
|
|
463
488
|
kind: "launch",
|
|
464
489
|
description: "Environments whose local packages are mounted in place for live reload; only the first auto-reloads.",
|
|
490
|
+
notes: "Dev only. Mount the named environment's local-dir packages in place (a symlink, not a copy) and watch them, so edits to your source recompile that package and live-reload any open pages. Repeat the flag or use a comma-separated list to mount several in place; only the first one auto-reloads. Leave unset in production, where packages are copied and stay decoupled from their source.",
|
|
465
491
|
aliases: {
|
|
466
492
|
env: ["PUBLISHER_WATCH"],
|
|
467
493
|
flags: ["--watch-env"],
|
|
@@ -481,6 +507,7 @@ var init_mcp = __esm(() => {
|
|
|
481
507
|
type: integer({ min: 0, max: 65535 }),
|
|
482
508
|
default: 4040,
|
|
483
509
|
description: "MCP HTTP port.",
|
|
510
|
+
notes: "MCP HTTP port. Serves the ten MCP tools (`list_packages`, `get_context`, `execute_query`, `compile_model`, `reload_package`, `get_status`, `search_malloy_docs`, `search_database_schema`, `get_skill`, `get_agent`) and the agent skills as MCP prompts. `list_packages` is listed first because it is where an agent starts: `get_context` requires an environment and package in its `scopes`, and those names come from there.",
|
|
484
511
|
aliases: {
|
|
485
512
|
env: ["MCP_PORT"],
|
|
486
513
|
flags: ["--mcp_port"]
|
|
@@ -490,7 +517,9 @@ var init_mcp = __esm(() => {
|
|
|
490
517
|
key: "mcp.host",
|
|
491
518
|
type: string(),
|
|
492
519
|
default: (resolving) => resolving.isSet("host") ? resolving.get("host") : "127.0.0.1",
|
|
493
|
-
description: "Host MCP binds to
|
|
520
|
+
description: "Host the MCP server binds to.",
|
|
521
|
+
notes: "Host binding for the MCP server. Takes precedence over `PUBLISHER_HOST`. Set `0.0.0.0` to expose MCP on the network, behind an authenticating gateway.",
|
|
522
|
+
defaultText: "{host} when given, else `127.0.0.1`",
|
|
494
523
|
aliases: { env: ["MCP_HOST"], flags: ["--mcp_host"] }
|
|
495
524
|
}),
|
|
496
525
|
setting({
|
|
@@ -498,13 +527,15 @@ var init_mcp = __esm(() => {
|
|
|
498
527
|
type: list(),
|
|
499
528
|
default: [],
|
|
500
529
|
description: "Origins that may read MCP responses cross-origin; * allows any, none denies.",
|
|
530
|
+
notes: "Comma-separated origins allowed to read a cross-origin response from the MCP endpoint; `*` allows any. Unset or empty sends no `Access-Control-Allow-Origin` at all.",
|
|
501
531
|
aliases: { env: ["MCP_CORS_ORIGINS"] }
|
|
502
532
|
}),
|
|
503
533
|
setting({
|
|
504
534
|
key: "mcp.configFileEnabled",
|
|
505
535
|
type: boolean(),
|
|
506
536
|
default: true,
|
|
507
|
-
description: "
|
|
537
|
+
description: "Do not write .mcp.json into the working directory. Without it the file is written, so an agent opened there finds this server, unless the directory already has one, is your home directory or the filesystem root, is inside a git working tree, or the MCP port bound is not the one requested.",
|
|
538
|
+
notes: "Stops the server writing a `.mcp.json` into its working directory on startup. Accepts `1`/`true`/`yes`/`on` to disable and `0`/`false`/`no`/`off`/empty to leave on; anything else, including a value an env file left quotes around, is a startup error rather than a disable. See [The `.mcp.json` the server writes](#the-mcpjson-the-server-writes).",
|
|
508
539
|
aliases: {
|
|
509
540
|
env: ["PUBLISHER_NO_MCP_CONFIG"],
|
|
510
541
|
flags: ["--no-mcp-config"],
|
|
@@ -525,6 +556,7 @@ var init_mcp = __esm(() => {
|
|
|
525
556
|
key: "mcp.trace",
|
|
526
557
|
type: oneOf(["retrieval"]),
|
|
527
558
|
description: "retrieval writes a trace summary of each ranked get_context call to the log.",
|
|
559
|
+
notes: "`retrieval` writes a one-line trace summary of each ranked `get_context` call to the server log, and adds nothing to any response. Any other value fails startup.",
|
|
528
560
|
aliases: { env: ["PUBLISHER_MCP_TRACE"] }
|
|
529
561
|
})
|
|
530
562
|
];
|
|
@@ -541,6 +573,7 @@ var init_query = __esm(() => {
|
|
|
541
573
|
type: integer({ min: 0 }),
|
|
542
574
|
default: DEFAULT_MAX_QUERY_ROWS,
|
|
543
575
|
description: "Row cap on ad-hoc connection SQL; 0 leaves only the byte cap.",
|
|
576
|
+
notes: "Maximum rows returned per query on every query surface (`/connections/.../sqlQuery`, model query, notebook cell, MCP `executeQuery`). Forwarded to the connector / Malloy `runnable.run` as the effective row limit; queries that exceed the cap fail with HTTP 413. Set to `0` to disable. A caller-supplied `rowLimit` smaller than the cap is preserved.",
|
|
544
577
|
aliases: { env: ["PUBLISHER_MAX_QUERY_ROWS"] }
|
|
545
578
|
}),
|
|
546
579
|
setting({
|
|
@@ -548,6 +581,8 @@ var init_query = __esm(() => {
|
|
|
548
581
|
type: integer({ min: 0 }),
|
|
549
582
|
default: DEFAULT_MAX_RESPONSE_BYTES,
|
|
550
583
|
description: "Byte cap on ad-hoc connection SQL responses; 0 leaves only the row cap.",
|
|
584
|
+
notes: "Maximum JSON-serialized response size, for ad-hoc SQL, model queries and notebook cells. Streaming-capable connections (Postgres, DuckDB) enforce mid-stream and abort the driver immediately; non-streaming connections enforce post-buffer. Exceeding the cap fails with HTTP 413. Set to `0` to disable. See the note below the table.",
|
|
585
|
+
defaultText: "`50000000` (50 MB)",
|
|
551
586
|
aliases: { env: ["PUBLISHER_MAX_RESPONSE_BYTES"] }
|
|
552
587
|
}),
|
|
553
588
|
setting({
|
|
@@ -555,6 +590,7 @@ var init_query = __esm(() => {
|
|
|
555
590
|
type: integer({ min: 1 }),
|
|
556
591
|
default: DEFAULT_QUERY_ROW_LIMIT,
|
|
557
592
|
description: "Row limit of a model query that sets none of its own.",
|
|
593
|
+
notes: "Default `LIMIT` applied to model queries that don't include their own. Always ≤ `PUBLISHER_MAX_QUERY_ROWS`. `0` is rejected.",
|
|
558
594
|
aliases: { env: ["PUBLISHER_DEFAULT_QUERY_ROW_LIMIT"] }
|
|
559
595
|
}),
|
|
560
596
|
setting({
|
|
@@ -562,6 +598,8 @@ var init_query = __esm(() => {
|
|
|
562
598
|
type: integer({ min: 0 }),
|
|
563
599
|
default: DEFAULT_QUERY_TIMEOUT_MS,
|
|
564
600
|
description: "Per-query wall-clock timeout in ms; 0 turns it off.",
|
|
601
|
+
notes: "Wall-clock timeout per query (all surfaces). Wired to the underlying SDK via `AbortSignal`; queries that exceed the budget are aborted and return HTTP 504. Set to `0` to disable.",
|
|
602
|
+
defaultText: "`300000` (5 min)",
|
|
565
603
|
aliases: { env: ["PUBLISHER_QUERY_TIMEOUT_MS"] }
|
|
566
604
|
}),
|
|
567
605
|
setting({
|
|
@@ -569,6 +607,7 @@ var init_query = __esm(() => {
|
|
|
569
607
|
type: integer({ min: 0 }),
|
|
570
608
|
default: DEFAULT_MAX_CONCURRENT_QUERIES,
|
|
571
609
|
description: "Queries this process runs at once; 0 turns the cap off.",
|
|
610
|
+
notes: "Per-pod cap on simultaneous in-flight work (HTTP + MCP share the same slot pool). Covers queries and the two authoring surfaces that also reach the database: `compile`, which resolves source schemas against the connection, and `sqlSource`, which runs a live introspection. When the cap is reached, new requests fail fast with HTTP 503 (or the MCP-error equivalent). Size it for authoring traffic as well as query traffic; set to `0` to disable.",
|
|
572
611
|
aliases: { env: ["PUBLISHER_MAX_CONCURRENT_QUERIES"] }
|
|
573
612
|
}),
|
|
574
613
|
setting({
|
|
@@ -576,6 +615,7 @@ var init_query = __esm(() => {
|
|
|
576
615
|
type: boolean(),
|
|
577
616
|
default: false,
|
|
578
617
|
description: "Attach per-query metadata to every statement.",
|
|
618
|
+
notes: "`on` attaches per-query metadata to every statement, as a leading SQL comment where the connection has no native tag; `off` attaches none. Only `on` and `off` are read. See [query-metadata.md](query-metadata.md).",
|
|
579
619
|
aliases: {
|
|
580
620
|
env: ["PUBLISHER_QUERY_METADATA"],
|
|
581
621
|
today: { reads: "on-off" }
|
|
@@ -586,6 +626,7 @@ var init_query = __esm(() => {
|
|
|
586
626
|
type: integer({ min: 1 }),
|
|
587
627
|
default: DEFAULT_POSTGRES_POOL_MAX,
|
|
588
628
|
description: "Open sessions per plain Postgres connection.",
|
|
629
|
+
notes: "Per-process cap on open database sessions for each Postgres connection, including one reached through an SSH proxy. Each query uses its own session and closes it; when all are busy a query waits up to 30 s for one, then fails with HTTP 502. Across a fleet the ceiling is roughly this value times the pods serving the environment, so size it against the role's `CONNECTION LIMIT`. Must be a positive integer.",
|
|
589
630
|
aliases: { env: ["PUBLISHER_POSTGRES_POOL_MAX"] }
|
|
590
631
|
}),
|
|
591
632
|
setting({
|
|
@@ -593,20 +634,24 @@ var init_query = __esm(() => {
|
|
|
593
634
|
type: integer({ min: 0 }),
|
|
594
635
|
default: 0,
|
|
595
636
|
description: "Process RSS ceiling for the memory governor, in bytes; 0 turns the governor off.",
|
|
637
|
+
notes: "Enables the RSS-based memory governor. When set, the governor samples process RSS every `PUBLISHER_MEMORY_CHECK_INTERVAL_MS` ms and rejects new package loads and queries with HTTP 503 once RSS crosses `PUBLISHER_MEMORY_HIGH_WATER_FRACTION × PUBLISHER_MAX_MEMORY_BYTES`, until it drops below `PUBLISHER_MEMORY_LOW_WATER_FRACTION ×`. Unset or `0` disables.",
|
|
638
|
+
defaultText: "`0` (the governor is off)",
|
|
596
639
|
aliases: { env: ["PUBLISHER_MAX_MEMORY_BYTES"] }
|
|
597
640
|
}),
|
|
598
641
|
setting({
|
|
599
642
|
key: "memory.highWaterFraction",
|
|
600
643
|
type: number({ above: 0, below: 1 }),
|
|
601
644
|
default: 0.8,
|
|
602
|
-
description: "Share of memory.maxBytes at which new package loads are refused.",
|
|
645
|
+
description: "Share of {memory.maxBytes} at which new package loads are refused.",
|
|
646
|
+
notes: "High-water mark (fraction of `PUBLISHER_MAX_MEMORY_BYTES`). Must be in `(0, 1)` and strictly above the low-water mark.",
|
|
603
647
|
aliases: { env: ["PUBLISHER_MEMORY_HIGH_WATER_FRACTION"] }
|
|
604
648
|
}),
|
|
605
649
|
setting({
|
|
606
650
|
key: "memory.lowWaterFraction",
|
|
607
651
|
type: number({ above: 0, below: 1 }),
|
|
608
652
|
default: 0.7,
|
|
609
|
-
description: "Share of memory.maxBytes at which loads are admitted again; below the high-water mark.",
|
|
653
|
+
description: "Share of {memory.maxBytes} at which loads are admitted again; below the high-water mark.",
|
|
654
|
+
notes: "Low-water mark (fraction of `PUBLISHER_MAX_MEMORY_BYTES`). Hysteresis: back-pressure clears when RSS dips below this value.",
|
|
610
655
|
aliases: { env: ["PUBLISHER_MEMORY_LOW_WATER_FRACTION"] }
|
|
611
656
|
}),
|
|
612
657
|
setting({
|
|
@@ -614,6 +659,7 @@ var init_query = __esm(() => {
|
|
|
614
659
|
type: integer({ min: 100 }),
|
|
615
660
|
default: 5000,
|
|
616
661
|
description: "How often the memory governor samples RSS, in ms.",
|
|
662
|
+
notes: "RSS sampling interval (ms). Minimum 100.",
|
|
617
663
|
aliases: { env: ["PUBLISHER_MEMORY_CHECK_INTERVAL_MS"] }
|
|
618
664
|
}),
|
|
619
665
|
setting({
|
|
@@ -621,6 +667,7 @@ var init_query = __esm(() => {
|
|
|
621
667
|
type: boolean(),
|
|
622
668
|
default: true,
|
|
623
669
|
description: "Refuse loads above the high-water mark; off only samples and reports.",
|
|
670
|
+
notes: "Set to `false` to disable the 503 behavior while keeping RSS monitoring — useful for a metrics-only rollout before enabling enforcement.",
|
|
624
671
|
aliases: { env: ["PUBLISHER_MEMORY_BACKPRESSURE"] }
|
|
625
672
|
}),
|
|
626
673
|
setting({
|
|
@@ -628,6 +675,7 @@ var init_query = __esm(() => {
|
|
|
628
675
|
type: integer({ min: 1 }),
|
|
629
676
|
default: 1,
|
|
630
677
|
description: "Package-load worker threads.",
|
|
678
|
+
notes: "Worker processes for package compilation. Must be ≥ 1.",
|
|
631
679
|
aliases: { env: ["PACKAGE_LOAD_WORKERS"] }
|
|
632
680
|
}),
|
|
633
681
|
setting({
|
|
@@ -635,6 +683,8 @@ var init_query = __esm(() => {
|
|
|
635
683
|
type: integer({ min: 1 }),
|
|
636
684
|
default: 120000,
|
|
637
685
|
description: "Compile budget of one package load, in ms.",
|
|
686
|
+
notes: "Bounds a package-load job's compile. A job may run to twice it before its worker is recycled, because the work it does for the main thread (render-tag results, pre-aggregation companions and the build plan) comes on top. The worker starts none of that work after three quarters of the timeout, and leaves what remains to the main thread.",
|
|
687
|
+
defaultText: "`120000` (2 min)",
|
|
638
688
|
aliases: { env: ["PACKAGE_LOAD_JOB_TIMEOUT_MS"] }
|
|
639
689
|
}),
|
|
640
690
|
setting({
|
|
@@ -642,6 +692,8 @@ var init_query = __esm(() => {
|
|
|
642
692
|
type: integer({ min: 0 }),
|
|
643
693
|
default: DEFAULT_PACKAGE_LOAD_SCHEMA_CACHE_BYTES,
|
|
644
694
|
description: "Serialized schema each package-load worker caches across loads, in bytes; 0 turns it off.",
|
|
695
|
+
notes: "Serialized size of the table and SQL schemas each package-load worker keeps across loads, so a model's repeated and later requests for the same table skip the round trip to the main thread. Least recently used entries go first. Scoped per environment and per connection instance, so editing a connection drops its entries; a request that asks to refresh a schema is fetched again, and the result replaces the entry. Heap use is a few times the serialized size. `0` disables it; empty takes the default, and a value that is not a byte count stops the server from starting.",
|
|
696
|
+
defaultText: "`16777216` (16 MiB)",
|
|
645
697
|
aliases: { env: ["PACKAGE_LOAD_SCHEMA_CACHE_BYTES"] }
|
|
646
698
|
})
|
|
647
699
|
];
|
|
@@ -665,12 +717,15 @@ var init_retrieval = __esm(() => {
|
|
|
665
717
|
type: string(),
|
|
666
718
|
secret: true,
|
|
667
719
|
description: "Key of the embedding provider; unset turns semantic search off, except for providers that need none.",
|
|
720
|
+
notes: 'Turns on embedding closeness in `get_context`\'s search, and embedding ranking in `search_database_schema` (see below). Sent as a bearer token to the embedding endpoint. Unset: `get_context` ranks by keyword and stored values only. Must be set explicitly; an ambient `OPENAI_API_KEY` is deliberately not read. See "How get_context searches" below.',
|
|
668
721
|
aliases: { env: ["EMBEDDING_API_KEY"] }
|
|
669
722
|
}),
|
|
670
723
|
setting({
|
|
671
724
|
key: "retrieval.embedding.model",
|
|
672
725
|
type: string(),
|
|
673
726
|
description: "Embedding model; text-embedding-3-small for OpenAI.",
|
|
727
|
+
notes: "Embedding model name sent to the endpoint. A `retrieval.embedding.model` in `publisher.config.json` wins over it.",
|
|
728
|
+
defaultText: "`text-embedding-3-small` for OpenAI",
|
|
674
729
|
aliases: {
|
|
675
730
|
env: ["EMBEDDING_MODEL"],
|
|
676
731
|
file: ["retrieval.embedding.model"],
|
|
@@ -681,6 +736,8 @@ var init_retrieval = __esm(() => {
|
|
|
681
736
|
key: "retrieval.embedding.baseUrl",
|
|
682
737
|
type: string(),
|
|
683
738
|
description: "Base URL of the embedding API; default the provider's, else https://api.openai.com/v1.",
|
|
739
|
+
notes: "Base URL of an OpenAI-compatible embeddings API (`POST <base>/embeddings`). Point at any compatible endpoint (e.g. a local Ollama or vLLM server). A `retrieval.embedding.baseUrl` in `publisher.config.json` wins over it.",
|
|
740
|
+
defaultText: "the provider's, else `https://api.openai.com/v1`",
|
|
684
741
|
aliases: {
|
|
685
742
|
env: ["EMBEDDING_API_BASE"],
|
|
686
743
|
file: ["retrieval.embedding.baseUrl"],
|
|
@@ -691,6 +748,7 @@ var init_retrieval = __esm(() => {
|
|
|
691
748
|
key: "retrieval.embedding.dimensions",
|
|
692
749
|
type: integer({ min: 1 }),
|
|
693
750
|
description: "dimensions request parameter; unset takes the provider's vector length.",
|
|
751
|
+
notes: "Optional `dimensions` request parameter (e.g. `512` to shrink `text-embedding-3-small` vectors). When unset the parameter is omitted, which suits providers that do not support it. A `retrieval.embedding.dimensions` in `publisher.config.json` wins over it.",
|
|
694
752
|
aliases: {
|
|
695
753
|
env: ["EMBEDDING_DIMENSIONS"],
|
|
696
754
|
file: ["retrieval.embedding.dimensions"],
|
|
@@ -701,7 +759,8 @@ var init_retrieval = __esm(() => {
|
|
|
701
759
|
key: "retrieval.embedding.minSimilarity",
|
|
702
760
|
type: number({ min: 0, below: 1 }),
|
|
703
761
|
default: DEFAULT_EMBEDDING_MIN_SIMILARITY,
|
|
704
|
-
description: "Cosine-similarity floor a
|
|
762
|
+
description: "Cosine-similarity floor a table must clear to be returned by search_database_schema.",
|
|
763
|
+
notes: "Cosine-similarity floor a table must clear to be returned by `search_database_schema`. `get_context` has no floor. Tunable because cosine similarity is not calibrated across embedding models, so the right floor belongs to the endpoint you point at, not to Publisher. Must be in `[0, 1)`; `0` disables the floor, and an out-of-range or non-numeric value is a startup error rather than a silent clamp.",
|
|
705
764
|
aliases: { env: ["EMBEDDING_MIN_SIMILARITY"] }
|
|
706
765
|
}),
|
|
707
766
|
setting({
|
|
@@ -709,6 +768,7 @@ var init_retrieval = __esm(() => {
|
|
|
709
768
|
type: boolean(),
|
|
710
769
|
default: false,
|
|
711
770
|
description: "Let search_database_schema send a connection's table and column names to the embedding provider.",
|
|
771
|
+
notes: "Allows `search_database_schema` to send a connection's schema name, table names, column names and column types, plus the agent's search text, to the embedding endpoint for semantic ranking. Never row values. A second switch on top of `EMBEDDING_API_KEY`, which alone covers only your own model text; unset, schema search still works and ranks lexically. Accepts `1`/`true`/`yes`/`on` and `0`/`false`/`no`/`off`. It is read when the tool is called, not at startup, so an unrecognised value does not stop the server: the tool logs a warning and ranks lexically for that call. See \"Semantic ranking for search_database_schema\" below.",
|
|
712
772
|
aliases: { env: ["EMBEDDING_INDEX_CONNECTION_SCHEMA"] }
|
|
713
773
|
}),
|
|
714
774
|
setting({
|
|
@@ -716,6 +776,7 @@ var init_retrieval = __esm(() => {
|
|
|
716
776
|
type: string(),
|
|
717
777
|
secret: true,
|
|
718
778
|
description: "Key of the retrieval LLM; unset turns every LLM feature off, except for providers that need none.",
|
|
779
|
+
notes: 'API key for the chat model named by `retrieval.llm` in `publisher.config.json` (OpenAI, an OpenAI-compatible server, Anthropic or Google; not needed for `ollama` or `vertex`). Used for index-time keyphrases and source summaries. Unset with a keyed provider: every LLM feature is off and nothing errors. Never read from a file, never logged. See "Providers and the retrieval settings" below.',
|
|
719
780
|
aliases: { env: ["LLM_API_KEY"] }
|
|
720
781
|
})
|
|
721
782
|
];
|
|
@@ -739,6 +800,7 @@ var init_server = __esm(() => {
|
|
|
739
800
|
type: boolean(),
|
|
740
801
|
default: true,
|
|
741
802
|
description: "Run the main API and MCP, and the environments they serve; off runs only the admin API.",
|
|
803
|
+
notes: "The top-level `servingApiEnabled` setting ([below](#server-settings-top-level-of-publisherconfigjson)); overrides the config file.",
|
|
742
804
|
aliases: {
|
|
743
805
|
env: ["PUBLISHER_SERVING_API_ENABLED"],
|
|
744
806
|
flags: ["--serving-api-enabled", "--no-serving-api-enabled"],
|
|
@@ -751,6 +813,7 @@ var init_server = __esm(() => {
|
|
|
751
813
|
type: boolean(),
|
|
752
814
|
default: true,
|
|
753
815
|
description: "Allow the admin API; off refuses an admin setting.",
|
|
816
|
+
notes: "The top-level `adminApiEnabled` setting ([below](#server-settings-top-level-of-publisherconfigjson)); overrides the config file.",
|
|
754
817
|
aliases: {
|
|
755
818
|
env: ["PUBLISHER_ADMIN_API_ENABLED"],
|
|
756
819
|
flags: ["--admin-api-enabled", "--no-admin-api-enabled"],
|
|
@@ -763,6 +826,7 @@ var init_server = __esm(() => {
|
|
|
763
826
|
type: integer({ min: 0, max: 65535 }),
|
|
764
827
|
default: 4000,
|
|
765
828
|
description: "Port of the REST API and the web app.",
|
|
829
|
+
notes: "REST + static-app HTTP port.",
|
|
766
830
|
aliases: {
|
|
767
831
|
env: ["PUBLISHER_PORT"],
|
|
768
832
|
flags: ["--port"]
|
|
@@ -772,7 +836,8 @@ var init_server = __esm(() => {
|
|
|
772
836
|
key: "host",
|
|
773
837
|
type: string(),
|
|
774
838
|
default: "0.0.0.0",
|
|
775
|
-
description: "Host the REST API binds to, and MCP too unless mcp.host is given.",
|
|
839
|
+
description: "Host the REST API binds to, and MCP too unless {mcp.host} is given.",
|
|
840
|
+
notes: "Host binding for the REST server, and the fallback for the MCP server. Set `127.0.0.1` to keep both loopback-only.",
|
|
776
841
|
aliases: { env: ["PUBLISHER_HOST"], flags: ["--host"] }
|
|
777
842
|
}),
|
|
778
843
|
setting({
|
|
@@ -780,6 +845,8 @@ var init_server = __esm(() => {
|
|
|
780
845
|
type: integer({ min: 0 }),
|
|
781
846
|
default: 0,
|
|
782
847
|
description: "Requests per minute per client; 0 is unlimited.",
|
|
848
|
+
notes: "Maximum requests per minute one client may make to the REST server; over it, requests get `429` with `RateLimit-*` headers until the minute rolls over. Unset or `0` means no limit; any other value must be a non-negative integer or startup fails. `/health*` and `/metrics` are never limited. Clients are told apart by the connection's peer address, so behind a reverse proxy every client shares one bucket: rate-limit at the proxy there, or leave this unset. The MCP port is not covered.",
|
|
849
|
+
defaultText: "`0` (no limit)",
|
|
783
850
|
aliases: { env: ["PUBLISHER_RATE_LIMIT"] }
|
|
784
851
|
}),
|
|
785
852
|
setting({
|
|
@@ -787,6 +854,7 @@ var init_server = __esm(() => {
|
|
|
787
854
|
type: string(),
|
|
788
855
|
default: "'self'",
|
|
789
856
|
description: "The Content-Security-Policy frame-ancestors source list: who may embed the app.",
|
|
857
|
+
notes: "`Content-Security-Policy: frame-ancestors` value sent on **every** document this server returns -- the Console and in-package `public/` files alike -- controlling which origins may embed a page in an iframe. Defaults to same-origin only; set it to the origins that embed you (`https://app.example.com`), or to `*` to restore the previous any-origin behaviour.",
|
|
790
858
|
aliases: { env: ["PUBLISHER_FRAME_ANCESTORS"] }
|
|
791
859
|
}),
|
|
792
860
|
setting({
|
|
@@ -794,6 +862,7 @@ var init_server = __esm(() => {
|
|
|
794
862
|
type: string(),
|
|
795
863
|
default: DEFAULT_CALLER_HEADER,
|
|
796
864
|
description: "Request header the access record copies as the caller: the identity the gateway in front of Publisher asserts.",
|
|
865
|
+
notes: "The request header whose value the per-query access record copies as `caller`: the identity the gateway in front of Publisher asserts. Opaque to Publisher; see [access-record.md](access-record.md).",
|
|
797
866
|
aliases: { env: ["PUBLISHER_CALLER_HEADER"] }
|
|
798
867
|
}),
|
|
799
868
|
setting({
|
|
@@ -801,6 +870,7 @@ var init_server = __esm(() => {
|
|
|
801
870
|
type: oneOf(["off", "on"]),
|
|
802
871
|
default: "off",
|
|
803
872
|
description: "on publishes a package from a location as the version its publisher.json declares; off installs it in place. A transition setting #1381 removes.",
|
|
873
|
+
notes: "`on` or `off`: whether a publish from a location publishes an immutable [package version](package-versions.md) numbered by its `publisher.json` `version` (a missing or non-semver `version` is then a 400), or installs the package in place as before versions. A transition setting: a future release removes it and requires a `version` ([#1381](https://github.com/malloydata/publisher/issues/1381)). Versions published while it was on keep serving when it is off. Any other value fails startup.",
|
|
804
874
|
aliases: { env: ["PUBLISHER_PACKAGE_VERSIONING"] }
|
|
805
875
|
}),
|
|
806
876
|
setting({
|
|
@@ -808,6 +878,7 @@ var init_server = __esm(() => {
|
|
|
808
878
|
type: oneOf(["on-publish", "explicit"]),
|
|
809
879
|
default: "on-publish",
|
|
810
880
|
description: "on-publish moves a package's latest to a newly published higher version; explicit leaves it to PUT …/latest.",
|
|
881
|
+
notes: "`on-publish` or `explicit`: what publishing a package version does to its `latest`. `on-publish` moves `latest` to the new version unless a higher one already is; `explicit` never moves it, so only `PUT .../packages/{package}/latest` does, for an orchestrator that decides when a version is ready. Also settable as `versionPromotion` in `publisher.config.json`; the variable wins. Any other value fails startup. See [package-versions.md](package-versions.md).",
|
|
811
882
|
aliases: {
|
|
812
883
|
env: ["PUBLISHER_VERSION_PROMOTION"],
|
|
813
884
|
file: ["versionPromotion"]
|
|
@@ -818,6 +889,7 @@ var init_server = __esm(() => {
|
|
|
818
889
|
type: oneOf(["off", "on"]),
|
|
819
890
|
default: "on",
|
|
820
891
|
description: "on keeps the fields that moved off Package (buildPlan, agents, secureGivens, embeddingIndex, the manifest-binding and serving fields) inline in a package response, marked deprecated; off leaves each where it now lives. A transition setting a later release turns off, then removes.",
|
|
892
|
+
notes: "`on` or `off`: whether a package response carries the deprecated fields `api-doc.yaml` marks on `Package`, and a `GET /status` entry the whole package response. Off, each is read only at its own route: the serving and manifest-binding fields (`status`, `loaded`, `archiveStatus`, `servedRevision`, `sourceContentSha`, `manifestBindingStatus`, `manifestEntryCount`, `boundManifestUri`, `storageServeBindings`) at `GET …/packages/{pkg}/status`, `buildPlan` at `…/build-plan`, `embeddingIndex` at `…/embedding-index`, `classification` at `…/classification`, `agents` at `…/agents`, and `secureGivens` as each model's `givens[].secure` at `…/entities`. `warnings` and `exploresWarnings` stay on the package either way. A transition flag: a later release turns it off by default and the one after removes it with the fields, so move readers to the new locations now. Any other value fails startup.",
|
|
821
893
|
aliases: { env: ["PUBLISHER_PACKAGE_INLINE_FIELDS"] }
|
|
822
894
|
}),
|
|
823
895
|
setting({
|
|
@@ -825,6 +897,7 @@ var init_server = __esm(() => {
|
|
|
825
897
|
type: oneOf(["explorer", "viewer"]),
|
|
826
898
|
default: "explorer",
|
|
827
899
|
description: "The page the Console shows for a model, reported on /status as modelPage: explorer, or viewer, which builds no query and takes the Explorer out of the legacy notebook too.",
|
|
900
|
+
notes: "`explorer` or `viewer`: the page the Console shows for a model, reported on `/status` as `modelPage`. `explorer` is the [Explorer](explorer.md), which writes the queries it builds back to Malloy with string values unescaped (`escapeString` in `@malloydata/malloy-interfaces` is a TODO), so a drilled value holding a double quote rewrites its query; the server's restricted mode and `#(authorize)` still bound what that query can read. `viewer` shows the model viewer, which builds no query, and also takes the Explorer's \"Data sources\" dialog out of the legacy notebook; there a given's option list also quotes every name. The Console keeps both pages, and shows the viewer if `/status` cannot be read. Any other value fails startup.",
|
|
828
901
|
aliases: { env: ["PUBLISHER_MODEL_PAGE"] }
|
|
829
902
|
}),
|
|
830
903
|
setting({
|
|
@@ -854,18 +927,21 @@ var init_storage = __esm(() => {
|
|
|
854
927
|
type: oneOf(["on-demand", "local-only"]),
|
|
855
928
|
default: "on-demand",
|
|
856
929
|
description: "on-demand installs a missing DuckDB extension on first use; local-only never reaches the network.",
|
|
930
|
+
notes: "Whether the server may fetch DuckDB extensions from the network at runtime. `on-demand`: a missing extension is installed on first use (unchanged prior behavior). `local-only`: never install, and disable DuckDB's implicit auto-install — a locally-present (e.g. image-baked) extension still loads, but a missing one fails with an actionable error naming the extension. Use `local-only` for air-gapped / pinned-image deployments. See [ducklake.md](ducklake.md#duckdb-extension-provisioning).",
|
|
857
931
|
aliases: { env: ["EXTENSION_FETCH_POLICY"] }
|
|
858
932
|
}),
|
|
859
933
|
setting({
|
|
860
934
|
key: "duckdb.memoryLimit",
|
|
861
935
|
type: string(),
|
|
862
936
|
description: "memory_limit of every DuckDB session, as a DuckDB size (1GB), or off; unset warns at boot.",
|
|
937
|
+
notes: "DuckDB `memory_limit` applied to **every** DuckDB session and instance Publisher owns, as a flat value (`1GB`, `512MB`) passed to DuckDB verbatim. `off` or unset leaves DuckDB's own default, which is roughly 80% of the container's memory computed **per instance** — so N instances in one process commit N times that share, and the kernel kills the process while each of them still believes it is inside its budget. Measured in a 3 GiB container: three instances each reported a 2.3 GiB limit, 6.9 GiB of committed budget against 3 GiB of real memory. **Sizing:** the divisor is not a number of builds. Count 1 metadata store + 1 serve-shape gate session + 1 environment lookup funnel + one sandbox per loaded package × `PACKAGE_LOAD_WORKERS` (package loads run in `worker_threads`, so same address space and same cgroup) + one per in-flight materialization build, and nothing bounds concurrent builds. Budget roughly (container memory − resident baseline) ÷ that count. DuckDB does not reserve the limit up front, so an idle instance costs far less than its budget — the limit caps what it may reach, and it is the sum of the caps that has to fit. Too low fails a query with a DuckDB out-of-memory error and leaves the process up, which is the intended trade against losing the pod and every package on it. Validated at startup.",
|
|
863
938
|
aliases: { env: ["PUBLISHER_DUCKDB_MEMORY_LIMIT"] }
|
|
864
939
|
}),
|
|
865
940
|
setting({
|
|
866
941
|
key: "duckdb.tempDirectory",
|
|
867
942
|
type: string(),
|
|
868
943
|
description: "Directory DuckDB spills to.",
|
|
944
|
+
notes: "Where DuckDB spills. A materialization build overrides this with its own disposable working directory (unique per build, removed with the build); every other session and instance uses this. Unset leaves DuckDB's default of `.tmp` relative to the process working directory, whose default `max_temp_directory_size` is 90% of whatever filesystem that lands on — on a container with no ephemeral-storage limit, the node's shared disk. Created at startup if missing, since `SET temp_directory` accepts a path that does not exist and only fails at the first spill. Unlike the memory limit there is no `off` sentinel, because a directory named `off` is a legal path. Note that setting `PUBLISHER_DUCKDB_MEMORY_LIMIT` creates spill on the `storage=` build path in one case: a `partition=` build sorts the whole passthrough result by its partition columns in DuckDB before writing it (see `PUBLISHER_PARTITIONED_WRITE_FLUSH_THRESHOLD`), and that sort runs out of core against the build's own working directory, so the entire result can land on local disk. Every other `storage=` build pushes its SQL to the source warehouse and streams the result into the destination with nothing to spill. Local compute, and so spill, is otherwise the chained-build and serve paths.",
|
|
869
945
|
aliases: { env: ["PUBLISHER_DUCKDB_TEMP_DIRECTORY"] }
|
|
870
946
|
}),
|
|
871
947
|
setting({
|
|
@@ -873,18 +949,21 @@ var init_storage = __esm(() => {
|
|
|
873
949
|
type: string(),
|
|
874
950
|
default: "8192",
|
|
875
951
|
description: "Rows a partitioned storage build buffers before flushing, or off.",
|
|
952
|
+
notes: "Rows the appender buffers before a `#@ persist partition=` build flushes them to the partition files, set on the build session as DuckDB's `partitioned_write_flush_threshold`. `off` turns the whole treatment off — this threshold, the ordered insert and the single appender thread together — and leaves DuckDB's own behaviour (a 524,288-row threshold, an unordered parallel insert); it is the escape hatch for a source that built fine before, at the cost of the sort. A partitioned build is DuckDB's partitioned COPY, and that operator buffers rows per partition in a column-data collection **inside** the buffer manager — so unlike the two DuckLake bounds above, `PUBLISHER_DUCKDB_MEMORY_LIMIT` does see this term, and the failure reads `Out of Memory Error: failed to pin block` against the session's limit rather than a container kill. Two things drive it: every partition the appender meets costs it one vector per column up front, before a row of it is flushed, and nothing is flushed until it has appended this many rows across all its partitions. On a passthrough-sourced build (Postgres, BigQuery, Snowflake; a chained build is untouched) the publisher bounds the first by ordering the insert's SELECT by the partition columns at the top of the INSERT statement — the SELECT the build was handed is unchanged, so what the warehouse runs, its query tag or label, and how the source is addressed are untouched — and by running that insert on one thread, since a DuckDB-side sort is read in parallel and several appenders each meet every partition again; this variable bounds the second. Sorted by DuckDB rather than by the warehouse because a multi-stream read (BigQuery) re-interleaves a sorted result on the way in. Measured at a `768MB` limit on 122 columns, 616k rows, 308 partitions: from Postgres, interleaved rows fail in under 3 s at any threshold, ordered rows fail at DuckDB's default after ~0.5M rows, ordered rows on one thread complete at `8192` in 9.5 s (4 threads fail at 7 s); from BigQuery, interleaved fails at 54 s and ordered on one thread completes in 36 s (4 threads fail at 39 s). Snowflake is not measured; the write side is the same. The treatment has a running cost: the sort reads the whole result before the first partition file is written, spills it to the build's working directory when it exceeds the memory limit, and writes on one thread — so a wide, many-partition build trades memory for local disk and wall-clock, and no production-scale build has been measured yet. The disk is the one to watch: the working directory is created under the process temp directory, which in a container with no volume there is the node's overlay filesystem, and a spill of tens of GB there is an ephemeral-storage eviction — a killed pod, not a publisher error. Give the worker a volume for its temp directory, or an ephemeral-storage limit that makes the failure a caught one, before relying on this at that scale. The single thread costs little on a single-stream read (`postgres_query`, `snowflake_query`, `bigquery_query`) and real scan parallelism on the labelled BigQuery split, whose result table is read multi-stream. An incremental delta into a laid-out table runs on the same session and gets the threshold and the single thread; its read is not ordered. Smaller is not free: a flush touches every partition the appender holds, so a very high-cardinality layout (thousands of partitions) does more file work at a low value — that is the many-small-files layout `docs/materialization.md` already warns off. Validated at startup.",
|
|
876
953
|
aliases: { env: ["PUBLISHER_PARTITIONED_WRITE_FLUSH_THRESHOLD"] }
|
|
877
954
|
}),
|
|
878
955
|
setting({
|
|
879
956
|
key: "ducklake.rowGroupSizeBytes",
|
|
880
957
|
type: string(),
|
|
881
958
|
description: "Bytes DuckLake buffers per column before flushing a Parquet row group (16MB).",
|
|
959
|
+
notes: "Bytes DuckLake buffers per Parquet row group before flushing, applied as a **catalog** option on each writable lake at attach. Unset issues nothing and leaves DuckLake's default of 122,880 ROWS. A DuckLake write buffers a whole row group per COLUMN, so its memory is driven by the table's width rather than its row count, and `PUBLISHER_DUCKDB_MEMORY_LIMIT` does not bound it — those buffers sit outside the buffer manager, so a low limit and a large row group OOM together. Measured on a 72-column, 5M-row write, sampling cgroup `memory.stat` anon: 2772 MiB at the default, 1530 MiB at `64MB`, 1006 MiB at `16MB`. Bytes rather than a row count because one row count cannot suit a 9-column and a 110-column table at once; the byte form derives rows-per-group from the data actually buffered, so it tracks width with nobody estimating it. Smaller is not free: more row groups cost Parquet metadata and read-side pruning quality, and the read cost has not been measured here. Requires `preserve_insertion_order=false`, which Publisher sets on the attaching session — DuckLake plans its copy parallel unconditionally and does not honour insertion order regardless (measured: 15 adjacent inversions per 1.5M rows with it on, 10 with it off), so the guarantee being waived is not one that was being provided. Written to `ducklake_metadata`, so it outlives the connection and is seen by every writer of that lake; skipped on a read-only attach. A catalog that refuses the option is logged and attaches anyway. Validated at startup.",
|
|
882
960
|
aliases: { env: ["PUBLISHER_DUCKLAKE_ROW_GROUP_SIZE_BYTES"] }
|
|
883
961
|
}),
|
|
884
962
|
setting({
|
|
885
963
|
key: "ducklake.targetFileSizeBytes",
|
|
886
964
|
type: string(),
|
|
887
965
|
description: "Size a DuckLake Parquet file grows to before rotating (256MB).",
|
|
966
|
+
notes: "Bytes DuckLake writes into one Parquet file before rotating to the next, applied as a **catalog** option on each writable lake at attach. Unset issues nothing and leaves DuckLake's own default of roughly 512MB. A separate term from `PUBLISHER_DUCKLAKE_ROW_GROUP_SIZE_BYTES`, not a replacement: that bounds the per-column buffer _within_ a file, this bounds how much of the file stays resident. Writing to object storage, DuckDB copies each multipart part into a buffer it allocates itself and holds it until the file completes, so a file's bytes are resident however they are grouped inside it — and `PUBLISHER_DUCKDB_MEMORY_LIMIT` bounds neither, since both sit outside the buffer manager. The same write to a local path streams and shows none of this, so the cost is invisible to testing that does not target a cloud destination. Measured on a 72-column, 20M-row DuckLake write to GCS, all cells in one batch: 650 MiB at DuckLake's default, 550 MiB at `512MB`, 373 MiB at `256MB`, 262 MiB at `128MB`, 255 MiB at `64MB`. **Pick the largest value that clears your memory ceiling, not the smallest** — memory is the only axis where smaller wins and it stops improving below ~`128MB`, while write throughput, full-scan time and catalog size all get worse (a full scan measured 13.0s at `512MB` against 21.6s at `64MB`; the catalog holds one row per file per column, in a database every writer of that lake shares). Where sources carry a required equality filter, scan time is the least binding of the three: a selective lookup ran in 17–63 ms at every size tested. Unlike the row-group bound it does **not** require `preserve_insertion_order=false`, and the order the two are applied in does not matter. Written to `ducklake_metadata`, so it outlives the connection and is seen by every writer of that lake; skipped on a read-only attach. **Unsetting this variable does not revert it** — the last value written stays in the catalog; to change it back, run `CALL <lake>.set_option('target_file_size', '<value>')` against the catalog. A catalog that refuses the option is logged and attaches anyway. Validated at startup.",
|
|
888
967
|
aliases: { env: ["PUBLISHER_DUCKLAKE_TARGET_FILE_SIZE_BYTES"] }
|
|
889
968
|
}),
|
|
890
969
|
setting({
|
|
@@ -892,6 +971,7 @@ var init_storage = __esm(() => {
|
|
|
892
971
|
type: oneOf(["off", "write-only", "on"]),
|
|
893
972
|
default: "off",
|
|
894
973
|
description: "How #@ persist storage= is honored: off, write-only (build only) or on (build and serve).",
|
|
974
|
+
notes: "Controls the `#@ persist storage=<name>` materialization tier (materialize a source into a registered [storage destination](connections.md#storage-destinations) and serve it from there — a destination is declared alongside `connections`, not in it, and is not nameable from a model). `off`: the `storage=` annotation is inert — sources build and serve from their own warehouse exactly as without it. `write-only`: materialize into the storage destination but still serve live (the measurement rung). `on`: build **and** serve from the storage table via the virtual-source transform. Read at startup. A kill switch: moving it **down** never fails a loaded package — a `storage=` source just reverts to serving live and surfaces as a package warning. See [persist-storage-tutorial.md](persist-storage-tutorial.md).",
|
|
895
975
|
aliases: { env: ["PERSIST_STORAGE_MODE"] }
|
|
896
976
|
}),
|
|
897
977
|
setting({
|
|
@@ -899,6 +979,7 @@ var init_storage = __esm(() => {
|
|
|
899
979
|
type: boolean(),
|
|
900
980
|
default: false,
|
|
901
981
|
description: "Refuse a publish where two persist sources resolve to the same table.",
|
|
982
|
+
notes: "Set to `true` to refuse a publish in which two persist sources of one package resolve to the same table in the same destination. Off, a collision is a warning; loading a package only ever warns.",
|
|
902
983
|
aliases: { env: ["PERSIST_COLLISION_ENFORCE"] }
|
|
903
984
|
}),
|
|
904
985
|
setting({
|
|
@@ -906,6 +987,7 @@ var init_storage = __esm(() => {
|
|
|
906
987
|
type: boolean(),
|
|
907
988
|
default: false,
|
|
908
989
|
description: "Fire packages' materialization schedules from this process; never on an orchestrated worker.",
|
|
990
|
+
notes: "Opt-in: enable the standalone materialization scheduler, which fires each loaded package's `materialization.schedule` cron, and each published package version's (see [package-versions.md](package-versions.md#materializations)), so a self-hosted Publisher rebuilds on a cadence with no control plane. **Never set this on a control-plane-driven (orchestrated) worker** — it is the primary guard against double-driving refresh. See [materialization.md](materialization.md).",
|
|
909
991
|
aliases: { env: ["PUBLISHER_LOCAL_MATERIALIZATION_SCHEDULER"] }
|
|
910
992
|
}),
|
|
911
993
|
setting({
|
|
@@ -913,6 +995,8 @@ var init_storage = __esm(() => {
|
|
|
913
995
|
type: integer({ min: 1000 }),
|
|
914
996
|
default: 60000,
|
|
915
997
|
description: "How often the scheduler looks for due schedules, in ms.",
|
|
998
|
+
notes: "How often the scheduler sweeps for due schedules, in ms. Minimum `1000`. Only read when the scheduler is enabled.",
|
|
999
|
+
defaultText: "`60000` (1 min)",
|
|
916
1000
|
aliases: { env: ["PUBLISHER_MATERIALIZATION_SCHEDULER_INTERVAL_MS"] }
|
|
917
1001
|
}),
|
|
918
1002
|
setting({
|
|
@@ -920,6 +1004,7 @@ var init_storage = __esm(() => {
|
|
|
920
1004
|
type: integer({ min: 1 }),
|
|
921
1005
|
default: 10,
|
|
922
1006
|
description: "Packages the scheduler fires per look.",
|
|
1007
|
+
notes: "Stampede guard: max packages fired per sweep. A capped package fires on a later tick. Must be a positive integer.",
|
|
923
1008
|
aliases: {
|
|
924
1009
|
env: ["PUBLISHER_MATERIALIZATION_SCHEDULER_MAX_FIRES_PER_TICK"]
|
|
925
1010
|
}
|
|
@@ -166293,7 +166378,7 @@ var init_telemetry = __esm(() => {
|
|
|
166293
166378
|
});
|
|
166294
166379
|
|
|
166295
166380
|
// package.json
|
|
166296
|
-
var version = "0.12.
|
|
166381
|
+
var version = "0.12.5";
|
|
166297
166382
|
var init_package = () => {};
|
|
166298
166383
|
|
|
166299
166384
|
// src/version.ts
|