-
Notifications
You must be signed in to change notification settings - Fork 0
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
Implement user event import from Bigquery #351
Conversation
bf7626d
to
9de4f1a
Compare
This adds two scheduled tasks to run the two user events import Rake tasks, in integration only for now to verify it all works properly. These will eventually replace the following GCP Cloud Scheduler runs: https://github.com/alphagov/search-v2-infrastructure/blob/main/terraform/environment/events_ingestion.tf#L366-L484 See alphagov/search-api-v2#351
Nice one. Code looks good to me. 👍 Is the idea that each day we'll run the rake task for the intraday events multiple times a day (using |
Rewrite the existing Python Google Cloud function as a Ruby service class. This receives an event type and a date, and makes the necessary request to Discovery Engine to import BigQuery user event data. - Add `DiscoveryEngine::UserEvents::Import` service to implement importing of user events from BigQuery along the lines of the original Python code - Add `GOOGLE_CLOUD_PROJECT_ID` app configuration - Add a rake task to call the service - Ensure tests `require` Google API namespace for stubbing see the `vertex_events_push` function on the infrastructure repo: https://github.com/alphagov/search-v2-infrastructure/blob/2991588b5dae11a20fc80432393fd134c7acb53c/terraform/environment/files/vertex_events_push/main.py Co-Authored-By: Chae Cramb <[email protected]>
9de4f1a
to
85eafe4
Compare
Spot on – I've already drafted scheduled tasks for this in integration: https://github.com/alphagov/govuk-helm-charts/pull/2803/files And then there is a third Rake task for a specific date which is something that has occasionally come up as a manual task that needs doing (for example, if the import fails for some reason). This way someone can manually execute the Rake task in an environment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lovely stuff
This adds two scheduled tasks to run the two user events import Rake tasks. It has already been deployed and tested in integration. These replace the following GCP Cloud Scheduler runs: https://github.com/alphagov/search-v2-infrastructure/blob/main/terraform/environment/events_ingestion.tf#L366-L484 See alphagov/search-api-v2#351
This adds two scheduled tasks to run the two user events import Rake tasks. It has already been deployed and tested in integration. These replace the following GCP Cloud Scheduler runs: [https://github.com/alphagov/search-v2-infrastructure/blob/main/terraform/environment/events_ingestion.tf#L366-L484](https://github.com/alphagov/search-v2-infrastructure/blob/main/terraform/environment/events_ingestion.tf#L366-L484) See [alphagov/search-api-v2#351](alphagov/search-api-v2#351)
This adds two scheduled tasks to run the two user events import Rake tasks. It has already been deployed and tested in integration. These replace the following GCP Cloud Scheduler runs: https://github.com/alphagov/search-v2-infrastructure/blob/main/terraform/environment/events_ingestion.tf#L366-L484 See alphagov/search-api-v2#351
This adds two scheduled tasks to run the two user events import Rake tasks. It has already been deployed and tested in integration. These replace the following GCP Cloud Scheduler runs: https://github.com/alphagov/search-v2-infrastructure/blob/main/terraform/environment/events_ingestion.tf#L366-L484 See alphagov/search-api-v2#351
The functionality of these Google Cloud Functions has been integrated directly into the Search API repo via two rake tasks alphagov/search-api-v2#351.
The functionality of these Google Cloud Functions has been integrated directly into the Search API repo via two rake tasks alphagov/search-api-v2#351.
The functionality of this Google Cloud Function has been integrated directly into the Search API repo via two rake tasks alphagov/search-api-v2#351. This commit removes the function itself and related Terraform scheduling.
Rewrite the existing Python Google Cloud function as a Ruby service class. This receives an event type and a date, and makes the necessary request to Discovery Engine to import BigQuery user event data.
DiscoveryEngine::UserEvents::Import
service to implement importing of user events from BigQuery along the lines of the original Python codeGOOGLE_CLOUD_PROJECT_ID
app configurationrequire
Google API namespace for stubbingsee the
vertex_events_push
function on the infrastructure repo: https://github.com/alphagov/search-v2-infrastructure/blob/2991588b5dae11a20fc80432393fd134c7acb53c/terraform/environment/files/vertex_events_push/main.py