Last active
November 4, 2017 06:29
-
-
Save hoto17296/91de0eaf283fc21178305dc45c1d465a to your computer and use it in GitHub Desktop.
ISUCON 7 予選問題 練習環境構築用 Vagrantfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.provider "virtualbox" do |vb| | |
vb.cpus = 1 | |
vb.memory = 1024 | |
# https://github.com/joelhandwell/ubuntu_vagrant_boxes/issues/1 | |
vb.customize ["modifyvm", :id, "--uartmode1", "disconnected"] | |
end | |
config.ssh.username = "isucon" | |
config.ssh.password = "isucon" | |
[1, 2, 3].each do |i| | |
config.vm.define "image#{i}" do |image| | |
image.vm.box = "isucon7q-image" | |
image.vm.box_url = "https://cdn.hotolab.net/vbox/isucon7q-image.box" | |
image.vm.network "private_network", ip: "192.168.33.1#{i}" | |
if i != 3 then | |
image.vm.provision "shell", inline: <<-SHELL | |
systemctl disable mysql | |
sed -ie 's/localhost/192.168.33.13/' /home/isucon/env.sh | |
SHELL | |
else | |
image.vm.provision "shell", inline: <<-SHELL | |
systemctl disable isubata.python | |
systemctl disable nginx | |
SHELL | |
end | |
end | |
end | |
config.vm.define "bench" do |bench| | |
bench.vm.box = "isucon7q-bench" | |
bench.vm.box_url = "https://cdn.hotolab.net/vbox/isucon7q-bench.box" | |
bench.vm.network "private_network", ip: "192.168.33.10" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
matuu さんの vagrant-isucon/isucon7-qualifier をビルドして、そのビルド済み vbox イメージを CDN に置いて誰でも利用できるようにしたやつ。
動作確認済み環境
メモリを 8GB 積んでるマシンで動かしたが、メモリ 4GB のマシンだと厳しいかもしれない。
起動方法
Vagrantfile を置いたディレクトリで
$ vagrant up
初回起動 (プロビジョニング) 時のみ、起動後に
$ vagrant reload
で再起動する必要がある。起動する VM
すべて ユーザ名
isucon
パスワードisucon
でログインできる。ベンチマークを実行する
$ vagrant ssh bench
でベンチマーカーにログインしてからその他の使い方 / レギュレーションなど
isucon/isucon7-qualify: ISUCON7 予選問題の参照実装とベンチマーカー