Last modified: 2014-08-09 16:22:00 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T68683, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 66683 - Automate updating the puppet checkout
Automate updating the puppet checkout
Status: RESOLVED FIXED
Product: Wikimedia Labs
Classification: Unclassified
deployment-prep (beta) (Other open bugs)
unspecified
All All
: Normal enhancement
: ---
Assigned To: Bryan Davis
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-16 20:25 UTC by Greg Grossmeier
Modified: 2014-08-09 16:22 UTC (History)
8 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
bash script to update puppet checkout in /var/lib/git/operations/puppet (1.71 KB, text/plain)
2014-07-01 17:01 UTC, Bryan Davis
Details

Description Greg Grossmeier 2014-06-16 20:25:04 UTC
The puppet checkout on Beta Cluster should be automatic.
Comment 1 Bryan Davis 2014-06-17 23:32:00 UTC
I have a bash script that seems to be working to automate this, but I'm not entirely sure of the best way to tie it into deployment-salt. We could do one of several things:

* Cron it on deployment-salt and email *someone* when it blows up
* Add it to operations/puppet as an add-on for role::puppet::self that anyone could use (deploy script, setup cron, allow configuration of warning emails)
* Make deployment-salt a Jenkins slave and set the script up to run as a post-merge Zuul task on operations/puppet

The script I have written is available on deployment-salt.eqiad.wmflabs as /home/bd808/git-sync-upstream
Comment 2 Tim Landscheidt 2014-06-18 00:37:52 UTC
Note that deployment-prep is special in its use of role::puppet::self in that it always uses HEAD (AFAIK).  Typically, there will be local changes and/or bisects, so automatic updates shouldn't be the default.
Comment 3 Bryan Davis 2014-06-18 15:07:14 UTC
(In reply to Tim Landscheidt from comment #2)
> Note that deployment-prep is special in its use of role::puppet::self in
> that it always uses HEAD (AFAIK).

We are actually using a model where we layer pending gerrit patches on top of origin/production via cherry-pick and update by rebasing those local commits on the origin branch. The nice thing about this is that when a commit is actually merged in gerrit the rebase will detect that and discard the local commit in favor of the merged version. The number of pending patches we have at any given time has varied between zero (doesn't happen very often) and nine or ten with four or five being normal.

> Typically, there will be local changes and/or bisects, so automatic
> updates shouldn't be the default.

The model of rebasing against an upstream tracking branch should work for almost anyone, but I agree that automatic updating should be a separate role that each project chooses to apply if we go in that direction.
Comment 4 Bryan Davis 2014-06-18 17:03:17 UTC
I have setup a temporary cron job on deployment-salt as user bd808 to update the operations/puppet.git checkout using ~/bd808/git-sync-upstream. It runs hourly at 17 minutes after the hour and logs to /home/bd808/git-sync.log.

If this works reliably for a couple of days I'll look into setting up a more permanent solution.
Comment 5 Bryan Davis 2014-07-01 17:01:12 UTC
Created attachment 15801 [details]
bash script to update puppet checkout in /var/lib/git/operations/puppet

Attaching the script that has been running on deployment-salt for a couple of weeks. 

The script generally runs with no issues but occasionally gets tripped up by the merge of a cherry-picked patch that has been amended in gerrit but not updated in deployment-salt to use the latest version. When this happens, I have manually corrected via:
* git rebase --abort
* git rebase --interactive
** Remove the merged patch causing the conflict by deleting its line

At the moment I'm leaning towards using Jenkins to manage the repo on deployment-salt as this could be hooked into the operations/puppet gerrit repo to update beta on each upstream commit and would also provide a means of notification in the case of rebase failures. The unfortunate drawback to this would be that it's a solution very specific to beta and not a general solution for anyone using a self-hosted puppetmaster in labs.
Comment 6 Gerrit Notification Bot 2014-08-01 16:07:25 UTC
Change 151099 had a related patch set uploaded by BryanDavis:
beta: puppet rebase script

https://gerrit.wikimedia.org/r/151099
Comment 7 Bryan Davis 2014-08-01 16:40:33 UTC
Patch applied in beta via cherry-pick (how meta). The cron that was running a version of this script from my home dir has been disabled.
Comment 8 Gerrit Notification Bot 2014-08-09 14:01:31 UTC
Change 151099 merged by Filippo Giunchedi:
beta: puppet rebase script

https://gerrit.wikimedia.org/r/151099
Comment 9 Bryan Davis 2014-08-09 16:22:00 UTC
Thanks Filippo!

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links