Skip to content

Commit

Permalink
dataroot_dict and sserver
Browse files Browse the repository at this point in the history
  • Loading branch information
Bento007 committed Nov 17, 2022
1 parent 9cf6bec commit 0f1e811
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
3 changes: 1 addition & 2 deletions server/app/api/v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@ def register_api_v3(app, app_config, api_url_prefix):
# NOTE: These routes only allow the dataset to be in the directory
# of the dataroot, and not a subdirectory. We may want to change
# the route format at some point
for dataroot in app_config.server__multi_dataset__dataroots.values():
dataroot_dict = dataroot
for dataroot_dict in app_config.server__multi_dataset__dataroots.values():
url_dataroot = dataroot_dict["base_url"]
bp_dataroot = Blueprint(
name=f"api_dataset_{url_dataroot}_{api_version.replace('.',',')}",
Expand Down
8 changes: 3 additions & 5 deletions server/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,10 @@ def dataroot_test_index():

datasets = []
for dataroot_dict in config.server__multi_dataset__dataroot.values():
dataroot = dataroot_dict["dataroot"]
url_dataroot = dataroot_dict["base_url"]
locator = DataLocator(dataroot, region_name=config.server__data_locator__s3_region_name)
locator = DataLocator(dataroot_dict, region_name=config.server__data_locator__s3_region_name)
for fname in locator.ls():
location = path_join(dataroot, fname)
location = path_join(dataroot_dict, fname)
try:
DataLoader(location, app_config=config)
datasets.append((url_dataroot, fname))
Expand Down Expand Up @@ -183,8 +182,7 @@ def __init__(self, app_config):
# NOTE: These routes only allow the dataset to be in the directory
# of the dataroot, and not a subdirectory. We may want to change
# the route format at some point
for dataroot in app_config.server__multi_dataset__dataroots.values():
dataroot_dict = dataroot
for dataroot_dict in app_config.server__multi_dataset__dataroots.values():
url_dataroot = dataroot_dict["base_url"]
self.app.add_url_rule(
f"/{url_dataroot}/<string:dataset>/",
Expand Down
2 changes: 1 addition & 1 deletion server/cli/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def launch(
# Those will override the ones provided in the config file (if provided).
updates = dict(
server__app__verbose=verbose,
sserver__app__debug=debug,
server__app__debug=debug,
server__app__host=host,
server__app__port=port,
server__app__open_browser=open_browser,
Expand Down

0 comments on commit 0f1e811

Please sign in to comment.