Skip to content

Commit

Permalink
Update Search API v2/Search Admin env and Redis
Browse files Browse the repository at this point in the history
- Set the new `DISCOVERY_ENGINE_DEFAULT_COLLECTION_NAME` environment
  variable for Search API v2 and Search Admin
- Remove the legacy Discovery Engine environment variables from Search
  Admin
- Replace the human-readable GCP project ID with the numeric form in all
  env vars for consistency (sadly _some_ API calls only accept the
  numeric form, so we might as well use it everywhere)
- Add a dedicated Redis instance for Search Admin (which will be using
  Sidekiq again)
  • Loading branch information
csutter committed Feb 6, 2025
1 parent 4edd9a2 commit 7120383
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
13 changes: 7 additions & 6 deletions projects/search-admin/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ services:
environment:
DATABASE_URL: "mysql2://root:root@mysql-8/search_admin_development"
TEST_DATABASE_URL: "mysql2://root:root@mysql-8/search_admin_test"
REDIS_URL: redis://redis
DISCOVERY_ENGINE_ENGINE: none
DISCOVERY_ENGINE_SERVING_CONFIG: none
REDIS_URL: redis://search-admin-redis
DISCOVERY_ENGINE_DEFAULT_COLLECTION_NAME: none

search-admin-app: &search-admin-app
<<: *search-admin-base
Expand All @@ -40,12 +39,14 @@ services:
environment:
DATABASE_URL: "mysql2://root:root@mysql-8/search_admin_development"
TEST_DATABASE_URL: "mysql2://root:root@mysql-8/search_admin_test"
REDIS_URL: redis://redis
REDIS_URL: redis://search-admin-redis
VIRTUAL_HOST: search-admin.dev.gov.uk
BINDING: 0.0.0.0
PORT: 3000
DISCOVERY_ENGINE_ENGINE: projects/search-api-v2-integration/locations/global/collections/default_collection/engines/govuk
DISCOVERY_ENGINE_SERVING_CONFIG: projects/search-api-v2-integration/locations/global/collections/default_collection/engines/govuk/servingConfigs/default_search
DISCOVERY_ENGINE_DEFAULT_COLLECTION_NAME: "projects/780375417592/locations/global/collections/default_collection"
expose:
- "3000"
command: bin/dev

search-admin-redis:
image: redis
18 changes: 10 additions & 8 deletions projects/search-api-v2/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ services:
GOOGLE_CLOUD_PROJECT_ID: none
DISCOVERY_ENGINE_DATASTORE: none
DISCOVERY_ENGINE_DATASTORE_BRANCH: none
DISCOVERY_ENGINE_DEFAULT_COLLECTION_NAME: none
DISCOVERY_ENGINE_SERVING_CONFIG: none

search-api-v2-app:
Expand All @@ -49,10 +50,11 @@ services:
# The fully qualified ID of the datastore, branch and engine on the Discovery Engine integration
# environment (required to use Discovery Engine locally).
#
GOOGLE_CLOUD_PROJECT_ID: "search-api-v2-integration"
DISCOVERY_ENGINE_DATASTORE: "projects/search-api-v2-integration/locations/global/collections/default_collection/dataStores/govuk_content"
DISCOVERY_ENGINE_DATASTORE_BRANCH: "projects/search-api-v2-integration/locations/global/collections/default_collection/dataStores/govuk_content/branches/default_branch"
DISCOVERY_ENGINE_SERVING_CONFIG: "projects/search-api-v2-integration/locations/global/collections/default_collection/dataStores/govuk_content/servingConfigs/default_search"
GOOGLE_CLOUD_PROJECT_ID: "780375417592"
DISCOVERY_ENGINE_DATASTORE: "projects/780375417592/locations/global/collections/default_collection/dataStores/govuk_content"
DISCOVERY_ENGINE_DATASTORE_BRANCH: "projects/780375417592/locations/global/collections/default_collection/dataStores/govuk_content/branches/default_branch"
DISCOVERY_ENGINE_DEFAULT_COLLECTION_NAME: "projects/780375417592/locations/global/collections/default_collection"
DISCOVERY_ENGINE_SERVING_CONFIG: "projects/780375417592/locations/global/collections/default_collection/dataStores/govuk_content/servingConfigs/default_search"
expose:
- "3000"
command: bin/rails server --restart
Expand All @@ -69,10 +71,10 @@ services:
# The fully qualified ID of the datastore, branch and serving config on the Discovery Engine
# integration environment (required to use Discovery Engine locally).
#
GOOGLE_CLOUD_PROJECT_ID: "search-api-v2-integration"
DISCOVERY_ENGINE_DATASTORE: "projects/search-api-v2-integration/locations/global/collections/default_collection/dataStores/govuk_content"
DISCOVERY_ENGINE_DATASTORE_BRANCH: "projects/search-api-v2-integration/locations/global/collections/default_collection/dataStores/govuk_content/branches/default_branch"
DISCOVERY_ENGINE_SERVING_CONFIG: "projects/search-api-v2-integration/locations/global/collections/default_collection/dataStores/govuk_content/servingConfigs/default_search"
GOOGLE_CLOUD_PROJECT_ID: "780375417592"
DISCOVERY_ENGINE_DATASTORE: "projects/780375417592/locations/global/collections/default_collection/dataStores/govuk_content"
DISCOVERY_ENGINE_DATASTORE_BRANCH: "projects/780375417592/locations/global/collections/default_collection/dataStores/govuk_content/branches/default_branch"
DISCOVERY_ENGINE_SERVING_CONFIG: "projects/780375417592/locations/global/collections/default_collection/dataStores/govuk_content/servingConfigs/default_search"
command: bin/rake document_sync_worker:run

search-api-v2-redis:
Expand Down

0 comments on commit 7120383

Please sign in to comment.