This project will set up the test and demonstration environment for Stucco using Vagrant. Linux and Mac OS X are supported.
- Download VirtualBox for your OS and install. (Tested with version 4.3.x.)
- Download Vagrant for your OS and install. (Tested with version 1.7.x.)
- Download Ansible. (Tested with version 2.0.x.). (Ansible requires Python 2.6.)
- Get this repo from github :
git clone https://github.com/stucco/dev-setup.git stucco && cd stucco
. - Start the VM:
vagrant up
- Open a web browser to
http://10.10.10.100:8000/
. Not all data will be there right away, it takes some time to load everything. Start on the help page. (The default Vagrant IP address is 10.10.10.100; if you change it, change the URL.)
Run vagrant ssh
to log into the VM. The stucco project will be in /stucco
and/or stucco-shared
(see below).
If you want to set an IP address, use the VM_IP
environment variable before the vagrant up
command:
VM_IP="172.17.18.12" vagrant up
If you want to set hostname, use the VM_HOSTNAME
environment variable before the vagrant up
command:
VM_HOSTNAME="stucco-1" vagrant up
To access the VM from the host, use the host-only IP address defined at the top of the Vagrantfile
:
options = {
:ip => "10.10.10.100"
}
Networking is set up as host-only, so you will not be able to connect to the VM from another machine.
This Vagrantfile
assumes your machine can handle 10gb of memory and 4 cores dedicated to the virtual machine, if you need to lower this, edit the configuration options at the top of the Vagrantfile.
To stop/start the VM, the fastest approach is to use vagrant suspend
and vagrant resume
. You can also use vagrant halt
and vagrant up
, but this will completely rebuild the VM each time.
To cache some dependencies to make vagrant up
faster, install the Vagrant cache plugin to use a cache for downloaded software by running vagrant plugin install vagrant-cachier
.
To use Vagrant snapshots, see the 'Snapshots' page on the wiki. Install the Vagrant snapshot plugin by running vagrant plugin install vagrant-vbox-snapshot
.
If you want less verbose output from vagrant, you can change the log level:
VAGRANT_LOG=warn vagrant up
All Stucco components will be pulled from the repos on Github and built in the /stucco
directory. Each of the components will be started automatically. To confirm this, log into the VM (vagrant ssh
) and run sudo supervisorctl status
). Log files are in /var/log/supervisord/
.
To use this VM for development, vagrant will mount the parent directory of this project within the VM at /stucco-shared
. It is expected that you will have a directory structure where all of the repositories are in a common folder, so it looks like this:
- stucco
- dev-setup
- document-service
- collectors
- rt
- ui
The Github code is started by default, using supervisord. In order to use the repos from your host OS, you will need to change the paths for each of the stucco files in /etc/supervisor/conf.d
to /stucco-shared
, and reload the configurations (supervisorctl reload
), then restart the processes (supervisorctl start all
).
P.S.: Commands to run to complete installation (installation script is not running properly with new node v6, have to fix it):
$ vagrant ssh $ cd ../../stucco/ui $ sudo npm install $ sudo node run build $ sudo supervisorctl reload