<#7501 feat(flytestdlib): add redis-backed storage...
# flyte-github
a
#7501 feat(flytestdlib): add redis-backed storage to the storage module Pull request opened by kumare3 Why Allow an alternate metadata storage backend (inputs/outputs protobufs) besides object stores, selected purely by config/path. This is the backend counterpart of flyteorg/flyte-sdk#1191, which added
redis://
metadata storage to the Python SDK via an fsspec plugin — with both sides in place, a
redis://<addr>/<key>
DataReference written by one resolves on the other. What Adds a
redis
storage type to
flytestdlib/storage
, alongside the stow-backed and in-memory raw stores: •
RedisStore
(new
redis_store.go
): implements
RawStore
on top of
github.com/redis/go-redis/v9
(already a repo dependency). One object = one Redis string value, keyed by the path portion of the reference, verbatim; directories are emulated as key prefixes (SCAN on
<prefix>/*
).
CopyRaw
reuses
copyImpl
like the in-memory store. • Config:
storage: { type: redis, redis: { addr: host:port, username, password, db } }
. The
Redis
field is
pflag:"-"
(same as
cache.Config.Redis
), so the generated
config_flags.go
only needed the
type
doc-string update. • List maps the storage
Cursor
onto the Redis SCAN cursor for pagination. • ReadRaw enforces the existing
maxDownloadMBs
limit; missing keys return
os.ErrNotExist
(matching the in-memory store);
CreateSignedURL
is unsupported. •
GetBaseContainerFQN
returns
redis://<addr>
, so
ConstructReference
produces fully-qualified
redis://
references with the standard
URLPathConstructor
. Intended for metadata-sized objects: a Redis string caps at 512MiB and lives in RAM; large raw data should stay in a blob store. Testing New tests run against miniredis (new test-only dependency, no server needed): raw IO round-trips, empty values (zero-input tasks serialize to zero bytes), Head/Delete, List pagination across SCAN cursors, the download-size limit, non-redis reference rejection, and an end-to-end
NewDataStore
test covering type selection, reference construction, WriteRaw/CopyRaw/ReadRaw.
go test ./flytestdlib/storage/...
passes;
golangci-lint run ./storage/...
reports the same 64 pre-existing issues as
main
(none in the new files); full
go build ./...
passes. 🤖 Generated with Claude Code flyteorg/flyte