STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
storage.py
Go to the documentation of this file.
1"""Version storage for engine designs: microversions + immutable releases.
2
3A thin binding of :mod:`stardesign.storage` to this app's S3 environment. The
4module-level ``backend`` and ``IS_S3`` names are what the rest of this backend
5imports, so they stay.
6
7Design version history in S3 when ``ENGINE_S3_BUCKET`` is set; files on the
8``USERDATA_DIR`` volume otherwise (dev, and prod with no bucket).
9"""
10
11from stardesign.storage import LocalBackend, S3Backend, Snapshot, make_backend # noqa: F401
12
13from backend import userdata
14
15backend = make_backend(
16 userdata.store,
17 bucket_env="ENGINE_S3_BUCKET",
18 prefix_env="ENGINE_S3_PREFIX",
19 default_prefix="engine",
20)
21IS_S3 = isinstance(backend, S3Backend)