Repository navigation
feat: Apus data-plane server - #339
Draft
raphael-goetz wants to merge 4 commits into
Draft
raphael-goetz wants to merge 4 commits into
raphael-goetz wants to merge 4 commits into
Conversation
Wires apus-protocol (sibling repo ../apus/rust/apus-protocol) into the workspace as a path dependency, and adds it plus serde_json as runtime dependencies of the taurus crate (serde_json moves from dev-only to a real dependency: exec.rs::load_flows_file uses it at runtime). Adds rcgen and time as dev-dependencies for the Apus integration test suite's in-process TLS certificate generation.
Ports the Apus v1 data-plane server from the apus repo's reference
implementation (apus/worktrees/taurus-083, branch apus, built on
tucana-0.0.83-feature) into crates/taurus/src/app/apus/:
- hub.rs: the Apus server (ApusHub, Connection, CallReply,
ServerSettings, serve/serve_on). Mutual TLS (action identity from the
client certificate's URI SAN) or plain TCP; handshake timeout;
connection limits; ROUTES/STATUS; call slots and admission control;
deadlines + CANCEL; bidirectional streams; heartbeats; GOAWAY; RETURN
of a function becomes a tucana SubFlowFunctionResult.
- convert.rs: hardened Apus <-> tucana value conversion, template
forwarding, automatic streaming of large strings.
- exec.rs: flow execution requested over Apus (ExecContext,
ExecutionMode {Nats, Local}, FlowSource {Kv, Memory}), flow lookup
from the NATS KV store (cached + watched), ownership checks, local
execution via worker::execute_flow, NATS execution via request/reply,
load_flows_file.
- remote.rs: RoutingRemote implementing taurus_core's RemoteRuntime --
Apus when the action is directly connected, NATS fallback otherwise.
- tests.rs: the integration test suite (raw-frame mock action driving
serve_on) -- handshake, routing, overload, hostile input, streams
both directions, sub-flows, returned functions, deadlines, CANCEL,
heartbeats, client-certificate identity and expiry.
No changes needed porting onto current origin/main: the reference
implementation's mod.rs already excludes the earlier experimental
"Glue" gRPC hub.
app/mod.rs: declares pub mod apus; makes NATS optional (gated on the new nats_enabled config flag -- when disabled there's no execution queue, Apus only); builds an ApusHub when apus_enabled, constructs apus::RoutingRemote (hub + optional NATS remote + timeout + trace flag) and passes it to the worker in place of the bare NATS remote runtime; adds start_apus_server(...), which picks the FlowSource from either APUS_FLOWS_PATH or the NATS flow-store KV bucket, builds the rustls TlsAcceptor from apus_protocol::tls::server_config when all three TLS paths are configured (panics on startup if only some of the three are set), wires watch_routes, and spawns apus::serve; on shutdown calls hub.goaway_all(...). worker.rs: threads RoutingRemote through in place of the bare NATS remote runtime; after computing a flow run result, if the inbound execution message carries a NATS reply inbox, publishes the encoded result there, so an Apus instance that queued the execution over NATS gets the outcome back. Makes FlowRunResult and the functions exec.rs reuses (execute_flow, function_identifiers_by_node_id) pub(crate).
Adds Config fields (each via env_with_default) for the Apus data-plane server: APUS_ENABLED, APUS_HOST, APUS_PORT, APUS_MAX_IN_FLIGHT, APUS_HEARTBEAT_MS, APUS_TRACE, APUS_INSTANCE_ID, APUS_ADVERTISE, APUS_ROUTING_PATH, APUS_TLS_CERT/_KEY/_CLIENT_CA, APUS_STREAM_THRESHOLD, APUS_MAX_FRAME, APUS_MAX_CONNECTIONS, APUS_MAX_CONNECTIONS_PER_ACTION, APUS_EXECUTION, APUS_FLOW_BUCKET, APUS_FLOW_CACHE, APUS_FLOWS_PATH, and NATS_ENABLED (default true) to let NATS be disabled for an Apus-only deployment.
GitLab Pipeline ActionGeneral informationLink to pipeline: https://gitlab.com/code0-tech/development/taurus/-/pipelines/3014393834 Status: Passed Job summariesdocs:previewDocumentation preview available at https://code0-tech.gitlab.io/-/development/telescopium/-/jobs/17643395717/artifacts/out/index.html |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
apusrepo's POC worktree intocrates/taurus/src/app/apus/apus-protocolas a local path dependency on the siblingapusrepo (pre-publish phase)app/mod.rs/app/worker.rs, makes NATS optional, addsAPUS_*config/env varsTaurus → NATS → Aquila → gRPC → actiondata-plane path with a direct Taurus↔action connection; Aquila's gRPC control plane is unchangedTest plan
cargo build --workspacecargo test -p taurus— 45/45, including the 25-case Apus integration suite (handshake, routing, overload, hostile input, streams, sub-flows, returned functions, deadlines, cancel, heartbeats, client-cert identity/expiry)cargo test --workspaceorigin/mainunrelated to this change (confirmed via clean-checkout comparison); not introduced here🤖 Generated with Claude Code