We need to puppetize or package the zuul-clear-refs.py script https://review.openstack.org/#/c/109276/
Description
Details
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | hashar | T70480 Scale merge operations (tracking) | |||
Resolved | hashar | T70481 Zuul repositories have too many refs causing slow updates | |||
Declined | None | T103528 Run zuul-clear-refs.py daily on all our repositories to reclaim Zuul references | |||
Resolved | hashar | T103529 Package / puppetize zuul-clear-refs.py | |||
Resolved | elukey | T145057 Upgrade Zuul on scandium.eqiad.wmnet (Jessie zuul-merger) |
Event Timeline
The patch I have proposed upstream has been approved :-} https://review.openstack.org/#/c/109276/
http://docs.openstack.org/infra/zuul/merger.html#clearing-old-references
The references created under refs/zuul are not garbage collected. Since git fetch send them all to Gerrit to sync the repositories, the time spent on merge will slightly grow overtime and start being noticeable.
To clean them you can use the tools/zuul-clear-refs.py script on each repositories. It will delete Zuul references that point to commits for which the commit date is older than a given amount of days (default 360):
We would want to include the utility in the Zuul Debian package.
"Just" have to figure out a way to have the debian package to copy /tools/zuul-clear-refs.py to /usr/bin/zuul-clear-refs. Should be fairly good first task.
I have included the script in our Debian package for Precise which ship it as /usr/bin/zuul-clear-ref. That is meant to be used on zuul-merger instance, the one we have is scandium.eqiad.wmnet which is running Jessie, so this patch is now pending for a port of the Zuul package to jessie.
I have build a new Jessie package and it is going to be upgraded on scandium (zuul merger) via T145057
2.5.0-8-gcbc7f62-wmf2jessie1 has been deployed on scandium.eqiad.wmnet (the zuul-merger) but I screwed it up. The python shebang needs to be adjusted to point to the venv:
$ zuul-clear-refs Traceback (most recent call last): File "/usr/bin/zuul-clear-refs", line 30, in <module> import git ImportError: No module named git
$ head -n 1 `which zuul-cloner` #!/usr/share/python/zuul/bin/python
The custom patch debian/patches/0002-Replace-python-shebang-with-python2.7.patch from the branch patch-queue/debian/precise-wikimedia needs to be rebased.
Change 310277 had a related patch set uploaded (by Hashar):
New release 2.5.0-8-gcbc7f62-wmf3precise1
Change 310285 had a related patch set uploaded (by Hashar):
New release 2.5.0-8-gcbc7f62-wmf3jessie1
I have rebased the shebang patch. Rebuild package for both Precise and Jessie:
https://people.wikimedia.org/~hashar/debs/zuul_2.5.0-8-gcbc7f62-wmf3precise1/
https://people.wikimedia.org/~hashar/debs/zuul_2.5.0-8-gcbc7f62-wmf3jessie1/
debdiff shows they are noop
comparing the package contents with previous version shows that three files get their shebang updated.
Will get them pushed to the zuul systems and apt.wikimedia.org
Does not work. The script is not properly installed and the shebang is not adjusted to point to the venv.
Change 315281 had a related patch set uploaded (by Hashar):
WMF: install zuul-clear-refs
Change 315290 had a related patch set uploaded (by Hashar):
Fix zuul-clear-refs install and shebang
Change 315352 had a related patch set uploaded (by Hashar):
2.5.0-8-gcbc7f62-wmf4precise1
Change 315430 had a related patch set uploaded (by Hashar):
2.5.0-8-gcbc7f62-wmf4jessie1
zuul_2.5.0-8-gcbc7f62-wmf4* fix it:
$ which zuul-clear-refs
/usr/bin/zuul-clear-refs
$ zuul-clear-refs
usage: zuul-clear-refs [-h] [--until DAYS_AGO] [-n] [-v] gitrepo
zuul-clear-refs: error: too few arguments
scandium:~$ zuul-clear-refs
usage: zuul-clear-refs [-h] [--until DAYS_AGO] [-n] [-v] gitrepo
zuul-clear-refs: error: too few arguments
FINALLY! Huge thanks to @elukey for all the package upgrades :}