-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cloud quickstart instructions and scripts
- Loading branch information
Showing
4 changed files
with
109 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# UrbanFootprint Cloud Installation | ||
|
||
These are the recommended steps for getting up and running with a demo UrbanFootprint production instance on a cloud server. | ||
|
||
## Prerequisites | ||
|
||
You'll need: | ||
|
||
* A dedicated server running [Ubuntu 14.04](https://wiki.ubuntu.com/TrustyTahr/ReleaseNotes) that you have ssh access to. On AWS, we recommend *"Ubuntu Server 14.04 LTS (HVM), SSD Volume Type"* | ||
* A user account with root privileges (usually via sudo). | ||
|
||
We recommend at least 2 CPUs and 8GB of RAM. On AWS, select t2.large or larger [instance type](https://aws.amazon.com/ec2/instance-types/). | ||
|
||
## Installation | ||
|
||
We provide a "quickstart" script that handles installing all dependencies and pre-loads a sample data set. | ||
|
||
wget https://raw.githubusercontent.com/CalthorpeAnalytics/urbanfootprint/master/quickstart.sh | ||
chmod +x quickstart.sh | ||
sudo ./quickstart.sh | ||
|
||
Expect this script to take 15-20 minutes to complete. You'll know it's done when you see something like this: | ||
|
||
******************************************************************** | ||
******************************************************************** | ||
|
||
UrbanFootprint quickstart is complete. Open your web browser to: | ||
http://<YOUR-IP-HERE>/ | ||
using the following default credentials: | ||
user: [email protected] | ||
pass: admin@uf | ||
|
||
******************************************************************** | ||
******************************************************************** | ||
|
||
|
||
# Using UF | ||
|
||
## Login with the default login | ||
|
||
The quickstart script will attempt to detect the public IP address of the server and print out a URL to use. If that doesn't work, determine the server's IP address using your cloud provider's tools and put the IP address in your web browser's location bar. | ||
|
||
When you first access your UF instance, you will be directed to the login page. | ||
Login credentials are the following: | ||
|
||
>username: `[email protected]` | ||
>password: `admin@uf` | ||
For information on how to create new users, please reference the | ||
[User Manager](http://urbanfootprint-v1.readthedocs.io/en/latest/user_manager/) section of the documentation. | ||
|
||
## User Guide | ||
|
||
[http://urbanfootprint-v1.readthedocs.io/en/latest/](http://urbanfootprint-v1.readthedocs.io/en/latest/) | ||
|
||
Copyright (C) 2016 [Calthorpe Analytics](http://calthorpeanalytics.com/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,39 +10,67 @@ echo "********************************************************************" | |
echo "********************************************************************" | ||
echo "" | ||
|
||
# working directory for all UF command | ||
cd /srv/calthorpe/urbanfootprint | ||
apt-get update | ||
apt-get install -y software-properties-common | ||
apt-add-repository -y ppa:ansible/ansible-1.9 | ||
apt-get update | ||
apt-get install -y ansible git | ||
mkdir -p /srv/calthorpe/ | ||
|
||
# clone urbanfootprint repos | ||
cd /srv/calthorpe/ | ||
git clone https://github.com/CalthorpeAnalytics/urbanfootprint.git urbanfootprint | ||
git clone https://github.com/CalthorpeAnalytics/urbanfootprint-configuration.git urbanfootprint-configuration | ||
cd /srv/calthorpe/urbanfootprint/ | ||
git submodule init | ||
git submodule update | ||
|
||
# run ansible provisioning | ||
cd /srv/calthorpe/urbanfootprint/provisioning | ||
ansible-galaxy install -f -r galaxy-roles.yml | ||
ansible-playbook -v -i 'localhost', -c local site.yml | ||
|
||
# let calthorpe user ssh in for fabric | ||
su - calthorpe -c "ssh-keygen -f ~/.ssh/id_rsa -N ''" | ||
su - calthorpe -c "ssh-keyscan -H localhost > ~/.ssh/known_hosts" | ||
su - calthorpe -c "cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys" | ||
|
||
# set file permissions | ||
chown -R calthorpe:calthorpe /srv/calthorpe/urbanfootprint* | ||
|
||
# stop all services | ||
sudo supervisorctl stop all | ||
sudo service supervisor stop | ||
sudo service postgresql restart | ||
supervisorctl stop all | ||
service supervisor stop | ||
service postgresql restart | ||
|
||
# install python dependencies | ||
pip install -r requirements.txt | ||
# install python dependencies (though really all we need is fabric as this point) | ||
/srv/calthorpe_env/bin/pip install -r /srv/calthorpe/urbanfootprint/requirements.txt | ||
chown -R calthorpe:calthorpe /srv/calthorpe_env | ||
|
||
# copy sample environment settings for default configuration | ||
cp .env.sample .env | ||
cp /srv/calthorpe/urbanfootprint/.env.sample /srv/calthorpe/urbanfootprint/.env | ||
chown calthorpe:calthorpe /srv/calthorpe/urbanfootprint/.env | ||
|
||
# retrieve sample web database | ||
wget -O urbanfootprint-sacog-web-db.sql.gz https://s3-us-west-2.amazonaws.com/uf-provisioning/urbanfootprint-sacog-web-db.sql.gz | ||
gunzip -f urbanfootprint-sacog-web-db.sql.gz | ||
wget -O /srv/datadump/urbanfootprint-sacog-web-db.sql.gz https://s3-us-west-2.amazonaws.com/uf-provisioning/urbanfootprint-sacog-web-db.sql.gz | ||
gunzip -f /srv/datadump/urbanfootprint-sacog-web-db.sql.gz | ||
|
||
# import sample web database | ||
psql -U postgres -c "DROP DATABASE IF EXISTS urbanfootprint;" | ||
psql -U postgres -c "CREATE DATABASE urbanfootprint;" | ||
psql -U postgres -c "GRANT ALL ON DATABASE urbanfootprint TO calthorpe;" | ||
psql -U postgres urbanfootprint < urbanfootprint-sacog-web-db.sql | ||
psql -U postgres urbanfootprint < /srv/datadump/urbanfootprint-sacog-web-db.sql | ||
|
||
# finish installation and deployment process | ||
fab -f footprint/installer localhost quickstart | ||
su - calthorpe -c "/srv/calthorpe_env/bin/fab -f /srv/calthorpe/urbanfootprint/footprint/installer localhost quickstart" | ||
|
||
external_ip=$(curl -s 'https://api.ipify.org') | ||
echo "" | ||
echo "********************************************************************" | ||
echo "********************************************************************" | ||
echo "" | ||
echo " UrbanFootprint quickstart is complete. Open your web browser to:" | ||
echo " http://localhost:3333/footprint/" | ||
echo " http://${external_ip}/" | ||
echo " using the following default credentials:" | ||
echo " user: [email protected]" | ||
echo " pass: admin@uf" | ||
|