Skip to content

Conversation

@Rostifar
Copy link
Collaborator

@Rostifar Rostifar commented Oct 10, 2023

Specification: In-Memory Registry

Design

A MemoryRegistry is a Docker image derived mapping from FeastResource identifiers to in-memory Python objects, making it stateless between pods and deploys. A FeastResource is a union of resource types:

TimeDependentObject = Union[
    BaseFeatureView,
    FeatureView,
    StreamFeatureView,
    OnDemandFeatureView,
    RequestFeatureView,
    Entity,
    FeatureService,
    SavedDataset
]

FeastResource = Union[
    TimeDependentObject, DataSource, SavedDataset, ValidationReference, ProjectMetadata, Infra
]

Some general constraints:

  1. MemoryRegistry should subclass BaseRegistry and behave like any other Feast registry during apply calls,
  2. When a FeatureStore instance is constructed,MemoryRegistry should be populated by a thread-local feast apply call,
  3. apply_* and get_* calls to MemoryRegistry should use / return shallow-copied objects to reduce the risk of side effects,
  4. MemoryRegistry instances should be immutable once the is_built flag is set,
  5. proto calls to MemoryRegistry should be evaluated on-demand to prevent space overhead,
  6. Any MemoryRegistry instance should not exceed 10MB of space usage (as determined by len(dill.dumps(registry_instance)). At the moment (2023/10/10), the registry requires 0.3MB of RAM. MMAPing portions of the registry may be needed as things scale.

@Rostifar Rostifar changed the title start impl Draft: In-Memory Registry Oct 10, 2023
@Rostifar Rostifar changed the title Draft: In-Memory Registry Spec: In-Memory Registry Oct 10, 2023
@Rostifar Rostifar changed the title Spec: In-Memory Registry Specification: In-Memory Registry Oct 10, 2023
@Rostifar Rostifar added the work-in-progress do not merge label Oct 10, 2023
implementation ckpt 1

better type checking plus some bug fixes

more impl
@Rostifar Rostifar force-pushed the ross/stable-registry branch from 3f8ecd5 to 2949d59 Compare October 10, 2023 21:24
mode=self.mode,
timestamp_field=self.timestamp_field,
source=self.source,
source=self.stream_source,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bug in __copy__. self.source isn't defined for SFV objects; instead, stream_source serves the same role as source.

source=self.stream_source,
udf=self.udf,
)
fv.entities = self.entities
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A typing bug: type(self.entities) == List[str] while FeatureView's constructor requires Union[List[Entity], None].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

work-in-progress do not merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants