Jump to content

clsource
 Share

Recommended Posts

We've been using vagrant quite a lot in the past. It's a good way of ensuring everyone working in a Team has the same Serversetup as close to the live System as it can get. It has some performance and complexity drawbacks though. Currently we've mostly switched back to "good ol localhost" for most projects

  • Like 1
Link to comment
Share on other sites

We've been using vagrant quite a lot in the past. It's a good way of ensuring everyone working in a Team has the same Serversetup as close to the live System as it can get. It has some performance and complexity drawbacks though. Currently we've mostly switched back to "good ol localhost" for most projects

Please, Can you give a detailed example of the drawbacks of using Vagrant?

Thanks :)

Link to comment
Share on other sites

Please, Can you give a detailed example of the drawbacks of using Vagrant?

Thanks :)

Sure!

  • If you switch a lot between different projects you'll have to either start several instances or you'll "up" and "halt" them all the time: The first way is very "costly" in terms of performance, the second one in terms of time
  • The generated isos tend to be quite big (around 2.5 GB): If you're working on 20+ Projects you'll either have to constantly delete (and therefore re-init) them or waste a lot of disk-space 
  • We've experienced some rather standard setups to be very slow even if we gave them a crazy amount of Memory (4GB+). This was especially the case with larger ModX sites (which has a slow backend anyway)
  • On Windows (which we use for development) sometimes vagrant just keeped crashing on startup for unknown reasons
  • Crazy caching behaviour: We mounted our local work folders into the VM but sometimes they just won't get updated for minutes
  • Plus some very "Workflow related" issues that are not that important 
  • Like 4
Link to comment
Share on other sites

Vagrant is a great piece of software and for sure makes many things easier (as mentioned in the tao). It's just not fitting into OUR process and workflows.

If you're (for example) working on one or two bigger projects at the same time with a large team of people vagrant would be a perfect fit for that.

  • Like 2
Link to comment
Share on other sites

I'm using vagrant on a Linux box and am quite happy.

Only drawback is that file operations on the nfs mounted directory where my sites live are slow sometimes, especially when extracting archives through php.

Other than that I love it because I work on different boxes and have the same dev environment.

I stumbled across a vagrant box that has PW preinstalled but haven't used it yet.

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

I've heard quite a bit about it in the last couple of months, but tried it out myself just yesterday. It's great. I think I'm gonna switch to vagrant instead of my local env.
 

We've been using vagrant quite a lot in the past. It's a good way of ensuring everyone working in a Team has the same Serversetup as close to the live System as it can get. It has some performance and complexity drawbacks though. Currently we've mostly switched back to "good ol localhost" for most projects

If you're using your local env. for all projects you might as well just use one vagrant box for all projects. You'd still have the advantage of not messing up your local env. with crazy configurations.
 

  • Crazy caching behaviour: We mounted our local work folders into the VM but sometimes they just won't get updated for minutes

It'd be interesting to know if those issues are windows only.
 
To all who are using vagrant currently:
 
What are your workflows regarding mysql dumps? I tend to config a pre commit hook in my projects which dumps the database of the current PW install before committing.

Since the db is in the vagrant box, are there any issues getting a dump of a db from it? I haven't tried it out myself yet, I think it should be possible to just connect to the vagrant mysql server instead of the local one and dump the db from there.

  • Like 2
Link to comment
Share on other sites

  • 2 years later...

Hey.... 2 years later.... lol

    I decided yesterday that I was going to try out some sort of VM on my Windows 10 workstation at home. It had been in the back of my mind for some time but wasn't too high on the list. Thought it would be a good idea to reacquaint myself with some version of Linux in terms of PHP development, with Processwire of course :)  So anyway, for some reason I didn't stumble across Vagrant prior to searching these forums for Virtualbox to see what I could find. Once again the Processwire forums and their contributors have been a big help to me :) Thanks!

Link to comment
Share on other sites

I'm using it for all my development work. Makes setting up dev environments so much quicker and easier. No more manual installation of LAMP stack in my Linux box or fighting with WAMPP/XAMPP settings.

I have one vagrant box that hosts all of my PW projects. Then I have one that brings all I need for a Drupal project.

My main box is a remnant from the days where I was mainly doing Joomla projects. But it still works quite nice: https://github.com/joomlatools/joomlatools-vagrant

One of these days I want to put together a box solely for PW with wireshell etc. Just didn't have the time to pull it together.

Bernhard put a nice box together with some scripts for automatic PW installation and DB backups: https://github.com/BernhardBaumrock/vagrant-pw-lamp

  • Like 4
Link to comment
Share on other sites

