Page MenuHomePhabricator

Package wmfmariadbpy as a .deb
Closed, ResolvedPublic

Description

Currently the wmfmariadb repo is used by manually checking it out on cumin hosts, and then running its scripts using sudo. This is very manual, messy, easy to get wrong (e.g. forgetting to update your checkout) etc. Instead wmfmariadbpy should be packaged for debian so that it can be cleanly installed/updated/maintained.

Event Timeline

Kormat triaged this task as Medium priority.Jul 28 2020, 12:49 PM

There are a number of scripts (i.e. executable python scripts) in this repo, but i'm not sure which ones are actively used or not:

I know these are used:

switchover.py
replication_tree.py

What about these others?

backup_mariadb.py
check_health.py
compare.py
mysql.py
sql.py

Marked as exectuable, but not actually scripts:

WMFMariaDB.py

So: these are definitely used:

compare.py
mysql.py
backup_mariadb.py
osc_host.py

My intention is to put backup_mariadb.py and its dependencies (remote execution, etc.) on a separate package (that is why I showed you the https://gerrit.wikimedia.org/r/c/operations/software/wmfmariadbpy/+/571528 CR so you were aware those should be treated separatedly -not asking you to do the work).

check_health.py is IIRC check_mariadb.py in development (it had to quickly be deployed/copied into puppet before being finished because of a read_only monitoring emergency). We can delete and use the one on puppet until we go back to work on it seriously? (manuel?)

sql.py was going to be a batch execution (sort of a cumin-like interface) for WMFMariaDB.py, but I don't think it is finished. There may be other unfinished stuff.

I recommend to skip packaging of things that are not in use/not finished following Manuel's directions (and mine for backup stuff 0:-D). Feel free to move the others out of away.

More context (not finished): https://gerrit.wikimedia.org/r/c/operations/software/wmfmariadbpy/+/449185

I tried to mention some of this on our meeting but you may have been too overwhelmed with information to process it. Feel free to setup another short meeting for more context if needed on your side.

I think the main issue here is there may be a point of having (in the future, not now) multiple packages for things that have to be deployed on cumin only (transfer py, mariadb remote access libraries) vs other utilities (check_health.py, backups) that may be installed elsewere (local db or backup hosts). I am going to guess you may only want one for cumin for now.

Let me go a bit overboard an propose you the following to be added to a potential wmfmariadbpy package- to be installed on cumin hosts:

  • Libraries: WMFMariaDB, WMFReplication (I believe switchover.py also depends on remotexecution stuff, which is now packaged as part of transfer.py, so we could just put it as a package dependency?)
  • Utilities: compare.py mysql.py osc_host.py switchover.py replication_tree.py move_replica.py stop_in_sync.py

(maybe it also would be nice to move manuel vert much liked ./section sh shell in here, which I think it is what you want to do next)

I will take care of packaging the backup stuff separately, as that won't be for cumin only.

BTW, this is duplicate of 3yo T165358 :-).

My intention is to put backup_mariadb.py and its dependencies (remote execution, etc.) on a separate package (that is why I showed you the https://gerrit.wikimedia.org/r/c/operations/software/wmfmariadbpy/+/571528 CR so you were aware those should be treated separatedly -not asking you to do the work).

check_health.py is IIRC check_mariadb.py in development (it had to quickly be deployed/copied into puppet before being finished because of a read_only monitoring emergency). We can delete and use the one on puppet until we go back to work on it seriously? (manuel?)

+1 to get rid check_health.py of or maybe make clear it is not ready for production use. The one we relay on is indeed check_mariadb.py

sql.py was going to be a batch execution (sort of a cumin-like interface) for WMFMariaDB.py, but I don't think it is finished. There may be other unfinished stuff.

I recommend to skip packaging of things that are not in use/not finished following Manuel's directions (and mine for backup stuff 0:-D). Feel free to move the others out of away.

Yeah, let's not package stuff we don't currently use. This is a good moment to get an inventory of what we really use, what we don't use anymore and what is deprecated (if anything).

Let me go a bit overboard an propose you the following to be added to a potential wmfmariadbpy package- to be installed on cumin hosts:

  • Libraries: WMFMariaDB, WMFReplication (I believe switchover.py also depends on remotexecution stuff, which is now packaged as part of transfer.py, so we could just put it as a package dependency?)
  • Utilities: compare.py mysql.py osc_host.py switchover.py replication_tree.py move_replica.py stop_in_sync.py

(maybe it also would be nice to move manuel vert much liked ./section sh shell in here, which I think it is what you want to do next)

Yeah, I think ./section is essential, especially for schema changes.

Change 616846 had a related patch set uploaded (by Kormat; owner: Kormat):
[operations/software/wmfmariadbpy@master] Create debian packages.

https://gerrit.wikimedia.org/r/616846

Change 616846 merged by jenkins-bot:
[operations/software/wmfmariadbpy@master] Create debian packages.

https://gerrit.wikimedia.org/r/616846

Change 618012 had a related patch set uploaded (by Kormat; owner: Kormat):
[operations/puppet@production] mariadb: Drop mysql.py in favour of wmfmariadbpy package

https://gerrit.wikimedia.org/r/618012

Mentioned in SAL (#wikimedia-operations) [2020-08-03T12:13:43Z] <kormat> disabling puppet on cumin hosts T259021

Change 618012 merged by Kormat:
[operations/puppet@production] mariadb: Drop mysql.py in favour of wmfmariadbpy package

https://gerrit.wikimedia.org/r/618012

Change 618052 had a related patch set uploaded (by Marostegui; owner: Marostegui):
[operations/software@master] section: Change mysql.py path

https://gerrit.wikimedia.org/r/618052

Change 618052 abandoned by Marostegui:
[operations/software@master] section: Change mysql.py path

Reason:

https://gerrit.wikimedia.org/r/618052

Change 618056 had a related patch set uploaded (by Marostegui; owner: Marostegui):
[operations/software@master] section: Do not hardcode mysql.py path

https://gerrit.wikimedia.org/r/618056

Change 618056 merged by jenkins-bot:
[operations/software@master] section: Do not hardcode mysql.py path

https://gerrit.wikimedia.org/r/618056

Change 618062 had a related patch set uploaded (by Marostegui; owner: Marostegui):
[operations/software@master] report_users: Remove mysql.py PATH

https://gerrit.wikimedia.org/r/618062

Kormat claimed this task.

wmfmariadbpy successfully deployed to cumin1001 and cumin2001 (and /usr/local/sbin/mysql.py deleted).

Change 618062 merged by jenkins-bot:
[operations/software@master] report_users: Remove mysql.py PATH

https://gerrit.wikimedia.org/r/618062