Page MenuHomePhabricator

Ram and port forwarding broken again
Closed, ResolvedPublic

Description

Ram and port forwarding broke again for me this afternoon so I decided to do a from scratch setup - clone mediawiki-vagrant and follow the instructions and everything. I created the machine, added the cirrus role, reprovisioned it, and the port forward and ram change are not taking effect no matter how many times I vagrant provision or vagrant reload.


Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=69131

Details

Reference
bz69720

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:41 AM
bzimport set Reference to bz69720.

Nik clarified on irc that the settings he's not seeing take effect are the ones set by the cirrussearch role.

I added a bunch of logging to my mediawiki-vagrant plugin to try and debug this. Unfortunately I can't recreate the problem.

For me, settings in .settings.yaml made with vagrant configure vagrant_ram N work. Settings in vagrant.d/10-cirrussearch.yaml also work.

Note that vagrant config --get vagrant_ram will not show values which are set via vagrant.d/*.yaml as it only reads data from .settings.yaml.

Created attachment 16232
Hacky debug logging patch for lib/mediawiki-vagrant/settings.rb

Apply patch and run ./setup.sh to activate. You should get a lot of messages to stdout describing the activity of settings resolution.

Attached:

Looking at the coercion of vagrant_ram and the order in which settings files are loaded (vagrant.d/*.yaml then .settings.yaml), a setting in the latter will always take precedence.

We can either: 1) change the order so that entries from vagrant.d override those from .settings.yaml; or 2) change the coercion for vagrant_ram to take the greater of the old or new value—currently, it takes the greater of the new and _default_ value. Keep in mind that option 2 introduces the side effect that one can't lower vagrant_ram; it can only go up!

I'm not sure why forward_ports would break in this same way but I'll take a closer look.

(In reply to Dan Duvall from comment #4)

  1. change the coercion for vagrant_ram to take the greater of the old

or new value—currently, it takes the greater of the new and _default_
value. Keep in mind that option 2 introduces the side
effect that one can't lower vagrant_ram; it can only go up!

I'm pretty sure that this was my original logic (take the largest value found anywhere). Who wants less ram? :)

Easy enough! I'll submit a patch.

FWICT, foward_ports in .settings.yaml _is_ being merged correctly with the hash in vagrant.d/10-cirrussearch.yaml.

Change 154975 had a related patch set uploaded by Dduvall:
Use the largest of all configured vagrant_ram values

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

So I just checked .settings.yml and now it has the right stuff in it - 2GB of ram and the port forwarding. I don't know what it had before but _something_ put the right stuff in it now. And reloading the vm added the ram and set up the port forwarding. I really have no idea why it wasn't taking before.

Change 154975 merged by jenkins-bot:
Use the largest of all configured vagrant_ram values

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