You are browsing a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org

Heterogeneous deployment/Train deploys: Difference between revisions

From Wikitech-static
Jump to navigation Jump to search
imported>Brennen Bearnes
(→‎Sync to cluster and verify on testwiki: Mention T223287 re: scap-cdb-rebuild hanging.)
imported>Jforrester
(Add in short-form instructions.)
Line 1: Line 1:
[[File:MTR_CSR_Sifang_EMU_in_Shek_Kong_Stabling_Sidings_201710.jpg|thumb|500x500px|Bring new code in a fast, safe and efficient way!]]
[[File:MTR_CSR_Sifang_EMU_in_Shek_Kong_Stabling_Sidings_201710.jpg|thumb|500x500px|Bring new code in a fast, safe and efficient way!]]
{{Navigation MediaWiki deployment}}
{{Navigation MediaWiki deployment}}
== Pairing on the Train ==
== Pairing on the Train ==


As of October 2019, there are two people assigned to each week's train:  One as primary, and one as backup.  These are rough guidelines for sharing the work, and should be improved as we learn more.
As of October 2019, there are two people assigned to each week's train:  One as primary, and one as backup.  These are rough guidelines for sharing the work, and should be improved as we learn more.
Line 41: Line 41:
*[[#Update roadmap]].
*[[#Update roadmap]].


=== Places to Watch for Breakage ===
=== Places to Watch for Breakage ===


Train deployers should check for breakage as they are rolling out train as they are effectively the first line of defense for train deploys. Some of the places to watch for breakage:
Train deployers should check for breakage as they are rolling out train as they are effectively the first line of defense for train deploys. Some of the places to watch for breakage:
Line 63: Line 63:
* [https://grafana.wikimedia.org/d/000000566/overview?panelId=15&fullscreen&orgId=1&from=now-7d&to=now Minerva Client Errors] - Browser JS errors count (only wikipedias on mobile)
* [https://grafana.wikimedia.org/d/000000566/overview?panelId=15&fullscreen&orgId=1&from=now-7d&to=now Minerva Client Errors] - Browser JS errors count (only wikipedias on mobile)


=== If the train is blocked===
=== If the train is blocked ===


*A task will be assigned to you, for example [https://phabricator.wikimedia.org/T191059 T191059] (1.32.0-wmf.13 deployment blockers)
*A task will be assigned to you, for example [https://phabricator.wikimedia.org/T191059 T191059] (1.32.0-wmf.13 deployment blockers)
Line 98: Line 98:
* Once train is unblocked be sure to thank the folks who helped unblock it
* Once train is unblocked be sure to thank the folks who helped unblock it


==Monday: Sync up with your deployment partner==
== Weekly steps  ==
 
=== Monday: Sync up with your deployment partner ===


See the [[#Pairing on the Train|train pairing]] section above.
See the [[#Pairing on the Train|train pairing]] section above.


==Tuesday: New branch creation and deploy==
=== Tuesday: New branch creation and deploy ===


The new branch can be created in Gerrit from anywhere.
The new branch can be created in Gerrit from anywhere.


===Before the deploy window===
==== Before the deploy window ====
 
Depending on how practiced you are and where you choose to run commands (full clones of mediawiki-core from outside the cluster can take a while), the steps will typically take 45 to 90 minutes.
 
; Short-form instructions
{| class="wikitable"
! colspan="2" |Step
!host
!command
!example
|-
|P-0
|'''Set up .netrc locally, if not yet done'''
|Your laptop
| colspan="2" |<syntaxhighlight lang="shell-session">
you@yourlaptop:~$ vim .netrc
machine gerrit.wikimedia.org login [USERNAME] password [PASSWORD]
you@yourlaptop:~$ chmod go-rwx .netrc
 
</syntaxhighlight>Username and password can obtained from Gerrit:
 
* In the new UI go to [[gerrit:settings/#HTTPCredentials|HTTP Credentials]], copy Username and click Generate new password to generate new password.
* In the old UI, go to [[gerrit:#/settings/http-password|HTTP Password]], copy Username and click Generate Password to generate new password.
 
{{note|Generated password in both cases is different from your Gerrit password.|type=error}}
 
<br />
|-
|P-1
|'''Clone or update <code>mediawiki/tools/release</code>'''
|Your laptop
| colspan="2" |<syntaxhighlight lang="shell-session">
you@yourlaptop:~$ git clone https://gerrit.wikimedia.org/r/mediawiki/tools/release
</syntaxhighlight>
|-
|P-2
|'''Create the new branch in Gerrit'''
|Your laptop
 


Depending on how practiced you are and where you choose to run commands (full clones of mediawiki-core from outside the cluster can take a while) the steps will typically take 45 to 90 minutes.
Note<ref>To run branch.py you need to have the pygerrit2 library installed for Python3. In Debian 10 (buster), the python3-pygerrit2 package works.</ref>
|<syntaxhighlight lang="shell-session">
you@yourlaptop:~/release/make-release/ $ ./branch.py --core --core-bundle wmf_core --bundle wmf_branch --branchpoint HEAD --core-version [VERSION] [WMF BRANCH]
</syntaxhighlight>
|<syntaxhighlight lang="shell-session">
jforrester@James-Fs-MBP:~/release/make-release/ $ ./branch.py --core --core-bundle wmf_core --bundle wmf_branch --branchpoint HEAD --core-version 1.34.0-wmf.0 wmf/1.34.0-wmf.0
</syntaxhighlight>
|-
|P-3
|'''Note that you've just created the branch'''
|IRC
(<code>#wikimedia-operations)</code>
|<syntaxhighlight lang="irc">
!log [VERSION] was branched at [BRANCH POINT] for [TASK]
</syntaxhighlight>
|<syntaxhighlight lang="irc">
!log 1.35.0-wmf.14 was branched at fb16374c5bdb9d14729f358fb81638fc91640b4f for T233862
</syntaxhighlight>
|-
|P-4
|'''Merge the branch commit'''
|Gerrit ([[gerrit:c/mediawiki/core/+/564687|example]])
| colspan="2" |C+2 on the patch
|-
|P-5
|'''Enter screen (or tmux if you prefer)'''
|'''deploy1001.eqiad.wmnet'''


====Setup====
 
Note<ref>If you need to leave in the middle you can do <code>ctrl-a d</code> to detach and <code>screen -r train</code> to attach.</ref>
| colspan="2" |<syntaxhighlight lang="shell-session">
USERNAME@deploy1001:~$ screen -D -RR train
</syntaxhighlight>
|-
|P-6
|'''Set local ssh-agent in session'''
|deploy1001
| colspan="2" |<syntaxhighlight lang="shell-session">
USERNAME@deploy1001:~$ eval $(ssh-agent)
USERNAME@deploy1001:~$ ssh-add .ssh/id_ed25519
</syntaxhighlight>
|-
|P-7
|'''Clone new branch in production'''
|deploy1001
|<syntaxhighlight lang="shell-session">
USERNAME@deploy1001:/srv/mediawiki-staging$ scap prep [VERSION]
</syntaxhighlight>
|<syntaxhighlight lang="shell-session">
USERNAME@deploy1001:/srv/mediawiki-staging$ scap prep 1.34.0-wmf.0
</syntaxhighlight>
|-
|P-8
|'''Check existing security patches'''
|deploy1001
| colspan="2" |<syntaxhighlight lang="shell-session">
USERNAME@deploy1001:/srv/mediawiki-staging$ tree /srv/patches/[VERSION]
/srv/patches/[VERSION]
├── core
│  ├── 01-T[NUMBER].patch
│  └── 02-T[NUMBER].patch
└── extensions
    └── [EXTENSION]
        ├── 01-T[NUMBER].patch
        └── 02-T[NUMBER].patch
</syntaxhighlight>
|-
|P-9
|'''Apply core security patches'''
|deploy1001
| colspan="2" |<syntaxhighlight lang="shell-session">
USERNAME@deploy1001:/srv/mediawiki-staging$ cd php-[VERSION]
 
USERNAME@deploy1001:/srv/mediawiki-staging/php-[VERSION]$ git apply --check --3way /srv/patches/[VERSION]/core/[NUMBER]-T[NUMBER].patch
 
USERNAME@deploy1001:/srv/mediawiki-staging/php-[VERSION]$ git am --3way /srv/patches/[VERSION]/core/[NUMBER]-T[NUMBER].patch
</syntaxhighlight>
 
* If the patch fails to apply, investigate whether it's due to a conflict (<code>git status</code>) or the patch having been merged since the new branch cut (search <code>git log</code> for the commit, etc.). If it turns out to be the latter, remove the patch file from the <code>/srv/patches/[VERSION]</code> directory.
* If you need extra help, contact Security Team ([[foundationsite:role/staff-contractors/|Wikimedia Foundation]], [[Wikimedia Security Team|MediaWiki]], [https://office.wikimedia.org/wiki/Contact_list#Security Office Wiki]), currently {{ircnick|bawolff|Brian}} and {{ircnick|Reedy|Sam}} in IRC.
|-
|P-10
|'''Apply extension security patches'''
|deploy1001
| colspan="2" |<syntaxhighlight lang="shell-session">
USERNAME@deploy1001:/srv/mediawiki-staging/php-[VERSION]$ cd extensions/[EXTENSION]
 
USERNAME@deploy1001:/srv/mediawiki-staging/php-[VERSION]/extensions/[EXTENSION]$ git apply --check --3way /srv/patches/[VERSION]/extensions/[EXTENSION]/[NUMBER]-T[NUMBER].patch
 
USERNAME@deploy1001:/srv/mediawiki-staging/php-[VERSION]/extensions/[EXTENSION]$ git am --3way /srv/patches/[VERSION]/extensions/[EXTENSION]/[NUMBER]-T[NUMBER].patch
</syntaxhighlight>
|-
|P-11
|'''Decide what old stuff to prune'''
|deploy1001
| colspan="2" |<syntaxhighlight lang="shell-session">
USERNAME@deploy1001:/srv/mediawiki-staging/$ find . -mindepth 2 -maxdepth 2 -type f -path './php-*/README' -ctime +7 -exec dirname {} \;
</syntaxhighlight>
|-
|P-12
|'''Clean up old stuff'''
|deploy1001
|<syntaxhighlight lang="shell-session">
USERNAME@deploy1001:/srv/mediawiki-staging/$ scap clean --delete [some old version from find -ctime +7 output above]
</syntaxhighlight>
|<syntaxhighlight lang="shell-session">
USERNAME@deploy1001:/srv/mediawiki-staging/$ scap clean --delete 1.34.0-wmf.0
</syntaxhighlight>
|-
|P-13
|'''Create and auto-merge/deploy the testwikis patch'''
 
 
🐌 Note: this step runs scap to build localisation caches, and will take about 20 minutes.
|Your laptop
| colspan="2" |<syntaxhighlight lang="shell-session">
you@yourlaptop:~$ ./release/bin/deploy-promote testwikis
Promote testwikis from [PREVIOUS-VERSION] to [VERSION] [y/N]
Now wait for jenkins to merge the patch, then press enter to continue with git pull && scap sync-wikiversions
</syntaxhighlight>
|-
|P-14
|'''Verify version change on [[testwiki:Special:Version|testwiki]]'''
|[[testwiki:Special:Version|testwiki]]
| colspan="2" |Verify version change on [[testwiki:Special:Version|testwiki]] (Installed software, Product: MediaWiki, Version: [VERSION]) and l10n cache ([[testwiki:Special:Version|Special:Version]] should not look like [https://test.wikipedia.org/wiki/Special:Version?uselang=qqx Special:Version?uselang=qqx])
|-
|P-15A
|'''Create deploy notes'''
|Your laptop
|<syntaxhighlight lang="shell-session">
you@yourlaptop:~$ python3 release/make-deploy-notes/makedeploynotes.py [PREVIOUS-VERSION] [VERSION] | tee deploy-notes-[VERSION]
</syntaxhighlight>
|<syntaxhighlight lang="shell-session">
you@yourlaptop:~$ python3 release/make-deploy-notes/makedeploynotes.py 1.33.0-wmf.99 1.34.0-wmf.0 | tee deploy-notes-1.34.0-wmf.0
</syntaxhighlight>
|-
|P-15B
|'''Post deploy notes'''
|MediaWiki.org
| colspan="2" |Browse to <code><nowiki>https://www.mediawiki.org/wiki/MediaWiki_</nowiki>[VERSION]/Changelog</code> and paste. Example: [[mw:MediaWiki 1.34/wmf.4/Changelog]].
|-
|<s>P-15</s>
|'''<s>Check deploy notes</s>'''
|<s>MediaWiki.org</s>
| colspan="2" |<s>Be sure to check that the appropriate Changelog was created at <code><nowiki>https://www.mediawiki.org/wiki/MediaWiki_[VERSION]/Changelog</nowiki></code>. Example: [[mw:MediaWiki 1.34/wmf.4/Changelog]]</s>
|-
!
! colspan="4" |'''Wait for the deploy window'''
|}
 
; Full instructions
<div class="mw-collapsible mw-collapsed" style="margin:1em; border: 1px dashed grey; padding: 2em 1em;">
===== Setup =====


The script to cut a branch is run on your local machine (as of Jan 2020).
The script to cut a branch is run on your local machine (as of Jan 2020).
Line 144: Line 334:
To run branch.py you need to have the pygerrit2 library installed for Python3. In Debian 10 (buster), the python3-pygerrit2 package works.
To run branch.py you need to have the pygerrit2 library installed for Python3. In Debian 10 (buster), the python3-pygerrit2 package works.


====Create the new branch in Gerrit====
===== Create the new branch in Gerrit =====


<syntaxhighlight lang="shell-session">
<syntaxhighlight lang="shell-session">
Line 162: Line 352:
The script will create a release patch, [https://gerrit.wikimedia.org/r/c/mediawiki/core/+/564687 like this one], under your gerrit account. You must C+2 this, and wait for it to merge, to proceed.
The script will create a release patch, [https://gerrit.wikimedia.org/r/c/mediawiki/core/+/564687 like this one], under your gerrit account. You must C+2 this, and wait for it to merge, to proceed.


====tmux or screen====
===== tmux or screen =====


Now that the branch has been cut on your local machine, the remainder of the work will be done on the deployment host: '''deploy1001.eqiad.wmnet'''
Now that the branch has been cut on your local machine, the remainder of the work will be done on the deployment host: '''deploy1001.eqiad.wmnet'''
Line 195: Line 385:
</syntaxhighlight>
</syntaxhighlight>


====Clone new branch====
===== Clone new branch =====
This command will create a new <code>/srv/mediawiki-staging/php-[VERSION]</code> directory:
This command will create a new <code>/srv/mediawiki-staging/php-[VERSION]</code> directory:


Line 210: Line 400:
This should only take a couple of minutes.
This should only take a couple of minutes.


====Apply security patches====
===== Apply security patches =====


*Patches should be named sequentially in the order that they will cleanly apply (e.g. <code>01-T[NUMBER].patch</code>, <code>02-T[NUMBER].patch</code>)
*Patches should be named sequentially in the order that they will cleanly apply (e.g. <code>01-T[NUMBER].patch</code>, <code>02-T[NUMBER].patch</code>)
Line 229: Line 419:
</syntaxhighlight>
</syntaxhighlight>


=====Core=====
====== Core ======


*You can check a core patch to see if it will apply cleanly with
*You can check a core patch to see if it will apply cleanly with
Line 243: Line 433:
</syntaxhighlight>
</syntaxhighlight>


=====Extension=====
====== Extension ======


* For an extension:
* For an extension:
Line 256: Line 446:
*If you need extra help, contact Security Team ([https://wikimediafoundation.org/role/staff-contractors/ Wikimedia Foundation], [https://www.mediawiki.org/wiki/Wikimedia_Security_Team MediaWiki], [https://office.wikimedia.org/wiki/Contact_list#Security Office Wiki]), currently {{ircnick|bawolff|Brian}} and {{ircnick|Reedy|Sam}} in IRC.
*If you need extra help, contact Security Team ([https://wikimediafoundation.org/role/staff-contractors/ Wikimedia Foundation], [https://www.mediawiki.org/wiki/Wikimedia_Security_Team MediaWiki], [https://office.wikimedia.org/wiki/Contact_list#Security Office Wiki]), currently {{ircnick|bawolff|Brian}} and {{ircnick|Reedy|Sam}} in IRC.


====Create patches to update wikiversions.json====
===== Create patches to update wikiversions.json =====


Create group0 to [VERSION] patch:
Create group0 to [VERSION] patch:
Line 274: Line 464:
</syntaxhighlight>
</syntaxhighlight>


====Send staged patches to Gerrit for review====
===== Send staged patches to Gerrit for review =====


<syntaxhighlight lang="shell-session">
<syntaxhighlight lang="shell-session">
Line 286: Line 476:
</syntaxhighlight>
</syntaxhighlight>


====Discard changes to working directory and index====
===== Discard changes to working directory and index =====


<syntaxhighlight lang="shell-session">
<syntaxhighlight lang="shell-session">
Line 292: Line 482:
</syntaxhighlight>
</syntaxhighlight>


====Clean up old stuff====
===== Clean up old stuff =====


[[:mw:MediaWiki 1.34/Roadmap]] is a good place to find when a branch was created.
[[:mw:MediaWiki 1.34/Roadmap]] is a good place to find when a branch was created.
Line 324: Line 514:
'''Deleting a branch is a full sync of that directory, and can take 10-15 minutes each.'''
'''Deleting a branch is a full sync of that directory, and can take 10-15 minutes each.'''


====Sync to cluster and verify on testwiki====
===== Sync to cluster and verify on testwiki =====


* Edit <code>/srv/mediawiki-staging/wikiversions.json</code> and set <code>testwiki</code> to <code>php-[VERSION]</code>
* Edit <code>/srv/mediawiki-staging/wikiversions.json</code> and set <code>testwiki</code> to <code>php-[VERSION]</code>
Line 365: Line 555:
</syntaxhighlight>
</syntaxhighlight>


====Update deploy notes====
===== Update deploy notes =====


There is a script in the  [https://gerrit.wikimedia.org/r/mediawiki/tools/release <code>mediawiki/tools/release</code>] repo called <code>makedeploynotes.py</code>. It queries gerrit's gitiles to make release notes. Usage: <code>makedeploynotes.py <old-version> <new-version></code>
There is a script in the  [https://gerrit.wikimedia.org/r/mediawiki/tools/release <code>mediawiki/tools/release</code>] repo called <code>makedeploynotes.py</code>. It queries gerrit's gitiles to make release notes. Usage: <code>makedeploynotes.py <old-version> <new-version></code>
Line 375: Line 565:
From there you can copy-and-paste to the Changelog page on mediawiki.org; e.g., <code><nowiki>https://www.mediawiki.org/wiki/MediaWiki_[VERSION]/Changelog</nowiki></code>. Example: [https://www.mediawiki.org/wiki/MediaWiki_1.35/wmf.24/Changelog MediaWiki 1.35/wmf.24/Changelog]
From there you can copy-and-paste to the Changelog page on mediawiki.org; e.g., <code><nowiki>https://www.mediawiki.org/wiki/MediaWiki_[VERSION]/Changelog</nowiki></code>. Example: [https://www.mediawiki.org/wiki/MediaWiki_1.35/wmf.24/Changelog MediaWiki 1.35/wmf.24/Changelog]


====Wait for deploy window====
===== Wait for deploy window =====
All of the changes above can be done at any time prior to the actual deployment window.
All of the changes above can be done at any time prior to the actual deployment window.
</div>


===During the deploy window===
==== During the deploy window ====
 
; Short-form instructions
{| class="wikitable"
! colspan="2" |Step
!host
!command
!example
|-
|0-0
|'''Create and auto-merge/deploy the group0 patch'''
|Your laptop
| colspan="2" |<syntaxhighlight lang="shell-session">
you@yourlaptop:~$ ./release/bin/deploy-promote group0
Promote group0 from [PREVIOUS-VERSION] to [VERSION] [y/N]
Now wait for jenkins to merge the patch, then press enter to continue with git pull && scap sync-wikiversions
</syntaxhighlight>
|-
|0-1
|'''Verify production has indeed switched'''
|[[Special:Version|MediaWiki.org]]
| colspan="2" |Verify that [[Special:Version|mediawikiwiki]] has switched to the new version (Installed software, Product: MediaWiki, Version: VERSION)
|-
|0-2
|'''Monitor production logs'''
|logstash ''etc.''
| colspan="2" |Monitor irc and [[logstash]] and/or [[Wikimedia binaries#logspam-watch|logspam-watch]] for problems, see [[#Places to Watch for Breakage]]
|-
|0-3
|'''Update roadmap page'''
|[[mw:MediaWiki 1.35/Roadmap]].
|Change the <code>Deployed to group</code> (if you're using VisualEditor) or the 3rd parameter of the <code>WMFReleaseTableRow</code> template (if you're using the wikitext editor) to <code>0</code> (deployed to group0)
|<syntaxhighlight lang="text">
{{WMFReleaseTableHead}}
{{WMFReleaseTableRow|12|2018-07-10|0}}
</syntaxhighlight>
|-
|0-4
|'''Kill ssh-agent'''
|deployment server
|colspan="2" |<syntaxhighlight lang="shell-session">
USERNAME@deploy1001:~$ pgrep -u "$USER" -laf ssh-agent # list all of your ssh-agent processes
USERNAME@deploy1001:~$ pkill -u "$USER" -f ssh-agent  # kill all your ssh-agent processes
USERNAME@deploy1001:~$ pgrep -u "$USER" -laf ssh-agent # did they all die?</syntaxhighlight>
|}


====Switch group0 wikis to [VERSION]====
; Full instructions
<div class="mw-collapsible mw-collapsed" style="margin:1em; border: 1px dashed grey; padding: 2em 1em;">
===== Switch group0 wikis to [VERSION] =====


*CR+2 <code>group0 to [VERSION]</code> patch in Gerrit that you submitted earlier
*CR+2 <code>group0 to [VERSION]</code> patch in Gerrit that you submitted earlier
Line 417: Line 654:
*Monitor irc and [[Logstash|logstash]] and/or [[Wikimedia_binaries#logspam-watch|logspam-watch]] for problems, see [[#Places to Watch for Breakage]]
*Monitor irc and [[Logstash|logstash]] and/or [[Wikimedia_binaries#logspam-watch|logspam-watch]] for problems, see [[#Places to Watch for Breakage]]


====Update roadmap====
===== Update roadmap =====


*Change the <code>Deployed to group</code> (if you're using VisualEditor) or the 3rd parameter of the <code>WMFReleaseTableRow</code> template (if you're using the wikitext editor) to <code>0</code> (deployed to group0) at [[:mw:MediaWiki 1.35/Roadmap]].
*Change the <code>Deployed to group</code> (if you're using VisualEditor) or the 3rd parameter of the <code>WMFReleaseTableRow</code> template (if you're using the wikitext editor) to <code>0</code> (deployed to group0) at [[:mw:MediaWiki 1.35/Roadmap]].
Line 448: Line 685:
</syntaxhighlight>
</syntaxhighlight>


==== Terminate ssh-agents ====
===== Terminate ssh-agents   =====


Terminate the ssh-agent you started earlier so it doesn't linger on after you log out:
Terminate the ssh-agent you started earlier so it doesn't linger on after you log out:
Line 459: Line 696:


Every other day of the train you need to start a new ssh-agent and kill it later.
Every other day of the train you need to start a new ssh-agent and kill it later.
</div>


==Wednesday: group0 to group1 deploy==
=== Wednesday: group0 to group1 deploy ===


==== Switch group1 wikis to [VERSION]====
; Short-form instructions
{| class="wikitable"
! colspan="2" |Step
!host
!command
!example
|-
|1-0
|'''Create and auto-merge/deploy the group1 patch'''
|Your laptop
| colspan="2" |<syntaxhighlight lang="shell-session">
you@yourlaptop:~$ ./release/bin/deploy-promote
Promote group1 from [PREVIOUS-VERSION] to [VERSION] [y/N]
Now wait for jenkins to merge the patch, then press enter to continue with git pull && scap sync-wikiversions
</syntaxhighlight>
|-
|1-1
|'''Verify production has indeed switched'''
|[[wikt:Special:Version|English Wiktionary]]
| colspan="2" |Verify that [[wikt:Special:Version|the English Wiktionary]] (and other group1 wikis) have switched to the new version (Installed software, Product: MediaWiki, Version: VERSION)
|-
|1-2
|'''Monitor production logs'''
|logstash ''etc.''
| colspan="2" |Monitor irc and [[logstash]] and/or [[Wikimedia binaries#logspam-watch|logspam-watch]] for problems, see [[#Places to Watch for Breakage]]
|-
|1-3
|'''Update roadmap page'''
|[[mw:MediaWiki 1.35/Roadmap]].
|Change the <code>Deployed to group</code> (if you're using VisualEditor) or the 3rd parameter of the <code>WMFReleaseTableRow</code> template (if you're using the wikitext editor) to <code>1</code> (deployed to group1)
|<syntaxhighlight lang="text">
{{WMFReleaseTableHead}}
{{WMFReleaseTableRow|12|2018-07-10|1}}
...
{{WMFReleaseTableFooter}}
</syntaxhighlight>
|}
 
; Full instructions
<div class="mw-collapsible mw-collapsed" style="margin:1em; border: 1px dashed grey; padding: 2em 1em;">
===== Switch group1 wikis to [VERSION] =====


Use the <code>release/bin/deploy-promote</code> script to update <code>wikiversions.json</code>
Use the <code>release/bin/deploy-promote</code> script to update <code>wikiversions.json</code>
Line 481: Line 759:
The above should take about five minutes, including the waiting time for Gerrit/CI.
The above should take about five minutes, including the waiting time for Gerrit/CI.


====Update roadmap====
===== Update roadmap =====


*Change the <code>Deployed to group</code> (if you're using VisualEditor) or the 3rd parameter of the <code>WMFReleaseTableRow</code> template (if you're using the wikitext editor) to <code>1</code> (deployed to group1) at [[:mw:MediaWiki 1.35/Roadmap]].
*Change the <code>Deployed to group</code> (if you're using VisualEditor) or the 3rd parameter of the <code>WMFReleaseTableRow</code> template (if you're using the wikitext editor) to <code>1</code> (deployed to group1) at [[:mw:MediaWiki 1.35/Roadmap]].
Line 502: Line 780:
{{WMFReleaseTableRow|12|2018-07-10|1}}
{{WMFReleaseTableRow|12|2018-07-10|1}}
</syntaxhighlight>
</syntaxhighlight>
</div>
=== Thursday: group{0,1} to all deploy  ===
; Short-form instructions
{| class="wikitable"
!
!Step
!host
!command
!example
|-
|2-0
|'''Create and auto-merge/deploy the group2 patch'''
|Your laptop
| colspan="2" |<syntaxhighlight lang="shell-session">
you@yourlaptop:~$ ./release/bin/deploy-promote all
Promote all from [PREVIOUS-VERSION] to [VERSION] [y/N]
Now wait for jenkins to merge the patch, then press enter to continue with git pull && scap sync-wikiversions
</syntaxhighlight>
|-
|2-1
|'''Verify production has indeed switched'''
|[[w:Special:Version|English Wikipedia]]
| colspan="2" |Verify that [[w:Special:Version|the English Wikipedia]] (and other group2 wikis) have switched to the new version (Installed software, Product: MediaWiki, Version: VERSION)
|-
|2-2
|'''Monitor production logs'''
|logstash ''etc.''
| colspan="2" |Monitor irc and [[logstash]] and/or [[Wikimedia binaries#logspam-watch|logspam-watch]] for problems, see [[#Places to Watch for Breakage]]
|-
|2-3
|'''Update roadmap page'''
|[[mw:MediaWiki 1.35/Roadmap]].
|Change the <code>Deployed to group</code> (if you're using VisualEditor) or the 3rd parameter of the <code>WMFReleaseTableRow</code> template (if you're using the wikitext editor) to <code>2</code> (deployed to all)
|<syntaxhighlight lang="text">
{{WMFReleaseTableHead}}
{{WMFReleaseTableRow|12|2018-07-10|2}}
...
{{WMFReleaseTableFooter}}
</syntaxhighlight>
|}


==Thursday: group{0,1} to all deploy==
; Full instructions
<div class="mw-collapsible mw-collapsed" style="margin:1em; border: 1px dashed grey; padding: 2em 1em;">


==== Switch all wikis to [VERSION]====
===== Switch all wikis to [VERSION] =====


Thursday deploy is very similar to the Wednesday deploy, the only difference in terms of procedure is the target group
Thursday deploy is very similar to the Wednesday deploy, the only difference in terms of procedure is the target group
Line 524: Line 844:
After the script run is complete, '''all wikis''' should be running [VERSION].
After the script run is complete, '''all wikis''' should be running [VERSION].


====Update roadmap====
===== Update roadmap =====


*Change the <code>Deployed to group</code> (if you're using VisualEditor) or the 3rd parameter of the <code>WMFReleaseTableRow</code> template (if you're using the wikitext editor) to <code>2</code> (deployed to all wikis) at [[:mw:MediaWiki 1.35/Roadmap]].
*Change the <code>Deployed to group</code> (if you're using VisualEditor) or the 3rd parameter of the <code>WMFReleaseTableRow</code> template (if you're using the wikitext editor) to <code>2</code> (deployed to all wikis) at [[:mw:MediaWiki 1.35/Roadmap]].
Line 545: Line 865:
{{WMFReleaseTableRow|12|2018-07-10|2}}
{{WMFReleaseTableRow|12|2018-07-10|2}}
</syntaxhighlight>
</syntaxhighlight>
</div>


==Incident documentation==
== Incident documentation ==


*If there were problems during the train, follow instructions at [[Incident documentation]] on incident reports and post-mortem review.
*If there were problems during the train, follow instructions at [[Incident documentation]] on incident reports and post-mortem review.

Revision as of 19:40, 16 April 2020

Bring new code in a fast, safe and efficient way!
Deployments

Pairing on the Train

As of October 2019, there are two people assigned to each week's train: One as primary, and one as backup. These are rough guidelines for sharing the work, and should be improved as we learn more.

  • On Monday, communicate with your partner and establish how you'll collaborate over the course of the week.
    • Updates on IRC while your partner is working and updates on the train blocker ticket if they're offline seems to be a useful pattern.
    • Liberal use of video chat for pairing on hard problems is encouraged.
    • It seems to work well to have the primary do the work of cutting the branch, syncing wikis, etc., while the backup keeps an eye on logs, works on improvements to deploy tooling, and is generally an extra pair of eyes for the whole process.
    • If you are in doubt about any part of the process and it's during your partner's working hours, consult them first and get their help in resolving your questions.
  • If one member of the pair is in the European window and one is in the American window, both train deployment windows should be reserved on the Deployments calendar. This gives a backup deployer a defined window for moving the train forward outside the primary's working hours, if it becomes necessary.
  • If the train is blocked or there are any other issues, communicate the transfer of responsibility on the train blocker ticket by assigning it to the responsible party and leaving a note.

Breakage

There will be times when this process does not go smoothly. There are guidelines for what do to when that happens.

In general, if there is an unexplained error that occurs within 1 hour of a train deployment — always roll back the train. Rolling back the train to eliminate it as the cause of unexplained breakage can be especially important if there are many ongoing possible causes for issues as this helps to eliminate one of those causes as the source of problems.

Rollback

To rollback a wikiversion change, it should be pretty quick. Go ahead and rollback production before you send patches up to gerrit since waiting on Jenkins may take a while:

USERNAME@deploy1001:/srv/mediawiki-staging$ git revert $(git log -1 --format=%H -- wikiversions.json)
USERNAME@deploy1001:/srv/mediawiki-staging$ scap sync-wikiversions 'Revert "group[0|1] wikis to [VERSION]"'
USERNAME@deploy1001:/srv/mediawiki-staging$ # Now that you've synced the revert, push patches up to gerrit, you have to run git commit --amend to get the changeid
USERNAME@deploy1001:/srv/mediawiki-staging$ git commit --amend
USERNAME@deploy1001:/srv/mediawiki-staging$ git push origin HEAD:refs/for/master/[VERSION]%l=Code-Review+2

Example:

USERNAME@deploy1001:/srv/mediawiki-staging$ git push origin HEAD:refs/for/master/1.34.0-wmf.0%l=Code-Review+2
  • Wait for the patch to merge and the fetch back down to the deployment server

Places to Watch for Breakage

Train deployers should check for breakage as they are rolling out train as they are effectively the first line of defense for train deploys. Some of the places to watch for breakage:

If the train is blocked

  • A task will be assigned to you, for example T191059 (1.32.0-wmf.13 deployment blockers)
  • Any open subtasks block the train from moving forward. This means no further deployments until the blockers are resolved.

Checklist

If there are blocking tasks, please do the following:

  • Make sure all tasks blocking train are set to UBN! priority in phabricator
  • Comment on the task asking for an ETA or if this can be solved by reverting a recent commit.
  • Send e-mail to:
    • ops@lists.wikimedia.org
    • wikitech-l@lists.wikimedia.org
    • Subject: [Train] {version} status update
    • Body
      The {version} version of MediaWiki is blocked[0].
      
      The new version is deployed to {group(s){0,1,2}}[1], but can proceed no
      further until these issues are resolved:
      
      * {Phab task name} - {phab task link}
      
      Once these issues are resolved train can resume. If these issues are
      resolved on a Friday the train will resume Monday.
      
      Thank you for your help resolving these issues!
      
      -- Your humble train toiler
      
      [0]. <{link to phab task for train}>
      [1]. <https://tools.wmflabs.org/versions/>
      
  • Add relevant people (see Developers/Maintainers) to the blocking task
  • Ping relevant people in IRC
  • Once train is unblocked be sure to thank the folks who helped unblock it

Weekly steps

Monday: Sync up with your deployment partner

See the train pairing section above.

Tuesday: New branch creation and deploy

The new branch can be created in Gerrit from anywhere.

Before the deploy window

Depending on how practiced you are and where you choose to run commands (full clones of mediawiki-core from outside the cluster can take a while), the steps will typically take 45 to 90 minutes.

Short-form instructions
Step host command example
P-0 Set up .netrc locally, if not yet done Your laptop
you@yourlaptop:~$ vim .netrc
machine gerrit.wikimedia.org login [USERNAME] password [PASSWORD]
you@yourlaptop:~$ chmod go-rwx .netrc
Username and password can obtained from Gerrit:
  • In the new UI go to HTTP Credentials, copy Username and click Generate new password to generate new password.
  • In the old UI, go to HTTP Password, copy Username and click Generate Password to generate new password.


P-1 Clone or update mediawiki/tools/release Your laptop
you@yourlaptop:~$ git clone https://gerrit.wikimedia.org/r/mediawiki/tools/release
P-2 Create the new branch in Gerrit Your laptop


Note[1]

you@yourlaptop:~/release/make-release/ $ ./branch.py --core --core-bundle wmf_core --bundle wmf_branch --branchpoint HEAD --core-version [VERSION] [WMF BRANCH]
jforrester@James-Fs-MBP:~/release/make-release/ $ ./branch.py --core --core-bundle wmf_core --bundle wmf_branch --branchpoint HEAD --core-version 1.34.0-wmf.0 wmf/1.34.0-wmf.0
P-3 Note that you've just created the branch IRC

(#wikimedia-operations)

!log [VERSION] was branched at [BRANCH POINT] for [TASK]
!log 1.35.0-wmf.14 was branched at fb16374c5bdb9d14729f358fb81638fc91640b4f for T233862
P-4 Merge the branch commit Gerrit (example) C+2 on the patch
P-5 Enter screen (or tmux if you prefer) deploy1001.eqiad.wmnet


Note[2]

USERNAME@deploy1001:~$ screen -D -RR train
P-6 Set local ssh-agent in session deploy1001
USERNAME@deploy1001:~$ eval $(ssh-agent)
USERNAME@deploy1001:~$ ssh-add .ssh/id_ed25519
P-7 Clone new branch in production deploy1001
USERNAME@deploy1001:/srv/mediawiki-staging$ scap prep [VERSION]
USERNAME@deploy1001:/srv/mediawiki-staging$ scap prep 1.34.0-wmf.0
P-8 Check existing security patches deploy1001
USERNAME@deploy1001:/srv/mediawiki-staging$ tree /srv/patches/[VERSION]
/srv/patches/[VERSION]
├── core
│   ├── 01-T[NUMBER].patch
│   └── 02-T[NUMBER].patch
└── extensions
    └── [EXTENSION]
        ├── 01-T[NUMBER].patch
        └── 02-T[NUMBER].patch
P-9 Apply core security patches deploy1001
USERNAME@deploy1001:/srv/mediawiki-staging$ cd php-[VERSION]

USERNAME@deploy1001:/srv/mediawiki-staging/php-[VERSION]$ git apply --check --3way /srv/patches/[VERSION]/core/[NUMBER]-T[NUMBER].patch

USERNAME@deploy1001:/srv/mediawiki-staging/php-[VERSION]$ git am --3way /srv/patches/[VERSION]/core/[NUMBER]-T[NUMBER].patch
  • If the patch fails to apply, investigate whether it's due to a conflict (git status) or the patch having been merged since the new branch cut (search git log for the commit, etc.). If it turns out to be the latter, remove the patch file from the /srv/patches/[VERSION] directory.
  • If you need extra help, contact Security Team (Wikimedia Foundation, MediaWiki, Office Wiki), currently Brian (bawolff) and Sam (Reedy) in IRC.
P-10 Apply extension security patches deploy1001
USERNAME@deploy1001:/srv/mediawiki-staging/php-[VERSION]$ cd extensions/[EXTENSION]

USERNAME@deploy1001:/srv/mediawiki-staging/php-[VERSION]/extensions/[EXTENSION]$ git apply --check --3way /srv/patches/[VERSION]/extensions/[EXTENSION]/[NUMBER]-T[NUMBER].patch

USERNAME@deploy1001:/srv/mediawiki-staging/php-[VERSION]/extensions/[EXTENSION]$ git am --3way /srv/patches/[VERSION]/extensions/[EXTENSION]/[NUMBER]-T[NUMBER].patch
P-11 Decide what old stuff to prune deploy1001
USERNAME@deploy1001:/srv/mediawiki-staging/$ find . -mindepth 2 -maxdepth 2 -type f -path './php-*/README' -ctime +7 -exec dirname {} \;
P-12 Clean up old stuff deploy1001
USERNAME@deploy1001:/srv/mediawiki-staging/$ scap clean --delete [some old version from find -ctime +7 output above]
USERNAME@deploy1001:/srv/mediawiki-staging/$ scap clean --delete 1.34.0-wmf.0
P-13 Create and auto-merge/deploy the testwikis patch


🐌 Note: this step runs scap to build localisation caches, and will take about 20 minutes.

Your laptop
you@yourlaptop:~$ ./release/bin/deploy-promote testwikis
Promote testwikis from [PREVIOUS-VERSION] to [VERSION] [y/N]
Now wait for jenkins to merge the patch, then press enter to continue with git pull && scap sync-wikiversions
P-14 Verify version change on testwiki testwiki Verify version change on testwiki (Installed software, Product: MediaWiki, Version: [VERSION]) and l10n cache (Special:Version should not look like Special:Version?uselang=qqx)
P-15A Create deploy notes Your laptop
you@yourlaptop:~$ python3 release/make-deploy-notes/makedeploynotes.py [PREVIOUS-VERSION] [VERSION] | tee deploy-notes-[VERSION]
you@yourlaptop:~$ python3 release/make-deploy-notes/makedeploynotes.py 1.33.0-wmf.99 1.34.0-wmf.0 | tee deploy-notes-1.34.0-wmf.0
P-15B Post deploy notes MediaWiki.org Browse to https://www.mediawiki.org/wiki/MediaWiki_[VERSION]/Changelog and paste. Example: mw:MediaWiki 1.34/wmf.4/Changelog.
P-15 Check deploy notes MediaWiki.org Be sure to check that the appropriate Changelog was created at https://www.mediawiki.org/wiki/MediaWiki_[VERSION]/Changelog. Example: mw:MediaWiki 1.34/wmf.4/Changelog
Wait for the deploy window
Full instructions
Setup

The script to cut a branch is run on your local machine (as of Jan 2020).

Local .netrc setup

Create a .netrc file in your home directory with the following content.

you@yourlaptop:~$ vim .netrc
machine gerrit.wikimedia.org login [USERNAME] password [PASSWORD]

Username and password can obtained from Gerrit:

  • In the new UI go to HTTP Credentials, copy Username and click Generate new password to generate new password.
  • In the old UI, go to HTTP Password, copy Username and click Generate Password to generate new password.

Make sure .netrc file is only readable by you.

you@yourlaptop:~$ chmod go-rwx .netrc

Clone or update mediawiki/tools/release.

USERNAME@yourlaptop:~$ git clone https://gerrit.wikimedia.org/r/mediawiki/tools/release

To run branch.py you need to have the pygerrit2 library installed for Python3. In Debian 10 (buster), the python3-pygerrit2 package works.

Create the new branch in Gerrit
you@yourlaptop:~/release/make-release/ $ ./branch.py --core --core-bundle wmf_core --bundle wmf_branch --branchpoint HEAD --core-version [VERSION] [WMF BRANCH]
you@yourlaptop:~/release/make-release/ $ ./branch.py --core --core-bundle wmf_core --bundle wmf_branch --branchpoint HEAD --core-version 1.34.0-wmf.0 wmf/1.34.0-wmf.0

In #wikimedia-operations connect, drop a quick log note that you've kicked off the branch process so that others know it's underway, e.g.:

!log 1.35.0-wmf.14 was branched at fb16374c5bdb9d14729f358fb81638fc91640b4f for T233862

The script will create a release patch, like this one, under your gerrit account. You must C+2 this, and wait for it to merge, to proceed.

tmux or screen

Now that the branch has been cut on your local machine, the remainder of the work will be done on the deployment host: deploy1001.eqiad.wmnet

Some scripts run for 10-60 minutes so consider using tmux or screen.

If you prefer tmux:

USERNAME@deploy1001:~$ tmux new -s train
...
USERNAME@deploy1001:~$ exit

If you need to leave in the middle you can do ctrl-b d to detach and tmux a -t train to attach.

If you prefer screen:

USERNAME@deploy1001:~$ screen -D -RR train
...
USERNAME@deploy1001:~$ exit

If you need to leave in the middle you can do ctrl-a d to detach and screen -r train to attach.

In either the tmux or the screen session, you'll want to start an ssh-agent and load your local key there:

USERNAME@deploy1001:~$ eval $(ssh-agent)
USERNAME@deploy1001:~$ ssh-add .ssh/id_ed25519
Clone new branch

This command will create a new /srv/mediawiki-staging/php-[VERSION] directory:

USERNAME@deploy1001:/srv/mediawiki-staging$ scap prep [VERSION]

Example:

USERNAME@deploy1001:/srv/mediawiki-staging$ scap prep 1.34.0-wmf.0

This should only take a couple of minutes.

Apply security patches
  • Patches should be named sequentially in the order that they will cleanly apply (e.g. 01-T[NUMBER].patch, 02-T[NUMBER].patch)
  • Check and apply each patch in both /srv/patches/[VERSION]/core and /srv/patches/[VERSION]/extensions/[NAME] to the new core checkout and extensions, respectively.

Check existing patches:

USERNAME@deploy1001:~$ tree /srv/patches/[VERSION]
/srv/patches/[VERSION]
├── core
│   ├── 01-T[NUMBER].patch
│   └── 02-T[NUMBER].patch
└── extensions
    └── [EXTENSION]
        ├── 01-T[NUMBER].patch
        └── 02-T[NUMBER].patch
Core
  • You can check a core patch to see if it will apply cleanly with
USERNAME@deploy1001:/srv/mediawiki-staging/php-[VERSION]$ git apply --check --3way /srv/patches/[VERSION]/core/[NUMBER]-T[NUMBER].patch
  • If the patch checks out, apply and commit it with
USERNAME@deploy1001:/srv/mediawiki-staging/php-[VERSION]$ git am --3way /srv/patches/[VERSION]/core/[NUMBER]-T[NUMBER].patch
Extension
  • For an extension:
USERNAME@deploy1001:/srv/mediawiki-staging/php-[VERSION]/extensions/[EXTENSION]$ git apply --check --3way /srv/patches/[VERSION]/extensions/[EXTENSION]/[NUMBER]-T[NUMBER].patch

USERNAME@deploy1001:/srv/mediawiki-staging/php-[VERSION]/extensions/[EXTENSION]$ git am --3way /srv/patches/[VERSION]/extensions/[EXTENSION]/[NUMBER]-T[NUMBER].patch
  • If the patch fails to apply, investigate whether it's due to a conflict (git status) or the patch having been merged since the new branch cut (search git log for the commit, etc.). If it turns out to be the latter, remove the patch file from the /srv/patches/[VERSION] directory.
  • If you need extra help, contact Security Team (Wikimedia Foundation, MediaWiki, Office Wiki), currently Brian (bawolff) and Sam (Reedy) in IRC.
Create patches to update wikiversions.json

Create group0 to [VERSION] patch:

USERNAME@deploy1001:/srv/mediawiki-staging/$ scap update-wikiversions group0 [VERSION]
USERNAME@deploy1001:/srv/mediawiki-staging/$ git add wikiversions.json
USERNAME@deploy1001:/srv/mediawiki-staging/$ git commit -m "Group0 to [VERSION]"

Example:

USERNAME@deploy1001:/srv/mediawiki-staging/$ scap update-wikiversions group0 1.34.0-wmf.0
USERNAME@deploy1001:/srv/mediawiki-staging/$ git add wikiversions.json
USERNAME@deploy1001:/srv/mediawiki-staging/$ git commit -m "Group0 to 1.34.0-wmf.0"
Send staged patches to Gerrit for review
USERNAME@deploy1001:/srv/mediawiki-staging/$ git push origin HEAD:refs/for/master/[VERSION]

Example:

USERNAME@deploy1001:/srv/mediawiki-staging/$ git push origin HEAD:refs/for/master/1.34.0-wmf.0
Discard changes to working directory and index
USERNAME@deploy1001:/srv/mediawiki-staging/$ git reset --hard origin/master
Clean up old stuff

mw:MediaWiki 1.34/Roadmap is a good place to find when a branch was created.

List all branches:

USERNAME@deploy1001:/srv/mediawiki-staging/$ find . -maxdepth 1 -type d -name 'php-*' -print

Find old branches, more than 7 days old:

USERNAME@deploy1001:/srv/mediawiki-staging/$ find . -mindepth 2 -maxdepth 2 -type f -path './php-*/README' -ctime +7 -exec dirname {} \;

For all branches more than 7 days old, drop everything with:

USERNAME@deploy1001:/srv/mediawiki-staging/$ scap clean --delete [some old version from find -ctime +7 output above]

Example:

USERNAME@deploy1001:/srv/mediawiki-staging/$ scap clean --delete 1.34.0-wmf.0

Active branches are visible at Wikimedia MediaWiki versions page.

Deleting a branch is a full sync of that directory, and can take 10-15 minutes each.

Sync to cluster and verify on testwiki
  • Edit /srv/mediawiki-staging/wikiversions.json and set testwiki to php-[VERSION]
  • Do not commit and push to Gerrit, only make this change locally on the deployment server
USERNAME@deploy1001:/srv/mediawiki-staging/$ vim wikiversions.json
USERNAME@deploy1001:/srv/mediawiki-staging$ git diff
...
-    "testwiki": "php-[VERSION-1]",
+    "testwiki": "php-[VERSION]",
...
  • Run scap to (re)build localization caches and sync changes across the cluster.
  • 🐌 Note: this step may take on the order of 70-80 minutes.
  • 🐌 Note: If scap seems to hang during the scap-cdb-rebuild phase of this process, you may need to try pressing enter to speed it up.
USERNAME@deploy1001:/srv/mediawiki-staging/$ scap sync "testwiki to php-[VERSION] and rebuild l10n cache"

Example:

USERNAME@deploy1001:/srv/mediawiki-staging/$ scap sync "testwiki to php-1.34.0-wmf.0 and rebuild l10n cache"

This can take well over an hour. Opening or reloading the version page on testwiki after the scap sync command can take a minute or two.

  • Revert local changes
USERNAME@deploy1001:/srv/mediawiki-staging/$ git checkout -- wikiversions.json
Update deploy notes

There is a script in the mediawiki/tools/release repo called makedeploynotes.py. It queries gerrit's gitiles to make release notes. Usage: makedeploynotes.py <old-version> <new-version>

$ python3 make-deploy-notes/makedeploynotes.py 1.35.0-wmf.24 1.35.0-wmf.25 | tee deploy-notes-1.35.0-wmf.25

From there you can copy-and-paste to the Changelog page on mediawiki.org; e.g., https://www.mediawiki.org/wiki/MediaWiki_[VERSION]/Changelog. Example: MediaWiki 1.35/wmf.24/Changelog

Wait for deploy window

All of the changes above can be done at any time prior to the actual deployment window.

During the deploy window

Short-form instructions
Step host command example
0-0 Create and auto-merge/deploy the group0 patch Your laptop
you@yourlaptop:~$ ./release/bin/deploy-promote group0
Promote group0 from [PREVIOUS-VERSION] to [VERSION] [y/N]
Now wait for jenkins to merge the patch, then press enter to continue with git pull && scap sync-wikiversions
0-1 Verify production has indeed switched MediaWiki.org Verify that mediawikiwiki has switched to the new version (Installed software, Product: MediaWiki, Version: VERSION)
0-2 Monitor production logs logstash etc. Monitor irc and logstash and/or logspam-watch for problems, see #Places to Watch for Breakage
0-3 Update roadmap page mw:MediaWiki 1.35/Roadmap. Change the Deployed to group (if you're using VisualEditor) or the 3rd parameter of the WMFReleaseTableRow template (if you're using the wikitext editor) to 0 (deployed to group0)
{{WMFReleaseTableHead}}
{{WMFReleaseTableRow|12|2018-07-10|0}}
0-4 Kill ssh-agent deployment server
USERNAME@deploy1001:~$ pgrep -u "$USER" -laf ssh-agent # list all of your ssh-agent processes
USERNAME@deploy1001:~$ pkill -u "$USER" -f ssh-agent   # kill all your ssh-agent processes
USERNAME@deploy1001:~$ pgrep -u "$USER" -laf ssh-agent # did they all die?
Full instructions
Switch group0 wikis to [VERSION]
  • CR+2 group0 to [VERSION] patch in Gerrit that you submitted earlier
  • Wait for Gerrit/Zuul/Jenkins to merge the patch(es)
  • Pull patch(es) to deployment server
USERNAME@deploy1001:/srv/mediawiki-staging$ git fetch
  • Check diff to ensure it is what you expect (this should show a bunch of version changes in wikiversions.json for group0 wikis)
USERNAME@deploy1001:/srv/mediawiki-staging$ git diff HEAD..origin/master
  • Apply changes
USERNAME@deploy1001:/srv/mediawiki-staging$ git rebase origin/master
  • Sync the change across the cluster
USERNAME@deploy1001:/srv/mediawiki-staging$ scap sync-wikiversions "group0 to [VERSION]"

Example:

USERNAME@deploy1001:/srv/mediawiki-staging$ scap sync-wikiversions "group0 to 1.34.0-wmf.0"
Update roadmap
  • Change the Deployed to group (if you're using VisualEditor) or the 3rd parameter of the WMFReleaseTableRow template (if you're using the wikitext editor) to 0 (deployed to group0) at mw:MediaWiki 1.35/Roadmap.

For wikitext editor, change

{{WMFReleaseTableHead}}
{{WMFReleaseTableRow|[VERSION]|[DATE]|}}
...
{{WMFReleaseTableFooter}}

to

{{WMFReleaseTableHead}}
{{WMFReleaseTableRow|[VERSION]|[DATE]|0}}
...
{{WMFReleaseTableFooter}}

Example:

{{WMFReleaseTableHead}}
{{WMFReleaseTableRow|12|2018-07-10|0}}
...
{{WMFReleaseTableFooter}}
Terminate ssh-agents

Terminate the ssh-agent you started earlier so it doesn't linger on after you log out:

pgrep -u "$USER" -laf ssh-agent # list all of your ssh-agent processes
pkill -u "$USER" -f ssh-agent   # kill all your ssh-agent processes
pgrep -u "$USER" -laf ssh-agent # did they all die?

Every other day of the train you need to start a new ssh-agent and kill it later.

Wednesday: group0 to group1 deploy

Short-form instructions
Step host command example
1-0 Create and auto-merge/deploy the group1 patch Your laptop
you@yourlaptop:~$ ./release/bin/deploy-promote
Promote group1 from [PREVIOUS-VERSION] to [VERSION] [y/N]
Now wait for jenkins to merge the patch, then press enter to continue with git pull && scap sync-wikiversions
1-1 Verify production has indeed switched English Wiktionary Verify that the English Wiktionary (and other group1 wikis) have switched to the new version (Installed software, Product: MediaWiki, Version: VERSION)
1-2 Monitor production logs logstash etc. Monitor irc and logstash and/or logspam-watch for problems, see #Places to Watch for Breakage
1-3 Update roadmap page mw:MediaWiki 1.35/Roadmap. Change the Deployed to group (if you're using VisualEditor) or the 3rd parameter of the WMFReleaseTableRow template (if you're using the wikitext editor) to 1 (deployed to group1)
{{WMFReleaseTableHead}}
{{WMFReleaseTableRow|12|2018-07-10|1}}
...
{{WMFReleaseTableFooter}}
Full instructions
Switch group1 wikis to [VERSION]

Use the release/bin/deploy-promote script to update wikiversions.json

USERNAME@deploy1001:~$ ./release/bin/deploy-promote
Promote group1 from [PREVIOUS-VERSION] to [VERSION] [y/N]

The script automatically Code-Review +2 the patch in Gerrit. Once CI has merged the patch, hit enter at the 2nd prompt.

Now wait for jenkins to merge the patch, then press enter to continue with git pull && scap sync-wikiversions

After the script run is complete, group1 wikis should be running [VERSION].

The above should take about five minutes, including the waiting time for Gerrit/CI.

Update roadmap
  • Change the Deployed to group (if you're using VisualEditor) or the 3rd parameter of the WMFReleaseTableRow template (if you're using the wikitext editor) to 1 (deployed to group1) at mw:MediaWiki 1.35/Roadmap.

For wikitext editor, change

{{WMFReleaseTableRow|[VERSION]|[DATE]|0}}

to

{{WMFReleaseTableRow|[VERSION]|[DATE]|1}}

Example:

{{WMFReleaseTableRow|12|2018-07-10|1}}

Thursday: group{0,1} to all deploy

Short-form instructions
Step host command example
2-0 Create and auto-merge/deploy the group2 patch Your laptop
you@yourlaptop:~$ ./release/bin/deploy-promote all
Promote all from [PREVIOUS-VERSION] to [VERSION] [y/N]
Now wait for jenkins to merge the patch, then press enter to continue with git pull && scap sync-wikiversions
2-1 Verify production has indeed switched English Wikipedia Verify that the English Wikipedia (and other group2 wikis) have switched to the new version (Installed software, Product: MediaWiki, Version: VERSION)
2-2 Monitor production logs logstash etc. Monitor irc and logstash and/or logspam-watch for problems, see #Places to Watch for Breakage
2-3 Update roadmap page mw:MediaWiki 1.35/Roadmap. Change the Deployed to group (if you're using VisualEditor) or the 3rd parameter of the WMFReleaseTableRow template (if you're using the wikitext editor) to 2 (deployed to all)
{{WMFReleaseTableHead}}
{{WMFReleaseTableRow|12|2018-07-10|2}}
...
{{WMFReleaseTableFooter}}
Full instructions
Switch all wikis to [VERSION]

Thursday deploy is very similar to the Wednesday deploy, the only difference in terms of procedure is the target group

Use the release/bin/deploy-promote all script to update wikiversions.json

USERNAME@deploy1001:~$ ./release/bin/deploy-promote all
Promote all from [PREVIOUS-VERSION] to [VERSION] [y/N]

The script automatically Code-Review +2 the patch in Gerrit. Once CI has merged the patch, hit enter at the 2nd prompt.

Now wait for jenkins to merge the patch, then press enter to continue with git pull && scap sync-wikiversions

After the script run is complete, all wikis should be running [VERSION].

Update roadmap
  • Change the Deployed to group (if you're using VisualEditor) or the 3rd parameter of the WMFReleaseTableRow template (if you're using the wikitext editor) to 2 (deployed to all wikis) at mw:MediaWiki 1.35/Roadmap.

For wikitext editor, change

{{WMFReleaseTableRow|[VERSION]|[DATE]|1}}

to

{{WMFReleaseTableRow|[VERSION]|[DATE]|2}}

Example:

{{WMFReleaseTableRow|12|2018-07-10|2}}

Incident documentation

  1. To run branch.py you need to have the pygerrit2 library installed for Python3. In Debian 10 (buster), the python3-pygerrit2 package works.
  2. If you need to leave in the middle you can do ctrl-a d to detach and screen -r train to attach.