Skip to content

Add performance testing workflow #1086

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

Merged
merged 2 commits into from
Feb 17, 2023
Merged

Conversation

rzats
Copy link
Contributor

@rzats rzats commented Feb 15, 2023

Prerequisites:

  • Unless it is a documentation hotfix it should be merged against the dev branch
  • Branch is up-to-date with the branch to be merged with, i.e. dev
  • Build is successful
  • Code is cleaned up and formatted

Summary

Implements an automatable system for on-demand stability tests based on the scalability-testing-rig PRD.

This first version of the testing rig launches a GitHub Actions runner off of a pull request based on a set comment (/run performance test) and, in order-

  • sets up WireGuard in order to access the staging Delphi database
  • clones the delphi-epidata repo, switching it to the pull request's branch
  • sets up an environment with various other repos similar to the install.sh script
  • builds and runs an instance of the epidata web server + API
  • runs Locust, a performance testing toolkit, targeting the local API we just created with a runtime of 15 minutes and 10 users spawning at a rate of 1 per second:
--users 10 --spawn-rate 1 --headless -t 15m
  • links to Locust's report (which is contained in stdout) by creating a comment on the original pull request.

IMPORTANT: a prerequisite for this to function is for several secrets to be added to the repository.

These are as follows - various WireGuard credentials needed to set up the connection:

WG_PERF_ENDPOINT
WG_PERF_ENDPOINT_PUBLIC_KEY
WG_PERF_IPS
WG_PERF_ALLOWED_IPS
WG_PERF_PRIVATE_KEY

and the staging database connection string, including username & password:

DB_CONN_STRING

Copy link
Collaborator

@melange396 melange396 left a comment

Choose a reason for hiding this comment

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

looks pretty cool! i had a couple little doc/naming things, but im mostly concerned with how much you might be able to take out of the repo cloning section. v4.py is a straight copy out of the admin repository, correct?

@rzats
Copy link
Contributor Author

rzats commented Feb 17, 2023

@melange396 applied the fixes!

v4.py and the sample of queries are both a copy from the private repo, yeah. We can also upload the larger query sample file to S3 or similar, and then download it in the GitHub Action; or git clone the private admin repo although this may run into issues with token permissions.

@rzats rzats requested a review from melange396 February 17, 2023 14:38
Copy link
Collaborator

@melange396 melange396 left a comment

Choose a reason for hiding this comment

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

looks good!

@melange396 melange396 merged commit 17652ce into dev Feb 17, 2023
@melange396 melange396 deleted the rzatserkovnyi/performance-testing-rig branch February 17, 2023 14:59
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