Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ These tests create new temporary tables / datasets locally only, and they are cl

The services with containerized replacements currently implemented are:
- Datastore
- DynamoDB
- Redis

You can run `make test-python-integration-container` to run tests against the containerized versions of dependencies.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
from tests.integration.feature_repos.universal.online_store.datastore import (
DatastoreOnlineStoreCreator,
)
from tests.integration.feature_repos.universal.online_store.dynamodb import (
DynamoDBOnlineStoreCreator,
)
from tests.integration.feature_repos.universal.online_store.redis import (
RedisOnlineStoreCreator,
)
Expand Down Expand Up @@ -130,7 +133,10 @@

if os.getenv("FEAST_LOCAL_ONLINE_CONTAINER", "False").lower() == "true":
replacements = {"datastore": DatastoreOnlineStoreCreator}
replacement_dicts = [(REDIS_CONFIG, RedisOnlineStoreCreator)]
replacement_dicts = [
(REDIS_CONFIG, RedisOnlineStoreCreator),
(DYNAMO_CONFIG, DynamoDBOnlineStoreCreator),
]
for c in FULL_REPO_CONFIGS:
if isinstance(c.online_store, dict):
for _replacement in replacement_dicts:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from typing import Dict

from testcontainers.core.container import DockerContainer
from testcontainers.core.waiting_utils import wait_for_logs

from tests.integration.feature_repos.universal.online_store_creator import (
OnlineStoreCreator,
)


class DynamoDBOnlineStoreCreator(OnlineStoreCreator):
def __init__(self, project_name: str):
super().__init__(project_name)
self.container = DockerContainer(
"amazon/dynamodb-local:latest"
).with_exposed_ports("8000")

def create_online_store(self) -> Dict[str, str]:
self.container.start()
log_string_to_wait_for = (
"Initializing DynamoDB Local with the following configuration:"
)
wait_for_logs(
container=self.container, predicate=log_string_to_wait_for, timeout=5
)
exposed_port = self.container.get_exposed_port("8000")
return {
"type": "dynamodb",
"endpoint_url": f"http://localhost:{exposed_port}",
"region": "us-west-2",
}

def teardown(self):
self.container.stop()