With this guide you can deploy PYBOSSA using the Juju technology inside a Virtualbox Virtual Machine (VM) locally. We will use Vagrant as it will help us to setup the new VM. This should work on all supported OSes where Vagrant and Virtualbox run: Windows, OS X, GNU/Linux.
We use the local installation, but you can use any cloud provider supported by Juju. If you want to use a cloud provider, you only have to instruct Juju to use a specific cloud one. The charm will work in any of them without problems. Please check the official documentation for information about how to configure Juju for Amazon EC2 or Openstack.
We will install PYBOSSA in a local virtual machine so you can delete it afterwards if you want. This will ensure that your computer is not polluted with libraries that you will not need any future, containing everything within the virtual machine.
If you have access to a cloud service provider like Amazon EC2 or any Openstack solution, you can just skip this section. Be sure to configure juju with your cloud credentials. You can find more guides and cloud provider configurations here.
Install Vagrant and Virtualbox if they are not available on your machine.
Just install it using the package manager
sudo apt-get update sudo apt-get -y install virtualbox vagrant
You have two options to get the latest version of PYBOSSA Juju charm. You get a ZIP file with the latest version from this link: https://github.com/Scifabric/pybossa-jujucharm/archive/master.zip
Or you use git to clone it:
git clone https://github.com/Scifabric/pybossa-jujucharm.git
If you use the ZIP file, please unzip it before proceeding.
Go the source code folder
This is very easy:
SSH to the Vagrant box and stay in the VM
Prepare Juju for initial usage:
juju init juju switch local juju bootstrap
Install the Pybossa charm bundle which will install PYBOSSA charm and PostgreSQL charm and connect them to eachother.
juju deployer -c bundle.yaml
Once is installed, we can install PYBOSSA and connect both of them.
You can also install Redis and Sentinel at a later stage using Juju. This will allow you to add new Redis slave nodes as well as Sentinels to manage the Redis infrastructure using the load-balanced solution of Sentinel.
First you need to deploy at least two nodes of Redis: a master and a slave:
juju deploy cs:~juju-gui/trusty/redis-1 juju deploy cs:~juju-gui/trusty/redis-1 redis2
Then, you need link them:
juju add-relation redis:master redis2:slave
Now you can add the Sentinel
juju git-deploy Scifabric/redis-sentinel-jujucharm
If you don’t have the git-deploy command for juju, you can install it with these commands:
sudo apt-get install python3-pip sudo pip install juju-git-deploy
And monitor Redis master
juju add-relation redis-sentinel redis:master
Finally, you can link PYBOSSA to sentinel
juju add-relation pybossa redis-sentinel
For more info regarding the Juju charm for Sentinel, please check the official site.
Look for the machine IP of PYBOSSA service here:
Copy & Paste the IP and pass it to the following script
sudo natpybossa 10.0.3.x
Which will map the PYBOSSA server port to your localhost’s port 7000.
You can now view PYBOSSA in your browser:
PYBOSSA does not need an email server by default, but we encourage you to install one.
Sending email properly is a bit complicated, as nowadays you have configure several authentication methods so your emails are not marked as SPAM or black listed. This configuration involves not only modifying the config file of your email server, but also the DNS entries of your server so you can include the proper DKIM and SPF entries. Therefore, the Juju charm only installs a testing server.
Please, use the official documentation of your preferred server to configure the email properly.
This is an alternative way for mapping internal ports to the VM ones. Instead of using the shell scripts that you have seen before for NAT configuration, you can use sshuttle. In Ubuntu you can install it with apt-get or in OS X with Homebrew.
The Virtualbox network is only internally visible on the VM side. If you want to see it on your local browser you need to redirect the VBox network with your current network (make sure the 10.x.x.x is not already used!).
The VBox is typically on 10.0.3.xxx. Open a new console on your local machine and type:
sshuttle -r vagrant@localhost:2222 10.0.3.0/24
sshuttle maybe asks for local sudo password. If it asks for vagrant’s password:
Finally open your browser with the IP you got from
juju status and
If you prefer a graphical interface, you are covered. Juju provides a very nice web interface from where you can handle PYBOSSA services. To use it, follow these steps:
juju deploy juju-gui
When juju-gui is deployed (can take some time), the command will return a public IP. You can check the IP also with this command as well as the status of the deployment of the GUI:
Then, copy & paste the IP and pass it as an argument to the following script
sudo natgui 10.0.3.x
This file will map the Juju-GUI to your localhost’s port 8000, and return the password for your Juju-GUI. Copy the password, and open the Juju-GUI in your browser
If you’ve used Sentinel, Redis, PostgreSQL, HAProxy and PYBOSSA, your GUI should show something similar to this: