ursa.store.config

Pydantic config models for the Ursa object-store layer.

A YAML config maps named roles (default, raw, catalog, polaris_cache, …) to backend configs. M1 ships R2 + Local; S3 / GCS land as additive discriminator values once they have a real backend implementation.

Credentials never appear in YAML. The r2 backend resolves credentials at construction time via constellation_utils.secrets.r2_*(). The YAML selects which of those four accessors to call via the creds field; the bucket name rides along on the resolved R2Secrets object so the config never names buckets either — the cred selector IS the bucket selector.

Module Contents

Classes

_Base

R2StoreConfig

Cloudflare R2 backend, S3-protocol via obstore.

LocalStoreConfig

Local filesystem backend backed by obstore.store.LocalStore.

UrsaConfig

Top-level config. stores maps role names to backend configs.

Data

API

ursa.store.config.__all__

[‘R2StoreConfig’, ‘LocalStoreConfig’, ‘ObjectStoreConfig’, ‘UrsaConfig’, ‘R2Creds’]

ursa.store.config.R2Creds

None

class ursa.store.config._Base(/, **data: typing.Any)[source]

Bases: pydantic.BaseModel

model_config

‘ConfigDict(…)’

class ursa.store.config.R2StoreConfig(/, **data: typing.Any)[source]

Bases: ursa.store.config._Base

Cloudflare R2 backend, S3-protocol via obstore.

creds selects the constellation-utils accessor (and therefore the bucket — *_rw accessors return RW credentials, *_ro return RO). The bucket name comes from the resolved credential object; we never repeat it in YAML.

Mapping (see docs/source/architecture.md):

  • assets_rw -> constellation-assets[-test] RW (Ursa-managed data)

  • assets_ro -> constellation-assets[-test] RO (downstream readers)

  • raw_rw -> constellation-data[-test] RW (data-engine uploader)

  • raw_ro -> constellation-data[-test] RO (Ursa reading raw)

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

backend: Literal[r2]

None

creds: ursa.store.config.R2Creds

None

prefix: str = <Multiline-String>
class ursa.store.config.LocalStoreConfig(/, **data: typing.Any)[source]

Bases: ursa.store.config._Base

Local filesystem backend backed by obstore.store.LocalStore.

root is combined with prefix and resolved on construction; the LocalStore then confines all keys under that directory.

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

backend: Literal[local]

None

root: pathlib.Path

None

prefix: str = <Multiline-String>
ursa.store.config.ObjectStoreConfig

None

class ursa.store.config.UrsaConfig(/, **data: typing.Any)[source]

Bases: ursa.store.config._Base

Top-level config. stores maps role names to backend configs.

get_store(role) defaults role to "default"; configs that omit a default entry must pass role= explicitly to get_store().

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

stores: dict[str, ursa.store.config.ObjectStoreConfig]

None