Skip to main content

Crate graphrt_provider_api

Crate graphrt_provider_api 

Source
Expand description

§graphrt-provider-api

The contract between the graphrt gateway and the platforms it wakes agents on (plan §6). Every provider (local-process, Kubernetes, Cloud Run, Azure Container Apps, ECS Fargate, Lambda, Fly) lives in its own crate or module behind its own cargo feature and implements:

The crate also carries the one HTTP layer providers share (http: a token bucket per provider API, jittered retry of 429/5xx, token caching with one refresh on 401; the reqwest client is behind feature http) and, behind feature conformance, the C1–C13 suite with a scripted fake HTTP server and an in-memory reference provider ([conformance]).

No cloud SDK is used anywhere: REST and auth are hand-rolled per provider.

use graphrt_provider_api::{Addressing, ProviderError, ProviderErrorKind};

assert_eq!(ProviderError::kind_for_status(429), ProviderErrorKind::RateLimited);
assert!(ProviderErrorKind::Transient.is_retryable());
assert_ne!(Addressing::Replica, Addressing::Url);

Re-exports§

pub use invoke::ByteStream;
pub use invoke::InvokeRequest;
pub use invoke::InvokeResponse;

Modules§

http
Shared HTTP layer of the providers: token bucket per provider API, jittered retry, token caching, and (feature http) the reqwest-based client.
invoke
Platform-native transport for gateway → agent requests.

Structs§

Capabilities
Static facts about a provider the gateway plans around (drain policy, planned preemption before a request cap, wake timeouts).
DeployError
A failed deploy.
DeploymentRef
A deployment version known to a provider. Versions are immutable (decision 6).
DeploymentSpec
What graphrt deploy asks a DeployDriver to create or update.
Endpoint
A reachable replica returned by wake.
ProviderError
A failed run-time provider call. The message never contains credentials: response bodies are truncated and headers are never included.
ReplicaRef
One replica of a deployment version.
ReplicaState
One row of Provider::list, used for reconciliation (C5, C12).
Resources
Resource requests for one replica.
SecretRef
A secret the platform injects as an environment variable. The spec carries only the reference; the value lives in the provider’s secret store and the gateway never sees it (plan §5, C10).

Enums§

Addressing
How the gateway reaches replicas of a deployment.
DeployErrorKind
What kind of failure DeployDriver::apply hit.
EndpointAddress
Where a replica listens. Always obtained from the provider API or a socket path the gateway chose, never from a claim made by the agent (plan §3.2).
ProviderErrorKind
What kind of failure a provider call hit.
ReleaseMode
How a replica is given back.
ReplicaPhase
Lifecycle phase of a replica as the provider reports it.
Scaler
Who decides the number of replicas.

Traits§

DeployDriver
Creates or updates a deployment version (graphrt deploy --target <t>). Writes secrets to the provider’s secret store as references; the gateway never receives them.
Provider
Run-time operations only: wake, release, list. Creating or updating a deployment is graphrt deploy’s job with deploy-time credentials (DeployDriver); the gateway’s credentials can only wake / scale / stop / list.

Type Aliases§

BoxFuture
A boxed Send future, the return type of every async trait method here.