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

Analytics Database and Build Time Processor #594

Merged
merged 7 commits into from
Aug 31, 2023
Merged

Analytics Database and Build Time Processor #594

merged 7 commits into from
Aug 31, 2023

Conversation

jjnesbitt
Copy link
Collaborator

@jjnesbitt jjnesbitt commented Aug 14, 2023

This PR adds an analytics database, with which arbitrary data can be stored and queried from, as well as a build timing processor, which processes succeeded jobs and their respective phase timings. To accomplish this, several components have been added/configured:

  1. A terraform configuration to create the database
  2. A very small Django app (no website or server) to be used for model/table migration and management, located at analytics
  3. A build timing processor webhook listener, which mimics the structure of the gitlab-error-processor. This http server listens for received webhooks from gitlab, and dispatches a kubernetes job to run the upload_build_timings analytics management command.
  4. A staging kustomization to support this configuration in the staging cluster
  5. A github workflow for checking the django app migrations (fails if migrations need to be run).

Note: The Terraform changes are already applied to production and running correctly

@jjnesbitt jjnesbitt force-pushed the postgres-db branch 3 times, most recently from 671cbf1 to 4e6cbed Compare August 16, 2023 02:44
@jjnesbitt jjnesbitt force-pushed the postgres-db branch 15 times, most recently from 0d5b0e6 to 3eb27b8 Compare August 23, 2023 16:12
@jjnesbitt jjnesbitt marked this pull request as ready for review August 23, 2023 16:14
@jjnesbitt jjnesbitt force-pushed the postgres-db branch 13 times, most recently from f827986 to 4738cbd Compare August 31, 2023 17:03
- Rename Phase to TimerPhase
- Add constraints to Timer hash, name, and cache fields
- Add constraints to TimerPhase path and timer fields
- Update upload script to accommodate these changes
@jjnesbitt jjnesbitt force-pushed the postgres-db branch 2 times, most recently from a84e78d to 3dd088b Compare August 31, 2023 17:18
@jjnesbitt
Copy link
Collaborator Author

Okay, I've backed out all of the changes involving running migrations from the github workflow (will address in a follow up), and have just retained the very simple workflow of checking the migrations. So for the time being, if any migrations are made, they will need to be applied manually.

I've also backed out any changes that existed solely for testing, so this PR is ready to go.

Copy link
Collaborator

@scottwittenburg scottwittenburg left a comment

Choose a reason for hiding this comment

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

This is working for me, so I'm approving 😆 But it might make sense for @mvandenburgh to take a look from a kube/terraform perspective as well.

One question, well maybe with two parts: Will this just work when we merge Ryan's timing statistics PR and set up the webhook from spack/spack? Will there be a way to keep triggering it and testing from scott/pipeline-experiments at that point as well?

@jjnesbitt
Copy link
Collaborator Author

One question, well maybe with two parts: Will this just work when we merge Ryan's timing statistics PR and set up the webhook from spack/spack? Will there be a way to keep triggering it and testing from scott/pipeline-experiments at that point as well?

I believe the answer to both is yes. Flux should deploy the required services (might hiccup at first as the images will need to be built), and the webhook makes no distinction as to which project is invoking it.

Copy link
Member

@mvandenburgh mvandenburgh left a comment

Choose a reason for hiding this comment

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

I've been disconnected from the timing info stuff so I'll defer to Scott on the specifies of the DB schema and build processor server. But the Terraform for the database and k8s resources look good to me.

@jjnesbitt jjnesbitt merged commit 4ba65ed into main Aug 31, 2023
@danlamanna danlamanna deleted the postgres-db branch January 8, 2024 17:21
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.

4 participants