Skip to content

Instantly share code, notes, and snippets.

@kmaehashi
Last active February 15, 2016 11:17
Show Gist options
  • Save kmaehashi/e30520f38d2b74534a2d to your computer and use it in GitHub Desktop.
Save kmaehashi/e30520f38d2b74534a2d to your computer and use it in GitHub Desktop.
Jubatus AMI の作成手順

AMI作成手順

  1. Ubuntu Server 12.04 LTS (x86_64) HVM イメージでインスタンスを作成
  2. root ユーザとしてログインし、 run_root.sh を実行
  3. ubuntu ユーザとしてログインし、run_user.sh を実行
  4. インスタンスをシャットダウン
  5. EBS のスナップショットを作成
  6. 作成されたスナップショットに対して AMI を作成
#!/bin/bash -uex
# Configure Jubatus repository
echo 'deb http://download.jubat.us/apt binary/' > /etc/apt/sources.list.d/jubatus.list
APT_GET='/usr/bin/apt-get -y --force-yes'
# Update package index
${APT_GET} update
${APT_GET} upgrade
# Install development packages
${APT_GET} install build-essential git
# Install Jubatus Server
${APT_GET} install jubatus
# Install Jubatus Python Client
${APT_GET} install python-dev python-pip
pip install jubatus
# Install Jubatus Ruby Client
${APT_GET} install ruby1.9.1 ruby1.9.1-dev
gem install jubatus --no-rdoc --no-ri
# Install Jubatus Java Client
${APT_GET} install openjdk-7-jdk maven2
# Install Jubatus Build Requirements
${APT_GET} install liblog4cxx10-dev pkg-config
# Install OPAM (to build jenerator)
${APT_GET} install m4 unzip
pushd /tmp
/usr/bin/wget https://raw.github.com/ocaml/opam/master/shell/opam_installer.sh
/bin/sh ./opam_installer.sh /usr/local/bin
popd
#!/bin/bash -uex
cat << '_EOF_' >> ~/.bash_profile
# Jubatus
source /opt/jubatus/profile
# OPAM (for Jubatus jenerator)
export PATH="/usr/local/bin:${PATH}"
eval `/usr/local/bin/opam config env`
. ~/.opam/opam-init/init.sh
_EOF_
soruce ~/.bash_profile
opam --yes init --comp 4.02.1
opam --yes install ounit extlib omake ppx_deriving
# ------ Repositories -------
pushd ~
git clone https://github.com/jubatus/jubatus.git
popd
pushd ~/jubatus/tools/jenerator
omake
sudo cp src/jenerator.opt /usr/local/bin/jenerator
popd
pushd ~
git clone https://github.com/jubatus/jubatus-example.git
popd
@kmaehashi
Copy link
Author

TODO: apt-get に -y をつける

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment