Page MenuHomePhabricator

Services in Vagrant should not be cloned into root
Closed, ResolvedPublic

Description

When enabling mathoid role, it gets cloned into the root vagrant dir. I tihnk we should set up a proper "service" role that all services should inherit, and it should be cloned to some other location (e.g. <vagrant-root>/mediawiki/services)

Event Timeline

Yurik raised the priority of this task from to Needs Triage.
Yurik updated the task description. (Show Details)
Yurik added projects: MediaWiki-Vagrant, Math.
Yurik subscribed.
Physikerwelt subscribed.

I aprechiate this proposal. But I think @bd808 needs to deccide that.
What's about other services?

/vagrant/mediawiki/services isn't the right location. I've been thinking for a while however that having some container directory for the various additional software components that are possible to add to mw-vagrant would be a good idea. What color should this bikeshed be?

  • /vagrant/apps/
  • /vagrant/modules/
  • /vagrant/src/
  • /vagrant/opt/
  • /vagrant/srv/
  • /vagrant/???

/vagrant/services/ is the cleanest i think, and it maps to all mediawiki/services/* repos.

/vagrant/services/ is the cleanest i think, and it maps to all mediawiki/services/* repos.

What about all the things that we can install that aren't mediawiki/services/* things? /vagrant/srv/ would match the FHS location we use on cluster servers for installing things. It might not have great discoverability for arbitrary users though. Would /vagarnt/opt/ might be easier to understand without being a total linux geek?

@dduvall and @ori do you have intuition or opinions on this?

Tell you the truth I have no clue what Linux's /opt is for (i have seen it before, but had to read the FHS article, and even that is too vague for this case).

IMO, the /vagrant/services dir would be for anything that provides its own connection point - basically a service that will most likely exist on our backend with or without direct exposure. Examples - graphoid, parsoid, mathoid.... Come to think of it, we could make it /vagrant/servicoids/ :)

+1 /vagrant/srv for all services that are meant to be hacked on.

I'd go for services... to be cosistent with the git repo structure

I'd go for services... to be cosistent with the git repo structure

As I've pointed out above, the nodejs services aren't the only thing that can be installed by a role as code that is not MediaWiki proper. Our current .gitignore has:

/mediawiki/
/scholarships/
/wikimetrics/
/mathoid
/iegreview
/profiles
/phab
/node_modules

Parsoid is currently hidden away inside the VM (T56321) as is the jobrunner daemon. The eventual solution for T78739 will likely need to be able to add a second copy of MediaWiki as well to run the fundraising branch.

I'm not sure there is a graceful answer to organizing this growing mass of code. Personally I'd vote to move all of the code (including MediaWiki) under either /vagrant/srv or /vagrant/src and clean up the top level directory for deploys running a lot of roles tremendously. /vagrant/srv has strong parallels to layout used on the WMF production cluster but that is a trivial detail.

Another service coming with T91661: Have a RESTbase vagrant role and I realized today that in addition to being hid inside the VM, Parsoid is not updated by git-update or any other means.

Oh naming things... I don't want to keep bike shedding this so if anyone has objections to /vagrant/srv (it seems we're 50/50) speak now or forever hold your peace.

Oh naming things... I don't want to keep bike shedding this so if anyone has objections to /vagrant/srv (it seems we're 50/50) speak now or forever hold your peace.

Yes. I don't really care

Oh naming things... I don't want to keep bike shedding this so if anyone has objections to /vagrant/srv (it seems we're 50/50) speak now or forever hold your peace.

+1 for /vagrant/srv . Seems the most-obvious choice, and just remaps the /srv structure into /vagrant consistently.

dduvall triaged this task as High priority.Mar 11 2015, 4:23 PM

Change 200624 had a related patch set uploaded (by Dduvall):
Install non-vendor services to /vagrant/srv

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

Change 200624 merged by jenkins-bot:
Install non-vendor services to /vagrant/srv

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

Has anyone tested this with SMW?
After the update I get the following message while running update.php

wiki:  #!/usr/bin/env php
PHP Warning:  include(/srv/vagrant/mediawiki/extensions/SemanticMediaWiki/includes/src/MediaWiki/Jobs/UpdateJob.php): failed to open stream: No such file or directory in /srv/vagrant/mediawiki/vendor/composer/ClassLoader.php on line 412
PHP Stack trace:

Has anyone tested this with SMW?
After the update I get the following message while running update.php

wiki:  #!/usr/bin/env php
PHP Warning:  include(/srv/vagrant/mediawiki/extensions/SemanticMediaWiki/includes/src/MediaWiki/Jobs/UpdateJob.php): failed to open stream: No such file or directory in /srv/vagrant/mediawiki/vendor/composer/ClassLoader.php on line 412
PHP Stack trace:

We don't have a SemanticMediaWiki role as far as I can tell. This doesn't look like anything that should have been broken by this particual set of Puppet changes however.

bd808 moved this task from In Progress to Done on the MediaWiki-Vagrant board.