Page MenuHomePhabricator

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

Event Timeline

LarsWirzenius triaged this task as High priority.Aug 17 2020, 12:38 PM
dancy added a subscriber: dancy.Aug 17 2020, 7:07 PM

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 and 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

dancy added a comment.Aug 17 2020, 7:22 PM

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/ to exist. /etc/profile.d/ 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.

LarsWirzenius added a comment.EditedAug 18 2020, 10:21 AM

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 and 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?

dancy added a comment.Aug 18 2020, 2:58 PM

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

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

LarsWirzenius removed LarsWirzenius as the assignee of this task.Aug 19 2020, 12:14 PM
brennen moved this task from Backlog to Watching on the User-brennen board.Aug 19 2020, 5:03 PM

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

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

dancy closed this task as Resolved.Thu, Oct 1, 3:32 PM
dancy claimed this task.

Deploy promote works well in train-dev now.