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

Further configuration for search-api-v2 #696

Merged
merged 1 commit into from
Nov 1, 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
9 changes: 9 additions & 0 deletions projects/finder-frontend/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ services:
- "3000"
command: bin/rails s --restart

finder-frontend-search-v2: &finder-frontend-search-v2
<<: *finder-frontend-app
environment:
PLEK_SERVICE_SEARCH_API_URI: http://search-api-v2-app:3000
GOVUK_PROXY_STATIC_ENABLED: "true"
VIRTUAL_HOST: finder-frontend.dev.gov.uk
BINDING: 0.0.0.0
MEMCACHE_SERVERS: memcached

finder-frontend-app-live:
<<: *finder-frontend-app
depends_on:
Expand Down
7 changes: 7 additions & 0 deletions projects/search-api-v2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ define SEARCH_API_V2_WARN_DATASTORE
otherwise the app will not be able to access Discovery Engine. See the README for details.\033[0m
endef

define SEARCH_API_V2_WARN_SERVING_CONFIG
\033[1;31mWarning: DISCOVERY_ENGINE_SERVING_CONFIG environment variable is not set.\
\n\033[0;31mYou need to set this environment variable locally before running govuk-docker up,\
otherwise the app will not be able to access Discovery Engine. See the README for details.\033[0m
endef

prerequisites-search-api-v2:
@command -v gcloud >/dev/null 2>&1 || { echo "$(SEARCH_API_V2_WARN_GCLOUD)"; }
@[ -n "$${DISCOVERY_ENGINE_DATASTORE}" ] || { echo "$(SEARCH_API_V2_WARN_DATASTORE)"; }
@[ -n "$${DISCOVERY_ENGINE_SERVING_CONFIG}" ] || { echo "$(SEARCH_API_V2_WARN_SERVING_CONFIG)"; }
28 changes: 19 additions & 9 deletions projects/search-api-v2/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,19 @@ services:
environment:
RABBITMQ_URL: "amqp://guest:guest@rabbitmq"
PUBLISHED_DOCUMENTS_MESSAGE_QUEUE_NAME: "search_api_v2_published_documents"
RAILS_DEVELOPMENT_HOSTS: "search-api-v2.dev.gov.uk"
RAILS_DEVELOPMENT_HOSTS: "search-api-v2.dev.gov.uk,search-api-v2-app"
VIRTUAL_HOST: "search-api-v2.dev.gov.uk"
BINDING: "0.0.0.0"
# The fully qualified ID of the datastore on Discovery Engine (required to use Discovery
# Engine locally, can be set on `govuk-docker up` invocation or permanently in your local
# environment)
# e.g. "projects/search-api-v2-dev/locations/global/collections/default_collection/dataStores/local-my-name"
# The fully qualified ID of the datastore and engine on the Discovery Engine dev environment
# (required to use Discovery Engine locally, can be set on `govuk-docker up` invocation or
# permanently in your local environment).
#
# e.g. "projects/search-api-v2-dev/locations/global/collections/default_collection/dataStores/
# local-my-name"
DISCOVERY_ENGINE_DATASTORE: "${DISCOVERY_ENGINE_DATASTORE}"
# e.g. "projects/search-api-v2-dev/locations/global/collections/default_collection/dataStores/
# local-my-name/servingConfigs/default_serving_config"
DISCOVERY_ENGINE_SERVING_CONFIG: "${DISCOVERY_ENGINE_SERVING_CONFIG}"
expose:
- "3000"
command: bin/rails server --restart
Expand All @@ -54,9 +59,14 @@ services:
environment:
RABBITMQ_URL: "amqp://guest:guest@rabbitmq"
PUBLISHED_DOCUMENTS_MESSAGE_QUEUE_NAME: "search_api_v2_published_documents"
# The fully qualified ID of the datastore on Discovery Engine (required to use Discovery
# Engine locally, can be set on `govuk-docker up` invocation or permanently in your local
# environment)
# e.g. "projects/search-api-v2-dev/locations/global/collections/default_collection/dataStores/local-my-name"
# The fully qualified ID of the datastore and serving config on the Discovery Engine dev
# environment (required to use Discovery Engine locally, can be set on `govuk-docker up`
# invocation or permanently in your local environment).
#
# e.g. "projects/search-api-v2-dev/locations/global/collections/default_collection/dataStores/
# local-my-name"
DISCOVERY_ENGINE_DATASTORE: "${DISCOVERY_ENGINE_DATASTORE}"
# e.g. "projects/search-api-v2-dev/locations/global/collections/default_collection/dataStores/
# local-my-name/servingConfigs/default_serving_config"
DISCOVERY_ENGINE_SERVING_CONFIG: "${DISCOVERY_ENGINE_SERVING_CONFIG}"
command: bin/rake document_sync_worker:run