I find things like laravel valet + php-version much more interesting for a simple dev environment compared to vagrant or docker. At least if you just need a PHP version and something mysql. For setups more involved with the infrastructure I'd also rather suggest trying Docker today, as it's Native-App Beta is doing great and the speed improvement and deployment options are just far superior. The only reason I'm currently still developing on a vm is that I'm working on different machines and don't want to hassle with updating the database back and forth. Put the vm on an external drive and done :D

  • Like 4
Link to comment
Share on other sites

Update on Vagrant on WIndows 10

  Yeh.. umm.. not such a great experience with Vagrant and Virtualbox yesterday. I've been in sort of a slump lately when it comes to installing new software LOL :). Seems to be an issue with Virtualbox on running the guest in full screen mode, if host is windows 10. Supposedly to use full screen mode, it seems you have to install something called 'Virtual Box Guest Additions'. Apparently there's a problem with installing it on windows 10 (big surprise there :P ). I found a suggestion to run it under Windows 8 compatibility. That didn't help. The screen is not THAT small, I decided to live with it for now. I'll pretend I'm running it on a 15" laptop : :lol: 

Ran into issues with Vagrant also. Seemed I had bad luck picking pre-defined boxes. I'll spare everyone the boring details. I decided to just let it sit for now.

At the moment, I have Debian 8 running on Virtualbox, no Vagrant involved. It took 'longer than expected' to install. From what I saw after Googling, that seems to be the norm, so OK, I let it run. Seems to be fine for now. Will maybe try Ubuntu in the not too distant future. Where I work, it's primarily Windows, so I don't have anyone to call and ask for some recommendations on which flavor of Linux to go with. I saw Mint was recommended. I tried that, but sure enough, there was some sort of 'video rendering' issue. Some screen flickering, etc .. so I decided to pass on it for now. I will add Docker to the list of things to check out. Thank you LostKobrakai .

Anyway, if you have Windows 10 your mileage may vary. Have a good one.

Link to comment
Share on other sites

update: i'm using laragon now and love it! see this post: 

!!! OUTDATED !!!

i'm using vagrant on win10 for all my development too. i really like it once you have the hassle of setup done. i'm now using scotchbox - i don't use the repo gebeer linked to.

here is my new one: https://gitlab.com/baumrock/vagrant-pw-lamp/tree/master

sorry, no time for documentation right now, but the readme from the old repo should also have some useful informations (as already linked by gebeer): https://github.com/BernhardBaumrock/vagrant-pw-lamp

on win8 i had to switch GUI mode to OFF otherwise it didn't work. on win10 it was the contrary ^^ i'm too busy right know to give more help. gebeer and i have been talking about vagrant and pw development quite for some time now but it all seems too experimental to really recommend our setups to someone else...

but if you want to try and have some specific questions please let me know :)

some nice things i like and why i am using it:

  • have a linux sandbox
  • setup projects with "real" hosts in seconds; my workflow is like this:
  • then i have my machine ready and can access my linux server on example.dev
    mailcatcher will catch all emails, so i can also test all email stuff, even when i'm offline
  • i can do "grabpw" and get a fresh install of PW to choose from master/dev/devns
  • i can do "backup" at any time, that will backup files + db
  • i can do "restore", so i can move projects from one device to another
  • i can even do "push" or "pull" of the whole website from my live server to my vagrant box, but that's a bit experimental :)

when i'm done with the project i do "vagrant destroy", it will backup everything and keep only 1 backup and destroy the machine. so i don't mess up my host system with lots of GB of VMs

ps: sorry i just realized that my repo is private... i can't make it public atm but you can pm me if you are interested

  • Like 6
Link to comment
Share on other sites

@Bill C

Depending on your knowledge in managing linux servers Docker might not be a good fit. It does make things easier for experienced people, but if you're just getting into it it's just another complex layer. 

  • Like 1
Link to comment
Share on other sites

I personally love it for the modularity and interchangability of containers (and thus: features). So exchanging PHP to HHVM is an easy task. Vagrant is (imo) too "monolithic", but I think a little more easy to set up, especially with puphpet et al. Docker on the other hand can be quite cumbersome if you want your own containers, re-compile apps etc pp

  • Like 1
Link to comment
Share on other sites

I'm with bernhard on using Scotchbox. I started using it a while back and it was a great entry point to learning the not so mysterious methods of Vagrant. Plus, I've always been a fan of Ubuntu but being mobile is a must so I've learned to enjoy its presence as a VM on all my Windows devices. I use Scotchbox across Win 7 to Win 10 on multiple devices including Surface Pros and it has always worked out of the box. Once projects are done I just destroy the box because I push everything to GitHub anyway. I used to configure each VM myself in VirtualBox and got those same problems with Guest Additions. It is usually caused by mismatched versions between it and the VirtualBox installation.

  • Like 2
Link to comment
Share on other sites

 Share

×
×
  • Create New...