From 717de439597f76700a95040d8c3c0e6a4f807dd1 Mon Sep 17 00:00:00 2001 From: Dan Noble Date: Mon, 24 Jun 2024 12:16:13 -0400 Subject: [PATCH] Added redis cache layer for staging.datacommons.org (#4383) Note: after merging, update oncall docs with a step to clear redis after deploying to staging --- deploy/helm_charts/envs/staging.yaml | 9 +++++++++ server/app_env/staging.py | 1 - tools/clearcache/clear_staging.sh | 17 +++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100755 tools/clearcache/clear_staging.sh diff --git a/deploy/helm_charts/envs/staging.yaml b/deploy/helm_charts/envs/staging.yaml index b7ea931a90..112b00804d 100644 --- a/deploy/helm_charts/envs/staging.yaml +++ b/deploy/helm_charts/envs/staging.yaml @@ -27,6 +27,15 @@ website: flaskEnv: staging replicas: 6 enableModel: true + redis: + enabled: true + configFile: | + { + "us-central1": { + "host": "10.127.249.59", + "port": "6379" + } + } ingress: enabled: false diff --git a/server/app_env/staging.py b/server/app_env/staging.py index f5c1b59518..dafacb1dce 100644 --- a/server/app_env/staging.py +++ b/server/app_env/staging.py @@ -19,4 +19,3 @@ class Config(_base.Config): GA_ACCOUNT = 'G-HV2XYYS1JD' USE_LLM = True LOG_QUERY = True - USE_MEMCACHE = False diff --git a/tools/clearcache/clear_staging.sh b/tools/clearcache/clear_staging.sh new file mode 100755 index 0000000000..0e6a84b130 --- /dev/null +++ b/tools/clearcache/clear_staging.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +SCRIPT_PATH=`dirname $0` +$SCRIPT_PATH/run.sh datcom-website-staging website-us-central1 us-central1