Repository navigation
feat(infra): olf infra backup for the local provider (#910) - #926
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4d91dd39a0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b9caa7798b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
8197174 to
c462c0c
Compare
Pauses the Dagster daemon of every stage, refuses while a run is in flight, dumps polaris first and then the other databases, copies every bucket with a key and size inventory, seals the data-bound Secrets and local-ca under a passphrase, and writes manifest.json and SHA256SUMS. The daemon is resumed in a finally. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UVCVTmCcKfSZH6Q4J2L5fZ
…910) Distinct keys such as a//b and a/b resolve to one path under the backup directory, so the second download overwrote the first while both stayed in the inventory and the size checks passed. The copy now refuses colliding keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UVCVTmCcKfSZH6Q4J2L5fZ
In CI, Rich colours option names, so "--output" was split by ANSI codes and the plain substring check failed. Render with NO_COLOR and strip any codes left. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UVCVTmCcKfSZH6Q4J2L5fZ
Backup tests assert daemon and dump state instead of call order; trailing-slash objects with data and keys with line breaks are refused; the Dagster check bypasses ambient proxies via the route exemption. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UVCVTmCcKfSZH6Q4J2L5fZ
c462c0c to
ae5be9c
Compare
Closes #910 (part of #531), PR 2 of 3. It is stacked on the backup-format PR;
olf infra restore(#911) follows.What
olf infra backup --output DIR [-f openlakeforge.yaml] [--project-root …], local provider only. The provider comes from the profile, and a backup always covers every enabled stage.deployment/dagster-daemonin every stage, and waits for the pods to be gone. It refuses if runs are in flight (Dagster GraphQL), and always resumes the daemon, in afinally. If the resume itself fails, the error carries the exactkubectl scalecommand to run.polarisfirst, then the other databases.pg_dump -Fc --no-owner --no-aclruns inpostgresql-0and streams to a file (k8s.exec_to_file), so a dump never sits in memory.{key: size}inventory and checks each object's size; a path-traversal key is refused.k8s.secret_with_type) and fails, naming any that is missing. It encrypts them intosecrets.enc.manifest.jsonwith release =olf.__version__,profile_sha256=sha256_file(profile),provider, stages, dumps, buckets, and Secret names and keys (never values). It also writesSHA256SUMS.A failed backup leaves what it wrote and no
manifest.json, so restore refuses it.k8shelpers:secret_with_type,exec_to_file,deployment_replicas,scale_deployment(which waits for pods to be gone at 0).docs/reference/cli.md, CHANGELOG (Added).Size
12 files, +816/−17, over the ~600 guide. About 470 lines are non-test code, a single command; the rest are tests for its ordering and secret-handling guarantees. The format modules already went out separately in PR 1 of 3.
Not verified on a live stack
pg_dump -U postgresover the pod's local socket;dagster-daemonDeployment name;runsOrErrorstatus filter;kubectl execstreaming;The restore drill (#913) exercises these.
Checks run
test_backup.py,test_backup_cluster.py,test_k8s.py):polarisis dumped before any other dump and before the first object copy;find_exposuresfinds no Secret value in the backup directory or the captured logs, and the passphrase appears nowhere;pytest tools/olf/tests: 3252 passed, 17 skippedmypy: no issuesruff checkandruff formaton the changed files: passolf check docsandolf check structure: passGenerated by Claude Code