Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken rich search module #2297

Merged
merged 5 commits into from
Feb 23, 2023
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
7 changes: 6 additions & 1 deletion server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
from server.lib.disaster_dashboard import get_disaster_dashboard_data
import server.lib.i18n as i18n
import server.lib.util as libutil
import server.services.ai as ai
from server.services.discovery import configure_endpoints_from_ingress
from server.services.discovery import get_health_check_urls

Expand Down Expand Up @@ -288,7 +289,11 @@ def create_app():
app.config['BABEL_DEFAULT_LOCALE'] = i18n.DEFAULT_LOCALE
app.config['BABEL_TRANSLATION_DIRECTORIES'] = 'i18n'

# Initialize the AI module.
# Enable the AI module.
if cfg.ENABLE_AI:
app.config['AI_CONTEXT'] = ai.Context()

# # Enable the NL model.
if os.environ.get('ENABLE_MODEL') == 'true':
libutil.check_backend_ready([app.config['NL_ROOT'] + '/healthz'])
# Some specific imports for the NL Interface.
Expand Down
1 change: 1 addition & 0 deletions server/app_env/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class Config:
os.environ.get('MIXER_HASH'))
API_ROOT = 'http://127.0.0.1:8081' # Port for Kubernetes ESP.
NL_ROOT = 'http://127.0.0.1:6060' # Port for Kubernetes ESP.
ENABLE_AI = False
AI_CONFIG_PATH = '/datacommons/ai/ai.yaml'
SECRET_PROJECT = os.environ.get('SECRET_PROJECT') or ''
MAPS_API_KEY = os.environ.get('MAPS_API_KEY') or ''
Expand Down
1 change: 1 addition & 0 deletions server/app_env/autopush.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
class Config(_base.Config):
GA_ACCOUNT = 'G-Y6ZXZ9JK3H'
GCS_BUCKET = 'datcom-website-autopush-resources'
ENABLE_AI = True
LOG_QUERY = True
2 changes: 1 addition & 1 deletion server/app_env/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Config(_base.Config):
API_ROOT = 'https://autopush.api.datacommons.org'
API_PROJECT = 'datcom-mixer-autopush'
AI_CONFIG_PATH = os.path.abspath(
os.path.join(os.path.curdir, '..', 'deploy/overlays/local/ai.yaml'))
os.path.join(os.path.curdir, 'deploy/overlays/local/ai.yaml'))
SCHEME = 'http'
GCS_BUCKET = 'datcom-website-autopush-resources'
LOG_QUERY = True
Expand Down