Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
9e0e7c7
Add support for DynamoDB and S3 registry
leonid133 Apr 27, 2021
44aadd8
rcu and wcu as a parameter of dynamodb online store
leonid133 Apr 27, 2021
6383791
fix linter
leonid133 May 4, 2021
73ff67a
aws dependency to extras
leonid133 May 18, 2021
aa6d0da
FEAST_S3_ENDPOINT_URL
leonid133 May 18, 2021
0a87050
tests
leonid133 May 18, 2021
3b8bb31
merge from master
leonid133 May 18, 2021
00e8675
fix signature, after merge
leonid133 May 18, 2021
6a99cd9
aws default region name configurable
leonid133 May 18, 2021
32dc799
merge from master
leonid133 Jun 11, 2021
db616c4
add offlinestore config type to test
leonid133 Jun 11, 2021
8dcbd5a
review changes
leonid133 Jun 11, 2021
fee93dd
merge from master
leonid133 Jun 18, 2021
2bbe268
Merge branch 'master' of https://github.com/feast-dev/feast into feat…
leonid133 Jun 18, 2021
5d33a79
Merge branch 'master' of https://github.com/feast-dev/feast into feat…
leonid133 Jun 18, 2021
24c44ee
merge latest from master
leonid133 Jun 23, 2021
7b99cde
review requested changes
leonid133 Jun 23, 2021
3a985b0
integration test for Dynamo
leonid133 Jun 23, 2021
6973581
change the rest of table_name to table_instance (where table_name is …
leonid133 Jun 28, 2021
e928424
fix DynamoDBOnlineStore commit
leonid133 Jun 28, 2021
59d7e4c
move client to _initialize_dynamodb
leonid133 Jun 28, 2021
594b932
rename document_id to entity_id and Row to entity_id
leonid133 Jun 28, 2021
15a787c
The default value is None
leonid133 Jun 28, 2021
7eaa654
Remove Datastore from the docstring.
leonid133 Jun 28, 2021
1468117
get rid of the return call from S3RegistryStore
leonid133 Jun 28, 2021
5dbe429
merge two exceptions
leonid133 Jun 29, 2021
986d45e
For ci requirement
leonid133 Jun 29, 2021
79d85c7
remove configuration from test
leonid133 Jun 29, 2021
f50b2fb
feast-integration-tests for tests
leonid133 Jun 29, 2021
509c521
change test path
leonid133 Jun 29, 2021
cd67973
add fixture feature_store_with_s3_registry to test
leonid133 Jun 29, 2021
5466d20
merge from master
leonid133 Jun 29, 2021
3d1b78c
region required
leonid133 Jun 29, 2021
ff8d635
Merge branch 'master' of https://github.com/feast-dev/feast into feat…
leonid133 Jun 29, 2021
57a607c
Address the rest of the comments
Jul 2, 2021
e9422ea
Merge branch 'master' into feature/online_dynamodb
Jul 2, 2021
3cd9597
Update to_table to to_arrow
Jul 2, 2021
124b337
Merge branch 'master' into feature/online_dynamodb
Jul 3, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
merge from master
Signed-off-by: lblokhin <lenin133@yandex.ru>
  • Loading branch information
leonid133 committed Jun 11, 2021
commit 32dc7994ba8fce4e8a2efb7cdf4abe426d2da84f
4 changes: 4 additions & 0 deletions sdk/python/feast/infra/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ def get_provider(config: RepoConfig, repo_path: Path) -> Provider:
from feast.infra.gcp import GcpProvider

return GcpProvider(config)
elif config.provider == "redis":
from feast.infra.redis import RedisProvider

return RedisProvider(config)
elif config.provider == "aws_dynamodb":
from feast.infra.aws_dynamodb_provider import AwsDynamodbProvider

Expand Down
142 changes: 114 additions & 28 deletions sdk/python/feast/repo_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,32 @@ class DatastoreOnlineStoreConfig(FeastBaseModel):
namespace: Optional[StrictStr] = None
""" (optional) Datastore namespace """

write_concurrency: Optional[PositiveInt] = 40
""" (optional) Amount of threads to use when writing batches of feature rows into Datastore"""

write_batch_size: Optional[PositiveInt] = 50
""" (optional) Amount of feature rows per batch being written into Datastore"""


class RedisType(str, Enum):
redis = "redis"
redis_cluster = "redis_cluster"


class RedisOnlineStoreConfig(FeastBaseModel):
"""Online store config for Redis store"""

type: Literal["redis"] = "redis"
"""Online store type selector"""

redis_type: RedisType = RedisType.redis
"""Redis type: redis or redis_cluster"""

connection_string: StrictStr = "localhost:6379"
"""Connection string containing the host, port, and configuration parameters for Redis
format: host:port,parameter1,parameter2 eg. redis:6379,db=0 """


class DynamoDbOnlineStoreConfig(FeastBaseModel):
"""Online store config for DynamoDB store"""

Expand All @@ -63,9 +89,28 @@ class DynamoDbOnlineStoreConfig(FeastBaseModel):


OnlineStoreConfig = Union[
DatastoreOnlineStoreConfig, SqliteOnlineStoreConfig, DynamoDbOnlineStoreConfig
DatastoreOnlineStoreConfig, SqliteOnlineStoreConfig, RedisOnlineStoreConfig, DynamoDbOnlineStoreConfig
]

class FileOfflineStoreConfig(FeastBaseModel):
""" Offline store config for local (file-based) store """

type: Literal["file"] = "file"
""" Offline store type selector"""


class BigQueryOfflineStoreConfig(FeastBaseModel):
""" Offline store config for GCP BigQuery """

type: Literal["bigquery"] = "bigquery"
""" Offline store type selector"""

dataset: Optional[StrictStr] = "feast"
""" (optional) BigQuery Dataset name for temporary tables """


OfflineStoreConfig = Union[FileOfflineStoreConfig, BigQueryOfflineStoreConfig]


class RegistryConfig(FeastBaseModel):
""" Metadata Store Configuration. Configuration that relates to reading from and writing to the Feast registry."""
Expand Down Expand Up @@ -93,7 +138,7 @@ class RepoConfig(FeastBaseModel):
"""

provider: StrictStr
""" str: local or gcp or aws_dynamodb """
""" str: local or gcp or redis or aws_dynamodb """

online_store: OnlineStoreConfig = SqliteOnlineStoreConfig()
""" OnlineStoreConfig: Online store configuration (optional depending on provider) """
Expand Down Expand Up @@ -127,32 +172,73 @@ def _validate_online_store_config(cls, values):
# Make sure that the provider configuration is set. We need it to set the defaults
assert "provider" in values

if "online_store" in values:
# Set the default type
if "type" not in values["online_store"]:
if values["provider"] == "local":
values["online_store"]["type"] = "sqlite"
elif values["provider"] == "gcp":
values["online_store"]["type"] = "datastore"
elif values["provider"] == "aws_dynamodb":
values["online_store"]["type"] = "dynamodb"
online_store_type = values["online_store"]["type"]
# Make sure the user hasn't provided the wrong type
assert online_store_type in ["datastore", "sqlite", "dynamodb"]

# Validate the dict to ensure one of the union types match
try:
if online_store_type == "sqlite":
SqliteOnlineStoreConfig(**values["online_store"])
elif online_store_type == "datastore":
DatastoreOnlineStoreConfig(**values["online_store"])
elif online_store_type == "dynamodb":
DynamoDbOnlineStoreConfig(**values["online_store"])
else:
raise ValidationError(
f"Invalid online store type {online_store_type}"
)
except ValidationError as e:
# Set the default type
if "type" not in values["online_store"]:
if values["provider"] == "local":
values["online_store"]["type"] = "sqlite"
elif values["provider"] == "gcp":
values["online_store"]["type"] = "datastore"
elif values["provider"] == "redis":
values["online_store"]["type"] = "redis"
elif values["provider"] == "aws_dynamodb":
values["online_store"]["type"] = "dynamodb"

online_store_type = values["online_store"]["type"]

# Make sure the user hasn't provided the wrong type
assert online_store_type in ["datastore", "sqlite", "redis", "dynamodb"]

# Validate the dict to ensure one of the union types match
try:
if online_store_type == "sqlite":
SqliteOnlineStoreConfig(**values["online_store"])
elif online_store_type == "datastore":
DatastoreOnlineStoreConfig(**values["online_store"])
elif online_store_type == "redis":
RedisOnlineStoreConfig(**values["online_store"])
elif online_store_type == "dynamodb":
DynamoDbOnlineStoreConfig(**values["online_store"])
else:
raise ValueError(f"Invalid online store type {online_store_type}")
except ValidationError as e:
raise ValidationError(
[ErrorWrapper(e, loc="online_store")], model=SqliteOnlineStoreConfig,
)

return values

@root_validator(pre=True)
def _validate_offline_store_config(cls, values):
# Set empty offline_store config if it isn't set explicitly
if "offline_store" not in values:
values["offline_store"] = dict()

# Skip if we aren't creating the configuration from a dict
if not isinstance(values["offline_store"], Dict):
return values

# Make sure that the provider configuration is set. We need it to set the defaults
assert "provider" in values

# Set the default type
if "type" not in values["offline_store"]:
if values["provider"] == "local" or values["provider"] == "redis":
values["offline_store"]["type"] = "file"
elif values["provider"] == "gcp":
values["offline_store"]["type"] = "bigquery"

offline_store_type = values["offline_store"]["type"]

# Make sure the user hasn't provided the wrong type
assert offline_store_type in ["file", "bigquery"]

# Validate the dict to ensure one of the union types match
try:
if offline_store_type == "file":
FileOfflineStoreConfig(**values["offline_store"])
elif offline_store_type == "bigquery":
BigQueryOfflineStoreConfig(**values["offline_store"])
else:
raise ValidationError(
f"Invalid offline store type {offline_store_type}"
)
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.