Install

This is a work in progress document

Keep in mind that we can't run Pillar as a standalone app, rather we need to create an app based on it.

Setting up the enviroment

Before getting started with Pillar, some system requirements need to be satisfied. The system requirements are the following:

  • Python 3.6
  • MongoDB
  • Redis
  • RabbitMQ
  • gulp (NPM package)
  • a /data/storage directory writable by the user

Step by step setup

A suggested way to get them up and running is:

Install Docker

# Ubuntu Linux (after adding Docker's APT repository)
sudo apt-get install docker-ce

# macOS
go to the official docker website

Install Python 3.6 and 3.6-dev

# Ubuntu Linux
sudo apt-get install python3.6{,-dev}

# macOS
brew install python3.6

Install virtualenvwrapper (and check the configuration steps)

# Ubuntu Linux:
sudo apt-get install virtualenvwrapper

# Others:
sudo pip install virtualenvwrapper

Create and activate a virtual enviroment for the project using Python 3.6

mkvirtualenv blender-cloud -p python3.6

Install NPM

# Ubuntu Linux
sudo apt-get install nodejs-legacy

# macOS
brew install node

Create writable data directory and chown it to the user

sudo mkdir -p /data/storage
sudo chown you:yourgroup /data/storage

Set up various Docker containers with the requirements

docker run -d -v /data/db:/data/db -p 27017:27017 --name mongo mongo
docker run -d -p 6379:6379 --name redis redis
docker run -d -p 5672:5672 --name rabbit rabbitmq

Append the following names to the line in /etc/hosts that contains 127.0.0.1, after localhost: rabbit mongo redis pillar

Getting the sources

  • Clone pillar
  • Clone pillar-sdk
  • Clone startup repo with the application code
  • pip install -r requirements-dev.txt
  • npm install both in pillar and in app
  • run ./gulp in pillar and app

Configuration

  • make a config local and add
    • SECRET_KEY
    • PREFERRED_URL_SCHEME = 'http' to prevent absoulte redirects to use https

Init db with basic user, groups and project

manage.py setup setup_db your_email
  • add MAIN_PROJECT_ID to config

Create urler account

manage.py setup create_urler_account your_email+urler

Add URLER_SERVICE_AUTH_TOKEN

Run tests

py.test
# Init the users index (and index existing users)
manage.py operations index_users_rebuild