Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Vagrantfile and Dockerfile for Sirius, open-source end-to-end standalone intelligent personal assistant (IPA) service. Dockerfile and start-qa-server.patch MUST be moved ./docker directory.
FROM ubuntu:trusty
# forked from
# for Ubuntu 14.04
RUN apt-get update && apt-get install -y \
RUN apt-get update && apt-get install -y \
wget \
git \
RUN cd /opt \
&& mkdir sirius \
&& cd sirius \
&& git clone
RUN cd /opt/sirius/sirius/sirius-application \
&& tar xzf question-answer.tar.gz \
&& ./ \
&& ./
&& ./
RUN ldconfig
# build sirius applications.
RUN cd /opt/sirius/sirius/sirius-application \
&& export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/jre \
&& export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8 \
&& /bin/bash ./
# build image matching db.
RUN cd /opt/sirius/sirius/sirius-application/image-matching \
&& ./ landmarks matching/landmarks/db/ \
&& ./ buildings matching/buildings/db_big/ \
&& ./ buildings matching/buildings/db_small
# write setup script.
RUN echo "cd /tmp/shared && ./" >> ~/.bashrc
# apply patch.
RUN mkdir /opt/sirius/tmp
ADD start-qa-server.patch /opt/sirius/tmp/
RUN cd /opt/sirius/sirius/sirius-application/run-scripts \
&& patch -p0 < /opt/sirius/tmp/start-qa-server.patch
CMD ["/bin/bash"]
readonly WORKDIR=/vagrant/data
readonly ARCHIVE_FILE_BASENAME=wiki_indri_index
readonly DOWNLOAD_URL=
if [ ! -e ${ARCHIVE_FILE_BASENAME}.tar.gz ]; then
echo "download ${ARCHIVE_FILE_BASENAME}.tar.gz"
echo "skip downloading ${ARCHIVE_FILE_BASENAME}.tar.gz"
if [ ! -e ${ARCHIVE_FILE_BASENAME} ]; then
echo "extract ${ARCHIVE_FILE_BASENAME}.tar.gz"
tar xzf ${ARCHIVE_FILE_BASENAME}.tar.gz
echo "skip extracting ${ARCHIVE_FILE_BASENAME}.tar.gz"
# -*- coding: utf-8-unix -*-
readonly WORKDIR=/tmp/shared/data
readonly ARCHIVE_FILE_BASENAME=wiki_indri_index
cd /opt/sirius/sirius/sirius-application/question-answer
if [ ! -e ${ARCHIVE_FILE_BASENAME} ]; then
echo "generate symbolic link ${ARCHIVE_FILE_BASENAME}."
echo "skip generating symbolic link ${ARCHIVE_FILE_BASENAME}."
diff --git a/sirius-application/run-scripts/ b/sirius-application/run-scripts/
index 3bea960..cf3c70b 100755
--- a/sirius-application/run-scripts/
+++ b/sirius-application/run-scripts/
@@ -35,6 +35,9 @@ export CLASSPATH=bin:lib/ml/maxent.jar:lib/ml/minorthird.jar:lib/nlp/jwnl.jar:li
export INDRI_INDEX=`pwd`/wiki_indri_index/
export THREADS=$(cat /proc/cpuinfo | grep processor | wc -l)
+if [ ${THREADS} -lt 4 ]; then
+ export THREADS=4
java -Djava.library.path=lib/search/ -server -Xms1024m -Xmx2048m \
info.ephyra.OpenEphyraServer $ip $port
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# Every Vagrant development environment requires a box. You can search for
# boxes at = "ubuntu/trusty64"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# "forwarded_port", guest: 80, host: 8080
# Create a private network, which allows host-only access to the machine
# using a specific IP.
# "private_network", ip: ""
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network. "public_network", ip: "", netmask: ""
config.vm.hostname = "sirius.carmesi"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
vb.gui = false = "Sirius CI TestVM"
# Customize the amount of memory on the VM:
vb.memory = "2048"
vb.customize ["modifyvm", :id, "--ostype", "Ubuntu_64"]
config.vm.provision "shell", inline: <<-SHELL
cd /vagrant && ./
config.vm.provision "docker" do |d|
d.build_image "/vagrant/docker", args: "-t kyama/sirius-ci-test-image" "kyama/sirius-ci-test-image", args: "-d -t -v /vagrant:/tmp/shared -e JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/jre -e JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8"
# View the documentation for the provider you are using for more
# information on available options.
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
# such as FTP and Heroku are also available. See the documentation at
# for more information.
# config.push.define "atlas" do |push|
# end
# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
# config.vm.provision "shell", inline: <<-SHELL
# sudo apt-get update
# sudo apt-get install -y apache2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment