Skip to main content

Crate cellos_export_http

Crate cellos_export_http 

Source
Expand description

ExportSink that HTTP PUTs artifact bytes to a configurable base URL.

Supports:

  • S3 presigned PUT URLs
  • Generic HTTP artifact endpoints
  • CI systems that accept artifact uploads via HTTP

Optional retry knobs:

  • max_attempts — total PUT attempts, including the first try
  • retry_backoff_ms — fixed delay between transient retries

Upload URL behavior:

  • If base_url contains {cell_id} or {artifact_name}, those placeholders are replaced.
  • Else if base_url contains a query string, it is treated as an exact URL.
  • Else the sink appends /{cell_id}/{artifact_name}.

Configure CELLOS_EXPORT_HTTP_BASE_URL and optionally CELLOS_EXPORT_HTTP_BEARER_TOKEN in the environment, then construct via HttpExportSink::new or HttpExportSink::from_env. Base URLs must parse as http or https after trim (empty or other schemes are rejected at construction).

§Timeout contract (EXPORT-HTTP-TIMEOUT)

The reqwest client is built with bounded request and connect timeouts so a hung artifact endpoint cannot stall a cell’s export phase indefinitely:

Both env vars accept a positive u64 count of milliseconds; unparseable or zero values fall back to the default. Operators can raise the request timeout for slow large-artifact endpoints, but the client is never constructed without explicit timeouts.

Structs§

HttpExportSink
HTTP PUT export sink — uploads artifact file bytes to a resolved URL derived from base_url.

Constants§

DEFAULT_CONNECT_TIMEOUT_MS
Default TCP connect timeout (ms) for the underlying reqwest client.
DEFAULT_REQUEST_TIMEOUT_MS
Default total request timeout (ms) applied to every artifact PUT.
ENV_CONNECT_TIMEOUT_MS
Env var to override DEFAULT_CONNECT_TIMEOUT_MS.
ENV_REQUEST_TIMEOUT_MS
Env var to override DEFAULT_REQUEST_TIMEOUT_MS.

Functions§

resolve_timeout_ms
Resolve a timeout in milliseconds from the named env var.