Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specification: In-Memory Registry #96

Open
wants to merge 9 commits into
base: 0.28-affirm
Choose a base branch
from

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
@@ -304,9 +303,10 @@ def __copy__(self):
aggregations=self.aggregations,
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.

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.

1 participant