Page MenuHomePhabricator

Create testing environment for db automation
Open, MediumPublic

Description

We have a test host (db1077), and we're planning to get another one, so we can at least have 1 master + 1 slave, which is useful for load-testing, debugging, and some very basic testing. But we currently have no good way of testing certain kinds of things:

  1. master swaps
  2. puppet changes
  3. automated reimaging
  4. automated provisioning
  5. a new tool like Orchestrator (for anything which involves changing state in our clusters)

Proposal:
Create a Cloud VPS project for testing database automation. This would use Pontoon to minimize differences to the production puppet environment.

This would contain a puppetmaster (for pontoon), a zarcillo instance, maybe a tendril instance, and a bunch of small db VMs. We'd use some dummy data sets for the databases, and have replication set up in a way that's similar to production. This would allow testing (almost) all of the above in a similar environment to how it would work in production. The exception would be auto-provisioning (which we don't currently have, in any case), where we might need to put one of our fake databases into the backup infra so we can restore it from there.

Ideally this would be fairly lightweight to run, and ~fully automated, so that if necessary the entire env can be torn down and brought back up fresh without much manual time or intervention needed.

Event Timeline

I like the idea of having a "pre" testing environment.
We usually test with codfw (when we are relatively confident) but I can see a benefit of having a "pre" codfw testing environment where we don't have to worry about real data and all that.
We wouldn't be able to test stuff that might require FW rules as those would different, but I think we can live with that.

For the db provisioning you might want to take a look at https://github.com/datacharmer/dbdeployer which is a well known and widely used tool to play around with mysql instances, topologies, versions and so forth.

Kormat triaged this task as Medium priority.Jul 27 2020, 1:46 PM

Status update:

  • We have a pontoon env running in the mariadb104-test cloud VPS project.
  • We have these nodes:
    • puppetmaster
    • puppetdb
    • cumin
    • 4x db nodes managed by puppet
    • 1x unmanaged db node, running Orchestrator
  • We can test most of wmfmariadbpy in this env. It has already caught a significant bug (T260127: switchover.py breaks on 10.4 master) and was used to test the fix.

@Kormat can this task be considered complete? The testing environment is already done, or there're bits pending?

I was thinking that it could do with a bit of documentation, and right now we can't test things like transferpy in it (because those puppet roles are disabled in our pontoon env). I'd like to address both those things before saying this is done.

Ladsgroup subscribed.

I have done a similar thing for mailman and maintain around 14 more projects in cloud VPS. Let me know if you need any help.