-
Notifications
You must be signed in to change notification settings - Fork 87
runtime-v2: introduce runtime-next with flowctl raw preview-next
#2925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jgraettinger
wants to merge
8
commits into
master
Choose a base branch
from
johnny/runtime-v2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
046cba9
docs: introduce runtime-v2 design plan and AGENTS.md
jgraettinger 77ccb46
proto-gazette: switch to BTreeMap and Bytes, add Clock::delta
jgraettinger 9f1e872
shuffle: replace streamed FrontierChunk with single Frontier message
jgraettinger be17d11
materialize: add connector_state_patches_json on Flush/StartCommit/Ac…
jgraettinger 6ae6b42
runtime-next: copy files from runtime crate
jgraettinger 94cffe0
runtime-next: wire up protobuf bindings for runtime.proto
jgraettinger 1b877b5
runtime-next: add Rust-driven runtime crate
jgraettinger 84f1ac2
flowctl raw preview-next: add V2 runtime materialization preview
jgraettinger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| # CLAUDE.md | ||
|
|
||
| Estuary is a real-time data platform with: | ||
| - Control plane: user-facing catalog management APIs | ||
| - Data planes: distributed runtime execution | ||
| - Connectors: OCI images integrating external systems | ||
|
|
||
| This repo lives at `https://github.com/estuary/flow` | ||
|
|
||
| ## Repository Overview | ||
|
|
||
| Estuary is built with: | ||
| - **Rust** (primary language) | ||
| - Third-party sources under `~/.cargo/registry/src/` | ||
| - **Go** - integration glue with the Gazette consumer framework | ||
| - Third-party sources under `~/go/pkg/mod/` | ||
| - **Protobuf** - communication between control plane, data planes, and connectors | ||
| - **Supabase** - migrations are under `supabase/migrations/` | ||
| - pgTAP tests under `supabase/tests/` | ||
| - **Docs** - external user-facing product documentation under `site/` (Docusaurus) | ||
|
|
||
| ## Essential Commands | ||
|
|
||
| ### Build & Test | ||
|
|
||
| Use regular `cargo` and `go` tools to build and test crates. | ||
|
|
||
| ```bash | ||
| # libsqlite3 tag is required for `bindings` and `flowctl-go` packages. | ||
| go build -tags libsqlite3 ./go/bindings | ||
|
|
||
| # Regenerate checked-in protobuf (required after .proto changes) | ||
| mise run build:go-protobufs | ||
| mise run build:rust-protobufs | ||
|
|
||
| # Run pgTAP SQL Tests | ||
| mise run ci:sql-tap | ||
|
|
||
| # E2E tests over derivation examples (SLOW) | ||
| mise run ci:catalog-test | ||
| ``` | ||
|
|
||
| ### Development | ||
|
|
||
| A development Supabase instance is available: | ||
| ```bash | ||
| # Reset with current migrations as needed | ||
| supabase db reset | ||
|
|
||
| # Interact directly with dev DB | ||
| psql postgresql://postgres:postgres@localhost:5432/postgres -c 'SELECT 1;' | ||
| ``` | ||
|
|
||
| ## Architecture Overview | ||
|
|
||
| ### Core Concepts | ||
|
|
||
| Users interact with the control plane to manage a catalog of: | ||
| - **Captures**: tasks which capture from a user endpoint into target collections | ||
| - **Collections**: collections of data with enforced JSON Schema | ||
| - **Derivations**: both a collection and a task - the task builds its collection through transformation of other collections | ||
| - **Materializations**: tasks which maintain materialized views of source collections in an endpoint | ||
| - **Tests**: fixtures of source collection inputs and expected derivation outputs | ||
|
|
||
| Collections and tasks have a declarative (JSON/YAML) **model**. | ||
| Users refine model changes in **drafts**, which are **published** | ||
| to the control plane for verification and testing. | ||
| The control plane compiles the user's catalog model into | ||
| **built specs** that have extra specifics required by the runtime, | ||
| and activates specs into their associated data plane. | ||
|
|
||
| ### Control-plane components | ||
| - **Supabase**: catalog and platform config DB | ||
| - **Agent**: APIs and background automation | ||
| - **Data-plane controller**: provisions data planes | ||
|
|
||
| ### Data-plane components | ||
| - **Gazette**: brokers serve the journals that back collections | ||
| - **Reactors**: runtime written to Gazette consumer framework; | ||
| executes tasks and runs connectors as sidecars over gRPC | ||
| - **Etcd**: config for gazette and reactors | ||
|
|
||
| ### Protocols | ||
|
|
||
| - `go/protocols/flow/flow.proto` - core types and built specs | ||
| - `go/protocols/capture/capture.proto` - protocol for capture tasks | ||
| - `go/protocols/derive/derive.proto` - for derivation tasks | ||
| - `go/protocols/materialize/materialize.proto` - for materialization tasks | ||
|
|
||
| ## README.md | ||
|
|
||
| Every crate/module should have a README.md with essential context: | ||
| - Purpose and fit within the project | ||
| - Key types and entry points | ||
| - Brief architecture and non-obvious details | ||
|
|
||
| A README.md is ONLY a roadmap for expert developers, | ||
| orienting them where to look next. | ||
|
|
||
| Keep READMEs current - update with code changes. | ||
|
|
||
| ## Development Guidelines | ||
|
|
||
| ### Implementation | ||
| - Use `var myVar = ...` in Go. Do NOT use `myVar := ...` (unless required due to shadowing) | ||
| - Write comments that document "why" - rationale, broader context, and non-obvious detail | ||
| - Do NOT write comments which describe the obvious behavior of code. | ||
| Don't write `// Get credentials` before a call `getCredentials()` | ||
| - Use early-return over nested conditionals | ||
| - Use at least one level of name qualification for third-party types and functions. | ||
| For example, `axum::Router::new()` instead of `use axum::Router; Router::new()`. | ||
| Types / functions should be unqualified ONLY if they're in the current module. | ||
| - Prefer pure functions that take and act over POD states. | ||
| AVOID structures that mix complex state and impl behaviors, where possible. | ||
| The exception is state machines: structs and enums that encapsulate fine-grain | ||
| POD state into higher-order transitions that are easier to reason about. | ||
| DO seek to decompose problems into state machines. | ||
| - Avoid trivial impl routines which could be inlined by the caller. | ||
| Indirection is harder to read; routines must buy us something. | ||
| - Decompose IO and POD processing into separate routines where possible. | ||
| Routines should gravitate towards IO or processing, and not mix both. | ||
|
|
||
| ### Testing | ||
| - Prefer snapshots over fine-grain assertions (`insta` / `cupaloy`) | ||
|
|
||
| ### Errors | ||
| - Wrap errors with context (`anyhow::Context` / `fmt.Errorf`) | ||
| - Return errors up the stack rather than logging | ||
| - Panic on impossible states (do NOT add spurious error handling) | ||
|
|
||
| ### Logging | ||
| - Structured logging with context (`tracing` / `logrus`) | ||
| - Avoid verbose logging in hot paths | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe have this file as a symlink to CLAUDE.md?