Page MenuHomePhabricator

Get rid of the /srv/mediawiki/php symbolic link
Closed, ResolvedPublic

Description

The production mediawiki deployment includes a symbolic link /srv/mediawiki/php which points to one of the live php-<train-version> directories. The link is stored within the operations/mediawiki-config git repo. Whenever the train is promoted to group1, the symlink is updated to point to the latest version, a commit is made to record this change, pushed to Gerrit, merged, and pulled down to the deploy server, and an additional sync of the symlink is performed to all servers (which adds about 10 minutes to the Wednesday train operation).

It's unclear what the /srv/mediawiki/php is used for (I can't find anything that references it).

I propose removing the symlink and the associated scap code which manipulates it.

  • Locate and deal with apparent users of /srv/mediawiki/php
  • Add way to disable /srv/mediawiki-staging/php management in scap.
  • Leave the php symlink unmanaged for a few train cycles. Since scap clean runs weekly, eventually the php symlink will become stale (pointing to a non-existent php-<version> directory). Fix any problems that result (hopefully none).
  • Remove the php symlink from the operations/mediawiki-config repo.

Details

Related Changes in Gerrit:
SubjectAuthorRepoBranchLines +/-
Ahmon Dancyoperations/mediawiki-configmaster+0 -1
Ahmon Dancyoperations/mediawiki-configmaster+1 -0
Ahmon Dancyoperations/mediawiki-configmaster+0 -1
Ahmon Dancyoperations/puppetproduction+3 -0
Ahmon Dancyoperations/puppetproduction+3 -1
Ahmon Dancyoperations/deployment-chartsmaster+1 -2
Ahmon Dancyoperations/puppetproduction+1 -3
Ahmon Dancyoperations/mediawiki-configmaster+9 -2
Ahmon Dancyoperations/deployment-chartsmaster+2 -1
Ahmon Dancyoperations/puppetproduction+3 -1
Ahmon Dancyoperations/puppetproduction+3 -1
Ahmon Dancymediawiki/corewmf/1.42.0-wmf.22+1 -1
Ahmon Dancyoperations/mediawiki-configmaster+0 -2
Ahmon Dancyoperations/mediawiki-configtrain-dev+8 -4
Clément Goubertoperations/deployment-chartsmaster+3 -1
Hasharoperations/puppetproduction+1 -5
Ahmon Dancyoperations/mediawiki-configmaster+8 -4
Ahmon Dancyoperations/puppetproduction+5 -1
Ahmon Dancyoperations/puppetproduction+0 -2
Krinklemediawiki/coremaster+1 -1
Show related patches Customize query in gerrit
Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
webserver/build-webserver-image: Don't use php symlinkrepos/releng/release!76dancymain-Idfd11f8c0d1bcc12ecf5cc002a5bd41af2016a33main
deploy: create-database: Don't use /srv/mediawiki-staging/php symlinkrepos/releng/train-dev!70dancymain-I678fbc30538ec332b0ca4d8928c77424c3ffbe52main
Disable /srv/mediawiki-staging/php symlink managementrepos/releng/train-dev!64dancymain-I38bcc3e3c06164fe9871594bda13c1a27b7b33cemain
Add manage_mediawiki_php_symlink config flagrepos/releng/scap!277dancymaster-Ia0f2289242f8627821fd2ac8accec1817af7cdebmaster
Use static.php to serve www.mediawiki.org/ontology/ontology.owlrepos/releng/train-dev!50dancymain-I9724e771081b18122c66db329bc2cc6bc31ebec3main
Route /w/CREDITS and /w/COPYING to /w/static.phprepos/releng/train-dev!49dancymain-Ib0e685d40e0d5bf47311a3657118aa025a8bdfe6main
Customize query in GitLab

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Change 1012708 had a related patch set uploaded (by Ahmon Dancy; author: Ahmon Dancy):

[operations/mediawiki-config@master] Remove /w/COPYING and /w/CREDITS symlinks

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

