Skip to content

Commit

Permalink
chore: Move registry files to infra/registry (#3068)
Browse files Browse the repository at this point in the history
* Rename LocalRegistryStore to FileRegistryStore

Signed-off-by: Felix Wang <[email protected]>

* Move all registry and registry store files to `infra/registry/`

Signed-off-by: Felix Wang <[email protected]>

* Update RTD docs

Signed-off-by: Felix Wang <[email protected]>

* Move base registry into separate file

Signed-off-by: Felix Wang <[email protected]>

* Update RTD docs

Signed-off-by: Felix Wang <[email protected]>

* Fix broken import

Signed-off-by: Felix Wang <[email protected]>

* Update RTD doc structure

Signed-off-by: Felix Wang <[email protected]>

* Add skeleton `registry.py` file to not break imports

Signed-off-by: Felix Wang <[email protected]>

* Fix

Signed-off-by: Felix Wang <[email protected]>

* Change reloading to cover new FileRegistryStore

Signed-off-by: Felix Wang <[email protected]>

* Remove `registry.py` file

Signed-off-by: Felix Wang <[email protected]>

Signed-off-by: Felix Wang <[email protected]>
  • Loading branch information
felixwang9817 authored Aug 16, 2022
1 parent 081a91a commit 2913c6d
Show file tree
Hide file tree
Showing 51 changed files with 1,136 additions and 1,203 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ from feast.infra.local import LocalProvider
from feast.infra.offline_stores.offline_store import RetrievalJob
from feast.protos.feast.types.EntityKey_pb2 import EntityKey as EntityKeyProto
from feast.protos.feast.types.Value_pb2 import Value as ValueProto
from feast.registry import Registry
from feast.infra.registry.registry import Registry
from feast.repo_config import RepoConfig


Expand Down
18 changes: 9 additions & 9 deletions go/internal/feast/registry/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import (
"github.com/feast-dev/feast/go/protos/feast/core"
)

// A LocalRegistryStore is a file-based implementation of the RegistryStore interface.
type LocalRegistryStore struct {
// A FileRegistryStore is a file-based implementation of the RegistryStore interface.
type FileRegistryStore struct {
filePath string
}

// NewLocalRegistryStore creates a LocalRegistryStore with the given configuration and infers
// NewFileRegistryStore creates a FileRegistryStore with the given configuration and infers
// the file path from the repo path and registry path.
func NewLocalRegistryStore(config *RegistryConfig, repoPath string) *LocalRegistryStore {
lr := LocalRegistryStore{}
func NewFileRegistryStore(config *RegistryConfig, repoPath string) *FileRegistryStore {
lr := FileRegistryStore{}
registryPath := config.Path
if filepath.IsAbs(registryPath) {
lr.filePath = registryPath
Expand All @@ -31,7 +31,7 @@ func NewLocalRegistryStore(config *RegistryConfig, repoPath string) *LocalRegist
}

// GetRegistryProto reads and parses the registry proto from the file path.
func (r *LocalRegistryStore) GetRegistryProto() (*core.Registry, error) {
func (r *FileRegistryStore) GetRegistryProto() (*core.Registry, error) {
registry := &core.Registry{}
in, err := ioutil.ReadFile(r.filePath)
if err != nil {
Expand All @@ -43,15 +43,15 @@ func (r *LocalRegistryStore) GetRegistryProto() (*core.Registry, error) {
return registry, nil
}

func (r *LocalRegistryStore) UpdateRegistryProto(rp *core.Registry) error {
func (r *FileRegistryStore) UpdateRegistryProto(rp *core.Registry) error {
return r.writeRegistry(rp)
}

func (r *LocalRegistryStore) Teardown() error {
func (r *FileRegistryStore) Teardown() error {
return os.Remove(r.filePath)
}

func (r *LocalRegistryStore) writeRegistry(rp *core.Registry) error {
func (r *FileRegistryStore) writeRegistry(rp *core.Registry) error {
rp.VersionId = uuid.New().String()
rp.LastUpdated = timestamppb.Now()
bytes, err := proto.Marshal(rp)
Expand Down
10 changes: 5 additions & 5 deletions go/internal/feast/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ var REGISTRY_SCHEMA_VERSION string = "1"
var REGISTRY_STORE_CLASS_FOR_SCHEME map[string]string = map[string]string{
"gs": "GCSRegistryStore",
"s3": "S3RegistryStore",
"file": "LocalRegistryStore",
"": "LocalRegistryStore",
"file": "FileRegistryStore",
"": "FileRegistryStore",
}

/*
Expand Down Expand Up @@ -335,8 +335,8 @@ func getRegistryStoreFromScheme(registryPath string, registryConfig *RegistryCon

func getRegistryStoreFromType(registryStoreType string, registryConfig *RegistryConfig, repoPath string) (RegistryStore, error) {
switch registryStoreType {
case "LocalRegistryStore":
return NewLocalRegistryStore(registryConfig, repoPath), nil
case "FileRegistryStore":
return NewFileRegistryStore(registryConfig, repoPath), nil
}
return nil, errors.New("only LocalRegistryStore as a RegistryStore is supported at this moment")
return nil, errors.New("only FileRegistryStore as a RegistryStore is supported at this moment")
}
48 changes: 39 additions & 9 deletions sdk/python/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ Entity
Feature View
==================

.. automodule:: feast.base_feature_view
:members:

Feature View
----------------------

.. automodule:: feast.feature_view
:members:

Expand Down Expand Up @@ -128,32 +134,59 @@ Feature Service
Registry
==================

.. automodule:: feast.registry
.. automodule:: feast.infra.registry.base_registry
:inherited-members:
:members:

Registry
----------------------

.. automodule:: feast.infra.registry.registry
:inherited-members:
:members:

SQL Registry
----------------------

.. automodule:: feast.infra.registry.sql
:inherited-members:
:members:

Registry Store
==================

.. automodule:: feast.registry_store
.. automodule:: feast.infra.registry.registry_store
:inherited-members:
:members:
:exclude-members: NoopRegistryStore

SQL Registry Store
File Registry Store
-----------------------

.. automodule:: feast.infra.registry_stores.sql
.. automodule:: feast.infra.registry.file
:members:
:noindex:

PostgreSQL Registry Store
GCS Registry Store
-----------------------

.. automodule:: feast.infra.registry_stores.contrib.postgres.registry_store
.. automodule:: feast.infra.registry.gcs
:members:
:noindex:

S3 Registry Store
-----------------------

.. automodule:: feast.infra.registry.s3
:members:
:noindex:

PostgreSQL Registry Store
-----------------------

.. automodule:: feast.infra.registry.contrib.postgres.postgres_registry_store
:members:
:noindex:

Provider
==================
Expand All @@ -173,21 +206,18 @@ Local Provider

.. automodule:: feast.infra.local
:members:
:exclude-members: LocalRegistryStore

GCP Provider
------------------

.. automodule:: feast.infra.gcp
:members:
:exclude-members: GCSRegistryStore

AWS Provider
------------------

.. automodule:: feast.infra.aws
:members:
:exclude-members: S3RegistryStore

Offline Store
==================
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
feast.infra.offline\_stores.contrib.athena\_offline\_store package
==================================================================

Subpackages
-----------

.. toctree::
:maxdepth: 4

feast.infra.offline_stores.contrib.athena_offline_store.tests

Submodules
----------

feast.infra.offline\_stores.contrib.athena\_offline\_store.athena module
------------------------------------------------------------------------

.. automodule:: feast.infra.offline_stores.contrib.athena_offline_store.athena
:members:
:undoc-members:
:show-inheritance:

feast.infra.offline\_stores.contrib.athena\_offline\_store.athena\_source module
--------------------------------------------------------------------------------

.. automodule:: feast.infra.offline_stores.contrib.athena_offline_store.athena_source
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: feast.infra.offline_stores.contrib.athena_offline_store
:members:
:undoc-members:
:show-inheritance:
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
feast.infra.offline\_stores.contrib.athena\_offline\_store.tests package
========================================================================

Submodules
----------

feast.infra.offline\_stores.contrib.athena\_offline\_store.tests.data\_source module
------------------------------------------------------------------------------------

.. automodule:: feast.infra.offline_stores.contrib.athena_offline_store.tests.data_source
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: feast.infra.offline_stores.contrib.athena_offline_store.tests
:members:
:undoc-members:
:show-inheritance:
9 changes: 9 additions & 0 deletions sdk/python/docs/source/feast.infra.offline_stores.contrib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,22 @@ Subpackages
.. toctree::
:maxdepth: 4

feast.infra.offline_stores.contrib.athena_offline_store
feast.infra.offline_stores.contrib.postgres_offline_store
feast.infra.offline_stores.contrib.spark_offline_store
feast.infra.offline_stores.contrib.trino_offline_store

Submodules
----------

feast.infra.offline\_stores.contrib.athena\_repo\_configuration module
----------------------------------------------------------------------

.. automodule:: feast.infra.offline_stores.contrib.athena_repo_configuration
:members:
:undoc-members:
:show-inheritance:

feast.infra.offline\_stores.contrib.postgres\_repo\_configuration module
------------------------------------------------------------------------

Expand Down
8 changes: 8 additions & 0 deletions sdk/python/docs/source/feast.infra.online_stores.contrib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ feast.infra.online\_stores.contrib.postgres module
:undoc-members:
:show-inheritance:

feast.infra.online\_stores.contrib.postgres\_repo\_configuration module
-----------------------------------------------------------------------

.. automodule:: feast.infra.online_stores.contrib.postgres_repo_configuration
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

Expand Down
69 changes: 69 additions & 0 deletions sdk/python/docs/source/feast.infra.registry.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
feast.infra.registry package
============================

Submodules
----------

feast.infra.registry.base\_registry module
------------------------------------------

.. automodule:: feast.infra.registry.base_registry
:members:
:undoc-members:
:show-inheritance:

feast.infra.registry.file module
--------------------------------

.. automodule:: feast.infra.registry.file
:members:
:undoc-members:
:show-inheritance:

feast.infra.registry.gcs module
-------------------------------

.. automodule:: feast.infra.registry.gcs
:members:
:undoc-members:
:show-inheritance:

feast.infra.registry.registry module
------------------------------------

.. automodule:: feast.infra.registry.registry
:members:
:undoc-members:
:show-inheritance:

feast.infra.registry.registry\_store module
-------------------------------------------

.. automodule:: feast.infra.registry.registry_store
:members:
:undoc-members:
:show-inheritance:

feast.infra.registry.s3 module
------------------------------

.. automodule:: feast.infra.registry.s3
:members:
:undoc-members:
:show-inheritance:

feast.infra.registry.sql module
-------------------------------

.. automodule:: feast.infra.registry.sql
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: feast.infra.registry
:members:
:undoc-members:
:show-inheritance:
2 changes: 1 addition & 1 deletion sdk/python/docs/source/feast.infra.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Subpackages
feast.infra.materialization
feast.infra.offline_stores
feast.infra.online_stores
feast.infra.registry_stores
feast.infra.registry
feast.infra.utils

Submodules
Expand Down
16 changes: 0 additions & 16 deletions sdk/python/docs/source/feast.rst
Original file line number Diff line number Diff line change
Expand Up @@ -241,22 +241,6 @@ feast.proto\_json module
:undoc-members:
:show-inheritance:

feast.registry module
---------------------

.. automodule:: feast.registry
:members:
:undoc-members:
:show-inheritance:

feast.registry\_store module
----------------------------

.. automodule:: feast.registry_store
:members:
:undoc-members:
:show-inheritance:

feast.repo\_config module
-------------------------

Expand Down
Loading

0 comments on commit 2913c6d

Please sign in to comment.