Skip to content

Commit

Permalink
Fix broken rich search module (#2297)
Browse files Browse the repository at this point in the history
Enable this in autopush for now
  • Loading branch information
shifucun authored Feb 23, 2023
1 parent 71df9b0 commit b9721f5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
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

0 comments on commit b9721f5

Please sign in to comment.