-
Notifications
You must be signed in to change notification settings - Fork 13
Installation on Ubuntu
NB: if you want to do this, make sure Horwitz is looking over your shoulder or in the room for you to scream "SOMETHING DIDN'T WORK" at, cause some things are bound to not work on Ubuntu still.
Clone a copy of the git repository while in /opt/
. If done correctly, /opt/rodan/manage.py should be a valid file. Make sure that this clone is recursive; the RodanClient repository should recursively populate into /opt/rodan/client and a few other directories should follow suit.
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.
- Run
sudo apt-get install salt-minion
to get the Salt-Minion package.
- Make sure that the file
/etc/salt/minion
exists. If it does not, grab an example configuration file fromhttp://docs.saltstack.com/ref/configuration/examples.html#configuration-examples-minion
- more information on the syntax, if you're curious, is available athttp://docs.saltstack.com/ref/configuration/minion.html
. - Open
/etc/salt/minion
, uncomment the "master:" line (about 10th line of the file) and replace it withmaster: 132.206.14.141
or whatever the master's current IP is. I don't forsee it changing, but you can ssh in as the userddmaluser
to check.
- Stop the salt-minion daemon using
sudo service salt-minion stop
. It's easier to use it in the command line here to monitor output. - Restart it manually in command-line to get debug statements using
sudo salt-minion --log-level=debug
.
- 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 python /srv/salt/saltRenamer.py (your username on the minion) (desired folder to install everything in)
(this will generate a salt script that has permissions tailored to your specific username's account on the minion machine, and will install everything to the folder. see below for an example)
$ sudo salt '(name)' state.sls stepOne(your username)
(where (name) is the name of the minion you want to communicate with, single quotes are needed in the final command. the stepOne reference will be the file generated by the python script above, without the .sls extension. see below for an example)
The renamer command should look like sudo python saltRenamer.py ahorwitz /home/ahorwitz/development/
- note that the parentheses are removed and that there is a terminal slash on the folder name. I have not tested this using the ~ shortcut for your home folder, but don't risk it.
The state.sls command should look like sudo salt 'Jellyroll.local' state.sls stepOneahorwitz
- note that the parentheses are removed.
Keep the salt-minion window open while you run this. If nothing starts moving on the minion screen (a lot of stuff will pop up almost immediately), make sure no one else is using the master currently, then restart the master by entering sudo service salt-master restart
.
Twiddle your thumbs for a little bit here.
After stepOne.sls 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.
If none failed, the reason why this is in two chunks is that Salt can not handle interactive bash scripts. There are a few that you need to take care of, but first...
Salt has to install most of these programs/libraries as root, so right now root owns the entire /opt/ directory. If you're on a shared machine, only change the new directories.
-
sudo chown -R ____ /opt
to get the entire directory to your personal account (replace ____ with your account name), and the rest of these commands should run fine. The -R (recursive) tag is case-sensitive.
- On the minion, manually run
/opt/cappuccino/bootstrap.sh
and follow instructions onhttp://www.cappuccino-project.org/learn/build-source.html
. Installing using the default commands should work. - Enter
NARWHAL_ENGINE=rhino
in the command line. This is a known issue with Ubuntu and Cappuccino, but this should solve a few issues you'd otherwise run into with installation. - Run the
source ____
command that appears slightly above the NOTE: at the end of bootstrap.sh's execution.
- 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)
$ 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, usually longer than any other step. 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. - Get a friend with a Mac to run nib2cib on every .xib file in /opt/rodan/client/Rodan/Resources. nib2cib doesn't work on Linux for some reason, and we can't figure out why.
- Everything should be in order now! Proceed on to the instructions for starting the server.
- Repository Structure
- Working on Rodan
- Testing Production Locally
- Working on Interactive Classifier
- Job Queues
- Testing New Docker Images
- Set up Environment Variables
- Set up SSL with Certbot
- Set up SSH with GitHub
- Deploying on Staging
- Deploying on Production
- Import Previous Data