Page MenuHomePhabricator

Try "deploy-promote testwikis" in train-dev, document what seems to be missing
Closed, ResolvedPublic

Event Timeline

deploy-promote modifies /srv/mediawiki-staging/wikiversions.json and performs a git commit on behalf of the user so it may be helpful to configure user.email and user.name to avoid a noisy warning. It then tries to push the commit to origin (which currently fails because the git VM is only configured for read-only access). Further, it pushes using a Gerrit-style reference (git push origin HEAD:refs/for/master%topic=1.35.0-wmf.32,l=Code-Review+2). Assuming the push somehow managed to succeed, deploy-promote discards the commit it created and performs a git pull to retrieve it from origin. It verifies that it has pulled down the commit that it pushed.

What happens next depends on if the target group is testwikis or not . If it is testwikis then deploy-promote runs scap sync <autogenerated message>. Otherwise it runs scap sync-wikiversions <autogenerated message>.

Finally deploy-promote performs a curl request to https://$CHECKDOMAIN/wiki/Special:Version, where CHECKDOMAIN depends on the target group. For testwikis, CHECKDOMAIN will be test.wikipedia.org.

scap sync expects mwscript to be installed on the deploy server. On the production deploy server it is installed as /usr/local/bin/mwscript. That script expects /etc/profile.d/mediawiki.sh to exist. /etc/profile.d/mediawiki.sh sets variables MEDIAWIKI_DEPLOYMENT_DIR, MEDIAWIKI_STAGING_DIR, and MEDIAWIKI_WEB_USER and potentially sets the umask to 0002 (not important for train-dev). For this scenario mwscript ultimately runs /srv/mediawiki-staging/multiversion/MWScript.php, passing over any arguments that were supplied (possibly using sudo to change to the MEDIAWIKI_WEB_USER first).

@dancy: Thanks for documenting deploy-promote. I think we really need gerrit in the vm if we are to be able to test everything properly.

I concur that adding Gerrit to train-dev would be a good thing to do soon. Or at least something that behaves sufficiently like Gerrit, but I suspect it's easiest to just use Gerrit itself.

Created T260671: Configure git user.email and user.name for the debian user on the deploy server in train-dev and T260672: Add Gerrit to train-dev and T260674: Add app servers to train-dev. There's probably more changes (appservers?), but one step at a time, but I think this is what we can extract from this round of research.

Do we want to close this task as resolved, or keep it open for possible future research?

Let's keep this task open a bit longer.

Change 621004 had a related patch set uploaded (by Ahmon Dancy; owner: Ahmon Dancy):
[mediawiki/tools/train-dev@master] Add stub mwscript to deploy VM

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

Change 621004 merged by Lars Wirzenius:
[mediawiki/tools/train-dev@master] Add stub mwscript to deploy VM

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

Change 627333 had a related patch set uploaded (by Ahmon Dancy; owner: Ahmon Dancy):
[mediawiki/tools/release@master] Make deploy-promote work in train-dev enviroment

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

Change 627333 merged by Lars Wirzenius:
[mediawiki/tools/release@master] Make deploy-promote work in train-dev enviroment

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

dancy claimed this task.

Deploy promote works well in train-dev now.