Skip to content

Commit

Permalink
Add additional store
Browse files Browse the repository at this point in the history
  • Loading branch information
samdealy committed Mar 17, 2023
1 parent 2bb14a9 commit 32808ae
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions tools/fog-local-network/fog_conformance_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ def __init__(self, work_dir, args):
self.fog_ingest2 = None
self.fog_view_router = None
# TODO: Add more fog view instances with sharding.
self.fog_view_store = None
self.fog_view_stores = None
self.fog_ledger = None
self.fog_report = None
self.multi_balance_checker = None
Expand Down Expand Up @@ -478,15 +478,25 @@ def run(self, args):
)
self.fog_ingest.start()

self.fog_view_store = FogViewStore(
fog_view_store_1 = FogViewStore(
name = 'view1',
client_port = BASE_VIEW_STORE_PORT,
admin_port = BASE_VIEW_STORE_ADMIN_PORT,
admin_http_gateway_port = BASE_VIEW_STORE_ADMIN_HTTP_GATEWAY_PORT,
release = self.release,
sharding_strategy= 'default'
sharding_strategy= '0-6'
)
self.fog_view_store.start()
fog_view_store_2 = FogViewStore(
name = 'view1',
client_port = BASE_VIEW_STORE_PORT,
admin_port = BASE_VIEW_STORE_ADMIN_PORT,
admin_http_gateway_port = BASE_VIEW_STORE_ADMIN_HTTP_GATEWAY_PORT,
release = self.release,
sharding_strategy= '5-12'
)
self.fog_view_stores = [fog_view_store_1, fog_view_store_2]
for store in self.fog_view_stores:
store.start()

self.fog_view_router = FogViewRouter(
name = 'router1',
Expand All @@ -495,7 +505,7 @@ def run(self, args):
admin_port = BASE_VIEW_ADMIN_PORT,
admin_http_gateway_port = BASE_VIEW_ADMIN_HTTP_GATEWAY_PORT,
release = self.release,
shard_uris = [self.fog_view_store.get_client_listen_uri()],
shard_uris = map(lambda x: x.get_client_listen_uri(), self.fog_view_stores)
)
self.fog_view_router.start()

Expand Down Expand Up @@ -911,9 +921,9 @@ def run(self, args):
#######################################################################

# Restarting the view store should not impact things.
print("Restarting fog view store")
self.fog_view_store.stop()
self.fog_view_store.start()
print("Restarting fog view store 1")
self.fog_view_stores[0].stop()
self.fog_view_stores[0].start()
time.sleep(10 if self.release else 30)

# We will encounter 0: 0 while we wait for the view server to come up.
Expand Down Expand Up @@ -1038,8 +1048,8 @@ def stop(self):
if self.fog_view_router:
self.fog_view_router.stop()

if self.fog_view_store:
self.fog_view_store.stop()
for store in self.fog_view_stores:
store.stop()

if self.fog_ingest:
self.fog_ingest.stop()
Expand Down

0 comments on commit 32808ae

Please sign in to comment.