Change 1012710 had a related patch set uploaded (by Ahmon Dancy; author: Ahmon Dancy):

[operations/mediawiki-config@train-dev] static.php: Handle COPYING and CREDITS files

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

Change 1012710 abandoned by Ahmon Dancy:

[operations/mediawiki-config@train-dev] static.php: Handle COPYING and CREDITS files

Reason:

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

Change 1012708 merged by jenkins-bot:

[operations/mediawiki-config@master] Remove /w/COPYING and /w/CREDITS symlinks

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

Mentioned in SAL (#wikimedia-operations) [2024-03-19T18:37:37Z] <dancy@deploy2002> Started scap: Backport for [[gerrit:1012708|Remove /w/COPYING and /w/CREDITS symlinks (T359643)]]

Mentioned in SAL (#wikimedia-operations) [2024-03-19T18:39:59Z] <dancy@deploy2002> dancy: Backport for [[gerrit:1012708|Remove /w/COPYING and /w/CREDITS symlinks (T359643)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-03-19T18:52:35Z] <dancy@deploy2002> Finished scap: Backport for [[gerrit:1012708|Remove /w/COPYING and /w/CREDITS symlinks (T359643)]] (duration: 14m 57s)

Change 1012766 had a related patch set uploaded (by Ahmon Dancy; author: Krinkle):

[mediawiki/core@wmf/1.42.0-wmf.22] mime: Register `.owl` as application/rdf+xml

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

Change 1012766 merged by jenkins-bot:

[mediawiki/core@wmf/1.42.0-wmf.22] mime: Register `.owl` as application/rdf+xml

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

Mentioned in SAL (#wikimedia-operations) [2024-03-20T17:01:07Z] <dancy@deploy2002> Started scap: Backport for [[gerrit:1012766|mime: Register .owl as application/rdf+xml (T171807 T359643)]]

Mentioned in SAL (#wikimedia-operations) [2024-03-20T17:03:41Z] <dancy@deploy2002> dancy: Backport for [[gerrit:1012766|mime: Register .owl as application/rdf+xml (T171807 T359643)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-03-20T17:16:31Z] <dancy@deploy2002> Finished scap: Backport for [[gerrit:1012766|mime: Register .owl as application/rdf+xml (T171807 T359643)]] (duration: 15m 24s)

Change 1013148 had a related patch set uploaded (by Ahmon Dancy; author: Ahmon Dancy):

[operations/puppet@production] mediawiki.yaml: Use static.php to serve www.mediawiki.org/ontology/ontology.owl

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

Change #1013389 had a related patch set uploaded (by Ahmon Dancy; author: Ahmon Dancy):

[operations/puppet@production] Route /w/docs/ to /w/static.php

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

Change #1013389 merged by Alexandros Kosiaris:

[operations/puppet@production] Route /w/docs/ to /w/static.php

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

Change #1013148 merged by JHathaway:

[operations/puppet@production] mediawiki.yaml: Serve mw.org/ontology/ontology.owl via /w/docs/ontology.owl

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

Change #1018332 had a related patch set uploaded (by Ahmon Dancy; author: Ahmon Dancy):

[operations/deployment-charts@master] mediawiki: Route /w/docs/ to /w/static.php

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

Change #1018335 had a related patch set uploaded (by Ahmon Dancy; author: Ahmon Dancy):

[operations/puppet@production] mediawiki.yaml: Serve mw.org/ontology/ontology.owl via /w/docs/ontology.owl (v2)

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

@dancy Are you proposing a redirect in general, or only for appservers? (Is this easier than a rewrite?)

I believe we intentionally chose this as canonical URL such that it only exists on mediawiki.org as opposed to the docs directory which is reachable from any wiki. This is similar to e.g. https://www.mediawiki.org/xml/ in that regard, so as to not create ambiguity over from where it should be used.

@dancy Are you proposing a redirect in general, or only for appservers? (Is this easier than a rewrite?)

I believe we intentionally chose this as canonical URL such that it only exists on mediawiki.org as opposed to the docs directory which is reachable from any wiki. This is similar to e.g. https://www.mediawiki.org/xml/ in that regard, so as to not create ambiguity over from where it should be used.

I'm intending for the ontology/ontology.owl redirect to only apply to mediawiki.org. I believe that's what I've done in https://gerrit.wikimedia.org/r/c/operations/puppet/+/1018335. So there's "a" ontology.owl that one can retrieve from <any>.wikipedia.org/w/docs/ontology.owl, and there's "the" ontology.owl at https://www.mediawiki.org/ontology/ontology.owl.

I originally tried a simple rewrite in https://gerrit.wikimedia.org/r/c/operations/puppet/+/1013148 but it wasn't working as expected (404 errors). I ended up using a redirect to satisfy the checks that static.php performs on REQUEST_URI (it wants it to begin with /w/).

I understand the redirect is limited to mediawiki.org, but by redirecting, the URL that ends up in circulation will become inevitably the destination, which then promotes the generic URL that can easily be mistaken for that on another wiki, or even be attempted as "correct" as users try to help themselves by using the "right" one (with questions about which one to use in a cross-wiki context).

This then would mean we now have to support that destination as a stable URL, on all wiki domains, long-term. We could add custom WMF redirects to handle that, but it'd inevitably break on third-party wikis when we move the file elsewhere within core at some point. Suffice to say, it's not meant to be consumed from individual wiki domains. Exposing docs/ is fine on all domains as we don't point to it from docs or production software. Redirecting to it, would imho change that.

Thanks for the clarification. In that case I will keep experimenting. I may end up having to change static.php to accommodate this special case.

Change #1018354 had a related patch set uploaded (by Ahmon Dancy; author: Ahmon Dancy):

[operations/mediawiki-config@master] static.php: Handle mediawiki.org/ontology/ontology.owl

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

Change #1018332 merged by jenkins-bot:

[operations/deployment-charts@master] mediawiki: Route /w/docs/ to /w/static.php

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

Change #1018354 merged by jenkins-bot:

[operations/mediawiki-config@master] static.php: Handle mediawiki.org/ontology/ontology.owl

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

Mentioned in SAL (#wikimedia-operations) [2024-04-11T14:54:39Z] <dancy@deploy1002> Started scap: Backport for [[gerrit:1018354|static.php: Handle mediawiki.org/ontology/ontology.owl (T171807 T359643)]]

Mentioned in SAL (#wikimedia-operations) [2024-04-11T14:57:21Z] <dancy@deploy1002> dancy: Backport for [[gerrit:1018354|static.php: Handle mediawiki.org/ontology/ontology.owl (T171807 T359643)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-04-11T15:12:21Z] <dancy@deploy1002> Finished scap: Backport for [[gerrit:1018354|static.php: Handle mediawiki.org/ontology/ontology.owl (T171807 T359643)]] (duration: 17m 41s)

Change #1019067 had a related patch set uploaded (by Ahmon Dancy; author: Ahmon Dancy):

[operations/puppet@production] Revert "Route /w/docs/ to /w/static.php"

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

Change #1019067 merged by JHathaway:

[operations/puppet@production] Revert "Route /w/docs/ to /w/static.php"

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

Change #1018335 merged by JHathaway:

[operations/puppet@production] Serve mw.org/ontology/ontology.owl via /w/static.php (v2)

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

Change #1019068 had a related patch set uploaded (by Ahmon Dancy; author: Ahmon Dancy):

[operations/deployment-charts@master] Revert "mediawiki: Route /w/docs/ to /w/static.php"

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

Change #1019068 merged by jenkins-bot:

[operations/deployment-charts@master] Revert "mediawiki: Route /w/docs/ to /w/static.php"

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

dancy opened https://gitlab.wikimedia.org/repos/releng/train-dev/-/merge_requests/54

Use static.php to serve www.mediawiki.org/ontology/ontology.owl (v2)

dancy merged https://gitlab.wikimedia.org/repos/releng/train-dev/-/merge_requests/54

Use static.php to serve www.mediawiki.org/ontology/ontology.owl (v2)

dancy changed the task status from Open to In Progress.Apr 11 2024, 8:25 PM
dancy triaged this task as Low priority.

Change #1020321 had a related patch set uploaded (by Ahmon Dancy; author: Ahmon Dancy):

[operations/puppet@production] scap.cfg.erb: Disable /srv/mediawiki-staging/php symlink management

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

Change #1020321 merged by Dzahn:

[operations/puppet@production] scap.cfg.erb: Disable /srv/mediawiki-staging/php symlink management

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

Mentioned in SAL (#wikimedia-operations) [2024-04-17T21:50:25Z] <mutante> deploying scap config change (gerrit:1020321) - [cumin2002:~] $ sudo cumin -b 4 -s 40 'C:scap AND mw*' 'run-puppet-agent' T359643

dancy opened https://gitlab.wikimedia.org/repos/releng/train-dev/-/merge_requests/70

deploy: create-database: Don't use /srv/mediawiki-staging/php symlink

jhuneidi merged https://gitlab.wikimedia.org/repos/releng/train-dev/-/merge_requests/70

deploy: create-database: Don't use /srv/mediawiki-staging/php symlink

thcipriani changed the task status from In Progress to Stalled.May 8 2024, 4:25 PM
thcipriani subscribed.

Pausing this while we test letting the symlink go stale in production for a bit, if nothing breaks, we'll go ahead and call this resolved. For now: waiting.

Change #1036725 had a related patch set uploaded (by Ahmon Dancy; author: Ahmon Dancy):

[operations/mediawiki-config@master] Remove the php symlink

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

Change #1036725 merged by jenkins-bot:

[operations/mediawiki-config@master] Remove the php symlink

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

Mentioned in SAL (#wikimedia-operations) [2024-05-28T18:16:53Z] <dancy@deploy1002> Started scap: Backport for [[gerrit:1036725|Remove the php symlink (T359643)]]

Mentioned in SAL (#wikimedia-operations) [2024-05-28T18:17:54Z] <dancy@deploy1002> sync-world aborted: Backport for [[gerrit:1036725|Remove the php symlink (T359643)]] (duration: 01m 00s)

Mentioned in SAL (#wikimedia-operations) [2024-05-28T18:19:40Z] <dancy@deploy1002> Started scap: Backport for [[gerrit:1036725|Remove the php symlink (T359643)]]

Mentioned in SAL (#wikimedia-operations) [2024-05-28T18:20:11Z] <dancy@deploy1002> sync-world aborted: Backport for [[gerrit:1036725|Remove the php symlink (T359643)]] (duration: 00m 30s)

Change #1036658 had a related patch set uploaded (by Ahmon Dancy; author: Ahmon Dancy):

[operations/mediawiki-config@master] Revert "Remove the php symlink"

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

Change #1036658 merged by jenkins-bot:

[operations/mediawiki-config@master] Revert "Remove the php symlink"

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

Change #1036750 had a related patch set uploaded (by Ahmon Dancy; author: Ahmon Dancy):

[operations/mediawiki-config@master] Remove the php symlink (v2)

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

Change #1036750 merged by jenkins-bot:

[operations/mediawiki-config@master] Remove the php symlink (v2)

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

Mentioned in SAL (#wikimedia-operations) [2024-05-29T15:19:19Z] <dancy@deploy1002> Started scap: Backport for [[gerrit:1036750|Remove the php symlink (v2) (T359643)]]

Mentioned in SAL (#wikimedia-operations) [2024-05-29T15:22:05Z] <dancy@deploy1002> dancy: Backport for [[gerrit:1036750|Remove the php symlink (v2) (T359643)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-05-29T15:32:23Z] <dancy@deploy1002> Finished scap: Backport for [[gerrit:1036750|Remove the php symlink (v2) (T359643)]] (duration: 13m 03s)