Closed Bug 682591 Opened 12 years ago Closed 11 years ago

add vagrant/puppet config for tbpl

Categories

(Tree Management Graveyard :: TBPL, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: rhelmer, Assigned: rhelmer)

References

Details

Attachments

(3 files, 1 obsolete file)

I've started this already to test bug 682059:
https://github.com/rhelmer/tbpl/tree/master/vagrant

It looks pretty straightforward to get a TBPL environment running. It will depend the real buildbot/tinderbox/bugzilla/hgpushlog/etc. being available, but will be standalone besides that and so should be useful for development.
(In reply to Robert Helmer [:rhelmer] from comment #0)
> I've started this already to test bug 682059:
> https://github.com/rhelmer/tbpl/tree/master/vagrant

BTW rebuilt my repo (so it's a fork of /mozilla/tbpl) and put this on it's own branch:

https://github.com/rhelmer/tbpl/tree/vagrant-bug-682591/vagrant
I had never heard of vagrant before - looks awesome!

Unfortunately I couldn't get the tbpl vagrant setup to work; "vagrant up" failed:

[default] Running Puppet with init.pp...
[default] stdin: is not a tty
[default] err: /Stage[main]/Tbpl-base/Package[build-essential]/ensure: change from purged to present failed: Could not set 'present on ensure: Read-only file system - /tmp/puppet20110902-1151-mgjos4-0 at /tmp/vagrant-puppet/manifests/classes/tbpl-base.pp:97
[default] 
[default] err: /Stage[main]/Tbpl-base/Package[python-tz]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install python-tz' returned 100: W: Not using locking for read only lock file /var/lib/dpkg/lock
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 
[...]
(In reply to Markus Stange from comment #2)
> I had never heard of vagrant before - looks awesome!
> 
> Unfortunately I couldn't get the tbpl vagrant setup to work; "vagrant up"
> failed:
> 
> [default] Running Puppet with init.pp...
> [default] stdin: is not a tty
> [default] err: /Stage[main]/Tbpl-base/Package[build-essential]/ensure:
> change from purged to present failed: Could not set 'present on ensure:
> Read-only file system - /tmp/puppet20110902-1151-mgjos4-0 at
> /tmp/vagrant-puppet/manifests/classes/tbpl-base.pp:97


This sounds like something went wrong in the VM ^ ("Read-only file system")

What version of Virtualbox are you using and on which OS? 

Might want to just try it again ("vagrant destroy && vagrant up"), really shouldn't happen though :)
(In reply to Robert Helmer [:rhelmer] from comment #3)
> What version of Virtualbox are you using and on which OS? 

VirtualBox 4.1.2 r73507 on Mac OS X Lion 10.7.1 (11B26)

> Might want to just try it again ("vagrant destroy && vagrant up"),

I tried once, but I'll try again.

Maybe my machine just doesn't have enough RAM (2GB). It did lock up completely during the process. Though I'd have expected a different kind of error message in that case.
(In reply to Markus Stange from comment #4)
> (In reply to Robert Helmer [:rhelmer] from comment #3)
> > What version of Virtualbox are you using and on which OS? 
> 
> VirtualBox 4.1.2 r73507 on Mac OS X Lion 10.7.1 (11B26)


I know there were virtualbox problems with Lion when it came out, I'll ask on the vagrant group (https://groups.google.com/forum/#!forum/vagrant-up)


> > Might want to just try it again ("vagrant destroy && vagrant up"),
> 
> I tried once, but I'll try again.
> 
> Maybe my machine just doesn't have enough RAM (2GB). It did lock up
> completely during the process. Though I'd have expected a different kind of
> error message in that case.

That should be fine, looks like it only uses 384 MB by default.
One problem I've hit so far is that there seems to be a bug in Virtualbox NAT support such that FTP doesn't work. Can be worked around by temporarily setting the VM network in "bridged" mode, but this is a hassle (and vagrant doesn't support it, so you need to go into the Virtualbox GUI and remember to set/unset it).

I'll try to track down the specific bug on the Virtualbox side, but it seems like it might be easier to simply use http://ftp.m.o instead of the actual FTP protocol :) Any reason why it uses FTP not HTTP?
Good news: I've tried it again under 10.6 with VirtualBox 4.1.0 and it works! :)

What command do I need to run when I want to sync my changes from /home/tbpl/dev/tbpl/ to /var/www/tbpl/? Do I need to type the whole
/usr/bin/rsync -av --exclude=".git" /home/tbpl/dev/tbpl/ /var/www/tbpl/
command every time or has the puppet thing installed a shortcut for me?
Attached patch use passive ftpSplinter Review
(In reply to Robert Helmer [:rhelmer] from comment #6)
> One problem I've hit so far is that there seems to be a bug in Virtualbox
> NAT support such that FTP doesn't work. Can be worked around by temporarily
> setting the VM network in "bridged" mode, but this is a hassle (and vagrant
> doesn't support it, so you need to go into the Virtualbox GUI and remember
> to set/unset it).

Does this patch make it work?

> I'll try to track down the specific bug on the Virtualbox side, but it seems
> like it might be easier to simply use http://ftp.m.o instead of the actual
> FTP protocol :) Any reason why it uses FTP not HTTP?

No important reason, it just seemed more natural to me.
(In reply to Markus Stange from comment #7)
> Good news: I've tried it again under 10.6 with VirtualBox 4.1.0 and it
> works! :)

\o/


> What command do I need to run when I want to sync my changes from
> /home/tbpl/dev/tbpl/ to /var/www/tbpl/? Do I need to type the whole
> /usr/bin/rsync -av --exclude=".git" /home/tbpl/dev/tbpl/ /var/www/tbpl/
> command every time or has the puppet thing installed a shortcut for me?

Puppet just does that rsync command, that's probably the easiest way. We could drop a Makefile in there to be able to do "make install".

Right now I have puppet drop and recreate the DB each time it runs, which you probably don't want to do just to push a change :) 

So far I have just been using rsync.
(In reply to Markus Stange from comment #8)
> Created attachment 560234 [details] [diff] [review]
> use passive ftp
> 
> (In reply to Robert Helmer [:rhelmer] from comment #6)
> > One problem I've hit so far is that there seems to be a bug in Virtualbox
> > NAT support such that FTP doesn't work. Can be worked around by temporarily
> > setting the VM network in "bridged" mode, but this is a hassle (and vagrant
> > doesn't support it, so you need to go into the Virtualbox GUI and remember
> > to set/unset it).
> 
> Does this patch make it work?

I did try doing passive mode (makes sense that we would need it since it's using NAT after all), but would not hurt to check again.

I looked into it a bit and found some open Virtualbox bugs about passive FTP not working through NAT, I haven't been following very closely. I am holding out hope that it'll just be fixed eventually.

Just took another look, here is an example (there are some earlier closed ones but this is still open) http://www.virtualbox.org/ticket/4427

> > I'll try to track down the specific bug on the Virtualbox side, but it seems
> > like it might be easier to simply use http://ftp.m.o instead of the actual
> > FTP protocol :) Any reason why it uses FTP not HTTP?
> 
> No important reason, it just seemed more natural to me.

I'll take a stab at moving it to HTTP if that's ok.
(In reply to Robert Helmer [:rhelmer] from comment #10)
> > > I'll try to track down the specific bug on the Virtualbox side, but it seems
> > > like it might be easier to simply use http://ftp.m.o instead of the actual
> > > FTP protocol :) Any reason why it uses FTP not HTTP?
> > 
> > No important reason, it just seemed more natural to me.
> 
> I'll take a stab at moving it to HTTP if that's ok.

Sure.
Assignee: nobody → rhelmer
Status: NEW → ASSIGNED
Attached patch add vagrant+puppet to tbpl repo (obsolete) — Splinter Review
This has a bunch of improvements over the previous iteration:

* support vagrant 1.0, setup is much simpler
* no "install" step necessary
** checkout on the host is shared directly to the webserver inside the VM

Once vagrant and virtualbox are installed, all you need to do is run "vagrant up" and set up /etc/hosts .. from then on, all changes you make in your tbpl checkout will just show up in http://tbpl without any further ado.

I've also included a file in puppet/ubuntu-bootstrap.sh which allows you to spin up TBPL using the puppet manifests in a non-vagrant environment, such as AWS or your local box etc.
Attachment #609393 - Flags: review?(mstange)
Same as comment 12 but fix typo in the ubuntu-bootstrap.sh (could use help testing this, if anyone is interested)
Attachment #609393 - Attachment is obsolete: true
Attachment #609393 - Flags: review?(mstange)
I've tested it and it works amazingly well.
Oh, I've only tested the vagrant part, not the ubuntu-bootstrap part.
(In reply to Markus Stange from comment #14)
> I've tested it and it works amazingly well.

(In reply to Markus Stange from comment #15)
> Oh, I've only tested the vagrant part, not the ubuntu-bootstrap part.

Cool, I'll do a quick run of that before pushing it.
Went ahead and pushed:
http://hg.mozilla.org/users/mstange_themasta.com/tinderboxpushlog/rev/5ecd437e9ba4

I've used something very similar to the bootstrap script in the past, I will test it and do a followup if it has any problems.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
This is a docs-only followup to mention that Vagrantfile expects NFS to be installed, and to mention Vagrant in the main README file.
Attachment #610707 - Flags: review?(rhelmer)
Attachment #609397 - Attachment is patch: true
Comment on attachment 610707 [details] [diff] [review]
followup: some additional docs

indeed!
Attachment #610707 - Flags: review?(rhelmer) → review+
Filed bug 740648 to follow up on FTP+NAT problems in the VM that prevent the logs from loading.
Depends on: 743595
Product: Webtools → Tree Management
Product: Tree Management → Tree Management Graveyard
You need to log in before you can comment on or make changes to this bug.