Skip to content

Instantly share code, notes, and snippets.

@oppai
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oppai/938e705f26acb9e10268 to your computer and use it in GitHub Desktop.
Save oppai/938e705f26acb9e10268 to your computer and use it in GitHub Desktop.

プルリクエストポリシー

  • webappは基本的にプルリクエストを通す(conf系は口頭でもおk)
  • スコア変動の推移を書く
    • ex) 2400 -> 3000
  • 何を目的としているかを書く
    • Covering Index / Data Cache / アルゴリズム改善
  • DBのスキーマを変更する場合db/changes.sqlに変更を加える
    • masterにマージされた場合、変更した人が責任をもって本番環境のDBスキーマを変更すること

アロケーションポリシー

 /.ssh
   |__ isucon_rsa
 /cron
   |__ pull.sh
   |__ reset.sh
   |__ restart.sh
 /bin
   |__ init.sh
 /conf
   |__ supervisord.conf
 /webapp
   |__ 

準備

  • アプリの設置
    • ユーザーの変更
      • sudo su isucon
      • cd
    • 秘密鍵の設置
    • リポジトリのクローン
      • eval `ssh-agent` && ssh-add ~/.ssh/isucon_rsa
      • git clone git@github.com:oppai/isucon3
      • git config --global user.email "hotsoup.h@gmail.com"
      • git config --global user.name "oppai"
    • アプリのコピー
      • cp ~/webapp ~/isucon3/webapp
      • cd ~/isucon3
      • git add webapp && git commit -m "add webapp"
      • git push origin master
    • GemとBundleInstall
      • cd ~/isucon3/webapp/ruby
      • ~/env.sh gem install bundler foreman
      • ~/env.sh bundle install --deployment --without development
    • PerlからRubyに変更する
      • mv /etc/supervisord.conf{,.backup}
      • sudo ln -s /home/isucon/isucon3/conf/supervisord.conf /etc/supervisord.conf
      • sudo service supervisord restart ## 1回では失敗するので何回か実行する
    • RubyEnvのインストール(必要であれば)
      • git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
      • git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
      • rbenv rehash
  • ベンチツールの準備
    • cron/bench.shcron/slack.shを適切に書き換える
    • cron/crontabの設定をcrontabに設定する

TIPS

oppai/isucon4のclone

eval `ssh-agent`
ssh-add isucon_rsa
git clone git@github.com:oppai/isucon4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment