##Instructions for setting up sirius from the Emerging Stack dockerfile (end-to-end) ####NOTE: Everything here works on a laptop, but it will run out of disk space in all likelihood, requiring an annoying boot2docker hack. It's easier and faster in the cloud. You can copy/paste each of the commands below...without the dollar or hash symbol. Remember, if you terminate your DigitalOcean droplet, you'll have to do all these steps again (but they will survive a server reboot).
####At the end of this process, you will be able to ask Sirius some wikipedia type questions (when, which, where, etc) inside a terminal window...don't expect a fancy user experience, this is raw functionality only.
###Cloud Server Provisioning Stage
-
Sign in to digitalocean and set up an account, billing, etc
-
Setup new droplet ($40 month size with Ubuntu 14.04)...wait 1 minute
-
Click the 'access - console access' button
-
Copy the IP Address you will see displayed
-
Open terminal on your computer
-
Connect to the server via SSH (Let's call this "SessionA" for later reference)
$ ssh root@{public IP addess}
-
Open the email you got from digital ocean
-
Copy/paste the password into the terminal window at the password prompt
-
Change the password when prompted (current/new/confirm) ###Docker Time
-
Install docker
$ curl -sSL https://get.docker.com/ubuntu/ | sudo sh
- Install Git tools
$ apt-get update
$ apt-get install -y git
- Clone the 'dockerised' version of sirius
git clone https://github.com/emergingstack/sirius.git
###Alright...time to get sirius... 13) Build the Sirius docker base image
$ cd sirius
$ docker build -t siriusbase:latest .
-
Wait...about 15 mins...it's grabbing all the dependent software and creating a docker 'gold image' ###Almost finished. Time to compile the Sirius binaries
-
Start the docker container
$ docker run -it \
-e JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/jre \
-e JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8 \
-v /root/sirius/:/opt/sirius \
-p 8080:8080 \
-p 8081:8081 \
-p 8082:8082 \
siriusbase:latest bash
- You're now at a command prompt, inside the sirius docker container, ready to build the binaries
# cd opt/sirius/sirius-application/
# chmod +x start.sh
# ./start.sh
- Wait...about 30 minutes for all the binaries to compile...maybe write a blog post or read this one to learn something about chat-bots: http://www.emergingstack.com/blog
17a) (optional) If you're curious to see if the binaries are still compiling....in the "SessionB" window:
# top
Now you can watch the CPUs spin as the binaries finish compiling...or read some stuff on reddit/showerthoughts while you wait...ctrl-c to exit the 'top' utility when you're ready. ###Importing the wikipedia 'brain' for Sirius (these steps come direct from the Sirius instructions online) 18) Open a new terminal window ("SessionB") and SSH into your server again (as per step 6, using your new root password)
- Download the wikipedia content (in "SessionB")
# wget http://web.eecs.umich.edu/~jahausw/download/wiki_indri_index.tar.gz
-
Wait...takes about 5 minutes...
-
Unzip the wikipedia package
# tar xzvf wiki_indri_index.tar.gz -C /root/sirius/sirius-application/question-answer/
- Wait...this takes about 10 minutes to unzip
###Finally, we can now start Sirius (Question and Answer server) 23) Still in the "SessionB" window (where you just unpacked wikipedia)
# docker ps
- Look at the "CONTAINER ID". Write this down somewhere, you'll probably need it later.
# docker exec -it {type docker container ID here} bash
# cd /opt/sirius/sirius-application/run-scripts/
# ./start-qa-server.sh
###Sirius is now running and ready to answer some sirius questions 25) Go back to "SessionA" (which should just be sitting there at a command prompt after the "Server Compilation Complete" log entry. To test if it's working:
# cd /opt/sirius/sirius-application/run-scripts/
# ./sirius-qa-test.sh "what is the speed of light"
###Bonus steps - to prevent having to do all that again 26) In "SessionB", hit ctrl-c to shut down the sirius Q&A server application :-(
-
Exit your docker container sessions (A and B) by typing 'exit'. It will return you to the command prompt on the server.
-
Good one...you just shut down your container...now if you want to start it again to impress your friends
# docker start {that container ID you wrote down}
- Repeat step 24 to restart sirius, and step 25 to run some tests
####Don't forget to go back and delete your droplet when you're done, before you blow too much money on this experiment.