Skip to content

Installation on Mac

ahwitz edited this page Feb 21, 2014 · 32 revisions

RabbitMQ

Rodan uses Celery for performing all image manipulation operations. Celery uses the RabbitMQ back-end for message passing. Visit http://www.rabbitmq.com/download.html for instructions on installation.

Salt-Minion and various dependencies

  • Follow http://docs.saltstack.com/topics/installation/osx.html.
  • We recommend using python and zmq installed via homebrew so that your account owns all the files involved.
  • Install dependencies and run pip install salt to get both the Salt-Master and Salt-Minion packages. You will not need Salt-Master, but there's no way to only install minion.

Salt configuration

Starting Salt-Minion

  • Enter sudo salt-minion --log-level=debug in a new Terminal tab to get debug statements. Starting the salt-minion with the master IP in its conf file will immediately send an authentication request to the master to let it know that a new machine is listening.

Acknowledging the minion and starting the first step

  • SSH into the master (account name is ddmaluser, ask someone for the password) and run the following commands:
$ sudo salt-key -L
    (this should give you a list of all accepted minions and all unaccepted minions, you should see your machine under unaccepted)
$ sudo salt-key -A
    (this should accept all minions' requests for authentication)
$ sudo salt-key -L
    (note the machine that you just authenticated and make sure it's under "Accepted Keys")
$ sudo salt '(name)' state.sls stepOne
    (where (name) is the name of the minion you want to communicate with, single quotes are needed in the final command)

This step takes a little bit.

Between the Salt files

Salt can not handle interactive bash scripts, so we have a few that you need to take care of. After this has finished running, you'll see a bunch of (hopefully) green and blue pop up on the master's SSH window with a list titled "Summary" with subheaders "Succeeded" and "Failed." If 0 commands failed, you're good to go. This should be foolproof, but if some failed, send Andrew Horwitz an email and tell him to fix it so you can get work done.

chown

Salt has to install most stuff as root, so right now root owns the entire /opt/ directory.

  • sudo chown -R ____ /opt to get the entire directory recursively (make sure -R is capitalized) to your personal account (replace ____ with your account name), and the rest of these commands should run fine.

Cappuccino install

  • On the minion, manually run /opt/cappuccino/bootstrap.sh and follow instructions on http://www.cappuccino-project.org/learn/build-source.html. Installing using the default commands should work.
  • Run the source ____ command that appears slightly above the NOTE: at the end of execution.

Virtualenv creation

For some reason, Salt can not create virtual environments on Mac. So...

  • Run pip install virtualenv and make sure you have virtualenv first.
  • Run virtualenv rodan_env from the Rodan home directory to create the virtual environment.
  • Activate the virtual environment by running source rodan_env/bin/activate from the Rodan home directory.
  • Call pip install -r requirements.txt from /opt/rodan. You will receive a notice that looks like this:
$> Downloading/unpacking background-estimation==2.2.0pre2 (from -r requirements.txt (line 12))
$>   Could not find any downloads that satisfy the requirement background-estimation==2.2.0pre2 (from -r requirements.txt (line 12))
$> No distributions at all found for background-estimation==2.2.0pre2 (from -r requirements.txt (line 12))
$> Storing complete log in /Users/$YOUR_HOME/.pip/pip.log

PIP was not able to install a package because it does not know where to access it. To bypass the installation of this requirement, edit $RODAN_HOME/requirements.txt and comment out (#) the line with the requirement and rerun the PIP install. This will happen for multiple packages; there is a version automatically pulled from the Salt-Master server at /opt/requirements.txt, but it could be out of date.

This will take a bit.

###Django DB prep

  • The following commands default to SQLite for database management. If you would rather use a different system (we recommend PostgreSQL), open /opt/Rodan/rodan/settings_production.py with your favorite editor and change the SQLite reference under the "DATABASES" heading to what you want.
  • On the minion, run:
$ source rodan_env/bin/activate
(this turns on the virtual environment you created and changes the location of your default command-line python tools so you can use Django)
$ python /opt/rodan/manage.py syncdb
(this creates database entries for the default Django applications)
$ python /opt/rodan/manage.py schemamigration --initial rodan
(this creates a specification for the Rodan-specific tables)
$ python /opt/rodan/manage.py migrate
(this imports that specification)

##Second Salt script

  • On the master, run sudo salt '(name from above)' state.sls stepTwo. This takes a while, like on the scale of 15-20 minutes or more. Feel free to let it sit overnight; either way, you'll see the same "Summary:Succeeded/Failed" output; if failed is 0, proceed, otherwise frantically email me again and ask me what went wrong.
  • Everything should be in order now! Proceed on to the instructions for starting the server.
Clone this wiki locally