General developer forum

MoodleBox - A Vagrant local development environment

 
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.
Picture of Heitor Silva
MoodleBox - A Vagrant local development environment
 

Hello guys! How are you?

I've made a simple Vagrant box, to run Moodle 3, and to be a development machine ready for other PHP developers...

You can check the code here: https://github.com/olivatecnologia/vagrant-moodlebox

It's a simpler version, compared to Moodle Hat and PuppetLamp.

You can check these other two projects on the links below:

https://github.com/mackensen/moodle-hat

https://github.com/rlorenzo/puppet-lamp

Happy coding, and best regards!

 
Average of ratings: Useful (2)
Picture of Marcus Green
Re: MoodleBox - A Vagrant local development environment
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developersGroup Testers

<humour>

I'm sorry Heitor, your post cannot be accepted because it contains too much implausible jargon

https://moodle.org/mod/forum/discuss.php?d=323570

</humour>

 
Average of ratings: -
Picture of Eric Merrill
Re: MoodleBox - A Vagrant local development environment
Group Core developersGroup Plugin developers

Very nice.

You may want to look at adding Solr, so people can test against Global Search.

 
Average of ratings: -
Picture of Heitor Silva
Re: MoodleBox - A Vagrant local development environment
 

Eric,

why don't you open an Issue on github, and I'll be glad to make that when I have the time!

;)

thx for the suggestion!!!

 
Average of ratings: Useful (1)
Picture of Eric Merrill
Re: MoodleBox - A Vagrant local development environment
Group Core developersGroup Plugin developers

pssshhhh - wanting it done the right way. What is wrong with you wink

 
Average of ratings: -
Picture of john attwood
Re: MoodleBox - A Vagrant local development environment
 

How can I move that image up to my Google GCE account.  I guess I will have to do it myself and write up the instructions.


 I want to get this going for setup to run one Moodle locally with intermittent power and internet and have one on my Google Cloud Compute. Once I get both up I will use Virtsync to keep them updated. 



Well... I cannot connect to the vagrant VM  on my Centos7 host...it list vboxnet0 as 192.168.1.1 I tried both 1 and 2 neither work. 

I can ssh... maybe nginx server not up ... but it should be up right ?  Wait I read documentation and it say nginx usually not start by itself ?

sudo service nginx start doesn't work but I don't know where it is. 


Ok i confirmed nginx is up but ?????? mysql is also up ??? what's left ................. why cant i connect....


No firewall

No Selinux .............still no moodle. 

 
Average of ratings: -
Picture of john attwood
errors
 
 default: fatal: destination path '/home/vagrant/.nodenv' already exists and is not an empty directory

I

fatal: destination path '/home/vagrant/.nodenv/plugins/node-build' already exists and is not an empty directory.


cannot find this directory.

Job for mysql.service failed. See 'systemctl status mysql.service' and 'journalctl -xn' for details.


I checked an mysql was up

maybe i just go home for the day.

 
Average of ratings: -
Picture of Tomasz Muras
Re: MoodleBox - A Vagrant local development environment
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developersGroup Plugins guardiansGroup Translators

I have created yet another vagrant box for moodle + moosh development: http://moosh-online.com/dev/.

It seems to me that we should join the forces and create The Ultimate Moodle Vagrant Dev Box. Or at least share the scripts for installing various bits (like Moodle, moosh, phpmyadmin).

 
Average of ratings: -
Picture of Daniel Neis Araujo
Re: MoodleBox - A Vagrant local development environment
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developersGroup Translators

Very nice vagrant box with moosh!

I was just wondering why use "bento/ubuntu-16.06" instead of "ubuntu/xenial64" ...


Moodle Hat seems to be nice as it have Selenium + Behat + PHPUnit installed as well, but it uses Puppet to install things and altough it may be nice to have it in your environment, most people are not used to it and it insert some "indirections" when you are already using a vagrantfile to define what will be available, even when it is one more provision to setup instead of plain bash scripts. This project also "customizes" the virtual machine to use 4096MB of RAM that may be too much for some developers


The one by Heitor Silva, that started the thread, installs nodejs and some of its modules and also make some configuration for the vim editor and other things that makes that box looks a little personal. It also uses nginx with php-fpm instead of the more traditional apache server. With it, you also have to access the the url /moodle of your virtual machine instead of having it in the document root, that for me is a downside.


The puppet-lamp projects uses a CentOS image, and requires the user to create the database and a user for it after the setup, that seems to be not needed as the other solutions provide it. They do not support composer and states that they will need to create another vagrantbox for that. But they use composer to download and install some dependencies for their own version of Moodle. They are more modest setting the memory to 1024MB only and also use puppet to setup things. It seems they install clamav, shifter, tex and something related to mediawiki.


It would be even better if we have a Moodle official Vagrantfile ... are there a tracker issue for that already?



 
Average of ratings: -
Picture of Daniel Neis Araujo
Re: MoodleBox - A Vagrant local development environment
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developersGroup Translators

A fix:

"The puppet-lamp project ... do not support behat " (not composer, as said).

 
Average of ratings: -
Picture of Tomasz Muras
Re: MoodleBox - A Vagrant local development environment
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developersGroup Plugins guardiansGroup Translators

I have had problems setting up my box with Vagrant + ubuntu/xenial64, so I went with bento after the recommendation here.

I didn't want to use puppet, to keep it simple - the installation is so simple that it seems to me like puppet would be unnecessary extra layer. The same with php-fpm - standard apache with mod_php should be good for dev environment. I also prefer mod_php because it will support $CFG->apacheloguser setting.

Why i susing  /moodle directory to access Moodle installation inside your VM a problem for you?

 
Average of ratings: -
Picture of Daniel Neis Araujo
Re: MoodleBox - A Vagrant local development environment
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developersGroup Translators

Oh, it is not a problem, at all, it is just a "downside" because i think its quicker to only type localhost:8080 than localhost:8080/moodle on the address bar, even if it gets "memorized" by the browser, its simpler, because you don't expect to have another app running on the same box.

=)

 
Average of ratings: -
Picture of Johannes Burk
Re: MoodleBox - A Vagrant local development environment
 

I'm currently learning about vagrant (and docker) and try to find a way that best fits my needs for moodle plugin development. This way I've found your thread. Thank you for sharing your work with the community!

I wanted to comment/suggest just a few things. As I understand it what you have build is a Vagrant Project and not a Vagrant Box, isn't it? (see https://www.vagrantup.com/docs/boxes.html). I thinking about creating a Moodle Vagrant Box. This would bring the advantage of easily setting up additional instances when needed for different projects.

It may be more comfortable to not have the Moodle code included in the repository as a zip file but clone the Moodle repository on provisioning. And when the moodle directory would be a vagrant synced folder it would be easy to use an IDE or editor on the host machine for development.

 
Average of ratings: -