Skip to content

Commit a5059af

Browse files
authored
feat!: discovered nodes, run output and node results, service accounts and republish
Upgrade the server, its schedulers, every location and every worker together: 1. Pause every schedule and sensor, start no manual runs, and keep the scheduler running. 2. Let queued and running runs finish, or cancel them. 3. Stop every server process and every separate sqb scheduler on the control database before the new release starts or migrates it with sqb server migrate or sqb admin. 4. Start the servers and schedulers on the new release, which applies control store migrations 0006 to 0009. 5. Upgrade and restart every location, so each publishes its project again. 6. Once every location has published again, resume schedules and sensors. A control store that an earlier work-in-progress build of this release migrated to version 7, 8 or 9 has a different schema at the same version, and must be recreated. feat(python-nodes): discovered nodes, with @discover and @asset(for_each=...), run in parallel up to max_parallel feat(location): republish a served location on request, with sqb location republish, the API or the UI, and read its discovered sets back feat(runs): keep run output in a local or S3 output store, with paged, searchable and downloadable reads, a per-run byte cap and retention feat(runs): record what each run node did: table rows, progress, no-change reason and not run feat(ui): the run page shows each node's rows, checks, logged lines and output, and plans a selection with Plan these feat(server): service accounts with sqbk_ API keys, managed with sqb admin and in the UI feat(admin): sqb admin prints one line naming what it did, and JSON with --json feat(dev): sqb dev accepts named hosts with --allow-host and a listen address with --host fix(cli): Ctrl+C stops any command at any point, including at a sign-in prompt, with exit code 130 fix(plan): sqb plan plans as usual when a provider secret is missing and lists what can't run fix(secrets): give advice that fits the command when a provider secret is missing fix(triggers): pause or resume a schedule whose job can't be read, with trigger.toggle on every node of its target fix(sensors): an unreadable stored tick no longer fails the sensor page or trigger list, and manual builds send check events fix(runs): keep error and diagnostic text without NUL, or redacted, so PostgreSQL stores it fix(compiler): keep an expansion from opening or extending a comment fix(dev): sqb dev doesn't republish when a run writes its output inside the project fix(discovery): a discovered item that names a node the project lacks fails only its own set fix(deploy): the server image and compose.yml keep run output on a volume Also: a model's table rows and a loader's affected rows stay on host results; Ctrl+C ends a command without loading the failure classes, and Recall records a swallowed interrupt as cancelled. BREAKING CHANGE: This release changes the control store, the location and worker protocol, Python nodes, reruns and command output. - Upgrade: the server, its schedulers, every location and every worker must run this release. Work polls require `scope`, a location's publication request carries `generation`, `rediscover`, `previous` and `seed`, and a run's execution always carries `discovered`. - Control store: migrations 0006 to 0009 add node results, the run output index, a snapshot's discovered document and service accounts. - Run page: it has no rerun buttons. Plan these opens the plan page for the selection, and running that plan starts a new run with its own `ctx.root_run_id`. To resume a run, rerun it from failure in the Runs list or with `sqb admin rerun-run --from-failure`, which keep its `ctx.root_run_id`. - Reruns: rerun from failure, and automatic retries of runs nobody cancelled, include cancelled nodes as well as failed, skipped and unreached ones. - Python nodes: `ctx.log` is a logger; use `ctx.log.info`, `ctx.log.warning` or `ctx.log.error`. - Discovered nodes: a @discover function that returns no items fails its set, which keeps its last good items. Providers used by steps of a set with `max_parallel` must be thread-safe, and new SQL waits while those steps run. On in-memory DuckDB, MotherDuck or SQLite targets the items run one at a time. - Cancels: a cancel waits 5 seconds for discovered steps still running, then records them cancelled and exits without tearing down the providers they may still use, and a sink's forced close leaves them open too. - Ctrl+C: a command interrupted by Ctrl+C prints `error: interrupted (Ctrl+C)` and exits with 130, instead of a KeyboardInterrupt traceback and death by SIGINT. - sqb plan: a missing provider secret no longer fails it with D012. It lists what the secret stops under Can't run and in `cant_run`, and no longer prints the note naming providers allowed to miss their secrets. - sqb admin: it prints JSON only with `--json`; add it to scripts that parse its output. - Run output: with a SQLite control database it is kept in `output` beside the database; with PostgreSQL in the service user's state folder (`$XDG_STATE_HOME/sqlbuild/output` or `~/.local/state/sqlbuild/output`). Set `[output] store` to keep it on a persistent volume, in the same change as the upgrade, as earlier releases refuse an `[output]` section.
1 parent 9245cba commit a5059af

821 files changed

Lines changed: 46316 additions & 10469 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Cargo.lock‎

Lines changed: 143 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ rusqlite = { version = "0.37", features = ["bundled", "column_decltype"] }
157157
rustix = { version = "1.1.4", default-features = false, features = ["event", "fs", "process", "pty", "std", "stdio", "termios"] }
158158
saphyr-parser = "0.1"
159159
regex = "1"
160+
object_store = { version = "0.13", default-features = false, features = ["fs", "aws"] }
160161
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
161162
serde = { version = "1", features = ["derive"] }
162163
# Reports every field a decode ignores; a worker refuses a run request it can only partly read.
@@ -170,6 +171,7 @@ chrono = { version = "0.4", features = ["serde"] }
170171
chrono-tz = "0.10"
171172
croner = "=3.0.1"
172173
flate2 = "1"
174+
zstd = { version = "0.13", default-features = false }
173175
proptest = "1"
174176
same-file = "1"
175177
semver = "1"

‎Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ E2E_DUCKDB_BUILD_CORE_PATHS := \
135135
tests/e2e/src/sqlbuild/cli/commands/main/build/test_compile_json_behavior.py \
136136
tests/e2e/src/sqlbuild/cli/commands/main/build/test_dynamic_column_contract.py \
137137
tests/e2e/src/sqlbuild/cli/commands/main/build/test_dag_json_behavior.py \
138+
tests/e2e/src/sqlbuild/cli/commands/main/build/test_discovered_nodes.py \
138139
tests/e2e/src/sqlbuild/cli/commands/main/build/test_enum_contract.py \
139140
tests/e2e/src/sqlbuild/cli/commands/main/build/test_execution_limits.py \
140141
tests/e2e/src/sqlbuild/cli/commands/main/build/test_explicit_references.py \

‎clients/typescript/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ separate authentication contract, not an inferred privilege of this client.
4242
## Authenticate through a trusted proxy
4343

4444
Create a person with `sqb admin create-principal orders-reader`, then put the
45-
returned `principal_id` in the `[trusted_proxy]` section of the server's
45+
ID it prints (`principal_id` with `--json`) in the `[trusted_proxy]` section of the server's
4646
`server.toml`. Subjects are exact ASCII upstream identities, not inferred local
4747
usernames or email addresses:
4848

0 commit comments

Comments
 (0)