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

Hardcode discovery engine environment variables in search-api-v2 #712

Merged
merged 1 commit into from
Jan 5, 2024

Conversation

leenagupte
Copy link
Contributor

We've decided it's easier for the local setup of search-api-v2 to pull in search results from integration whenever search results are needed for local testing rather than making everyone set up their own personal discovery engine on gcloud. Therefore the env var values can be hardcoded rather than being set in the local session.

Copy link
Contributor

@csutter csutter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

# 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}"
DISCOVERY_ENGINE_DATASTORE_BRANCH: "projects/780375417592/locations/global/collections/default_collection/dataStores/govuk_content/branches/default_branch"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Come to think of it, it'll look more readable if we use the "pretty" GCP project name (search-api-v2-integration) instead of the numeric one for both of these 🎁

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we can use "projects/search-api-v2-integration/locations/global/collections/default_collection/dataStores/govuk_content/branches/default_branch"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@csutter I've updated to use the pretty name.

We've decided it's easier for the local setup of search-api-v2 to pull
in search results from integration whenever search results are needed
for local testing rather than making everyone set up their own personal
discovery engine on gcloud. Therefore the env var values can be
hardcoded rather than being set in the local session.
@leenagupte leenagupte force-pushed the add-search-api-v2-env-vars branch from f1c8917 to 9f46ef2 Compare January 5, 2024 15:54
@leenagupte leenagupte merged commit 474dd0f into main Jan 5, 2024
2 checks passed
@leenagupte leenagupte deleted the add-search-api-v2-env-vars branch January 5, 2024 15:56
csutter added a commit that referenced this pull request Jul 4, 2024
We are about to start some work that hooks Search Admin up to Discovery
Engine (aka Google Vertex AI Search), so we need to:
- Mount the `gcloud` tool config directory into the container (which
  allows the Google Cloud gem(s) to pick up on locally configured
  credentials)
- Set appropriate environment variables for the engine and serving
  config that the app should use locally (`integration` as we no longer
  have a separate dev environment)

These changes are analogous to the ones made in #695 and #712 for
`search-api-v2`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants