-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[provisioning] provision配下を公開用に変更した (#175)
* remove: benchをcliモードに切り替える * remove: portal files * remove:packer files * feat: ansible files * remove: unused file * cpu並列数を変更 * 不要な設定の削除 * Vagrantとplaybook関連の依存修正 * ビルドの並列数を環境変数から決めるようにした * Vagrantfileの修正 * docs: README追記 * remove:不要ファイル削除 * docs: README追記 * docker-compose.yaml path修正 Co-authored-by: yuya_mizuki <[email protected]>
- Loading branch information
1 parent
63fef4d
commit 02cddc4
Showing
30 changed files
with
94 additions
and
424 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# isucon10-provisioning | ||
|
||
ansible 2.9.13で動作確認しています | ||
|
||
## playbooks | ||
- bench.yaml | ||
- ベンチマーカーがセットアップされます | ||
- competitor.yaml | ||
- 競技者に提供された各種言語実装がセットアップされます | ||
- allinone.yaml | ||
- 各種言語実装に加えてベンチマーカーのセットアップもされます(.gitファイルや,中間生成ファイルの削除はおこなわれません) | ||
|
||
## Vagrantを利用して,環境をセットアップする | ||
|
||
本Vagrantファイルは1台構成で,allinone.yamlを実行した結果を提供しています | ||
別の,設定を利用したい場合は, | ||
- Vagrant ファイルの書き換え | ||
ansible.playbook = "allinone.yaml" | ||
- inventory/hostsの書き換え | ||
を行ってから,下記の操作を行ってください. | ||
|
||
### 初回構築 | ||
|
||
下記コマンドによって,VMを一度破棄して新しく作り直します | ||
``` | ||
make vagrant/init | ||
``` | ||
|
||
### ファイル初期化/再構築 | ||
|
||
ansibleの実行中に,通信環境エラーなどが起きた場合,下記のコマンドで再実行できます | ||
``` | ||
vagrant provision | ||
``` | ||
|
||
|
||
## サーバーへのprovisionning | ||
|
||
inventory/hostsの該当セクションを書き換えて,ansible playbookを実行してください. | ||
|
||
### ベンチマーカーサーバー | ||
|
||
``` | ||
ansible-playbook bench.yaml -i inventory/hosts | ||
``` | ||
|
||
### 競技用サーバー | ||
|
||
``` | ||
ansible-playbook competitor.yaml -i inventory/hosts | ||
``` | ||
|
||
### ベンチつき競技用サーバー | ||
|
||
``` | ||
ansible-playbook allinone.yaml -i inventory/hosts | ||
``` |
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
14 changes: 8 additions & 6 deletions
14
...ioning/ansible/multistage-competitor.yaml → provisioning/ansible/allinone.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
- hosts: all | ||
- hosts: allinone | ||
become: yes | ||
become_user: root | ||
roles: | ||
- role: common | ||
- role: langs | ||
- role: web-bootstrap | ||
- role: web-php | ||
- role: web-go | ||
- role: web-node | ||
- role: web-perl | ||
- role: web-python | ||
- role: web-rust | ||
- role: web-ruby | ||
- role: web-rust | ||
- role: web-deno | ||
- role: web-php | ||
- role: web-perl | ||
- role: web-python | ||
- role: web-prepare | ||
- role: remove | ||
- role: bench |
4 changes: 3 additions & 1 deletion
4
provisioning/ansible/benchmarker.yaml → provisioning/ansible/bench.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
- hosts: all | ||
- hosts: bench | ||
become: yes | ||
become_user: root | ||
roles: | ||
- role: common | ||
- role: langs | ||
- role: web-bootstrap | ||
- role: web-go | ||
- role: web-prepare | ||
- role: bench |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[bench] | ||
[competitor] | ||
[allinone] | ||
192.168.33.10 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
provisioning/ansible/roles/bench/files/isuumo.supervisor.service
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,15 +2,6 @@ | |
become: yes | ||
become_user: isucon | ||
command: curl -X POST http://localhost/initialize | ||
- name: Copy GitConfig | ||
copy: | ||
src: "{{ item }}" | ||
dest: "/home/isucon/.gitconfig" | ||
owner: "isucon" | ||
group: "isucon" | ||
mode: "0644" | ||
with_items: | ||
- .gitconfig | ||
|
||
- name : Snapshot isucon10 | ||
become: yes | ||
|
@@ -31,82 +22,6 @@ | |
environment: | ||
PATH: "/home/isucon/local/go/bin:/home/isucon/local/node/bin:/home/isucon/local/ruby/bin:/home/isucon/local/python/bin:/home/isucon/local/perl/bin:/home/isucon/local/php/bin:/home/isucon/.cargo/bin:/home/isucon/.deno/bin:/home/isucon/bin:/home/isucon/.local/bin:/usr/bin:/sbin:/bin" | ||
shell: | | ||
mkdir -p ~/.ssh && ssh-keyscan github.com > ~/.ssh/known_hosts && make && rm ~/.gitconfig | ||
make | ||
- name: Disable Unused Services | ||
become: yes | ||
become_user: root | ||
shell: | | ||
systemctl disable isucon-go && \ | ||
systemctl disable mysql && \ | ||
systemctl disable nginx | ||
- name: Check isucon10-portal | ||
become: no | ||
stat: | ||
path: "/home/isucon/portal" | ||
register: chk_file | ||
|
||
- name: Delete isucon10-portal if exists | ||
become: yes | ||
become_user: root | ||
file: | ||
path: /home/isucon/poratl | ||
state: absent | ||
when: chk_file.stat.exists | ||
|
||
- name: Clone isucon10-portal | ||
become: no | ||
git: | ||
repo: [email protected]:isucon/isucon10-portal.git | ||
version: master | ||
dest: /tmp/isucon10-portal | ||
accept_hostkey: yes | ||
|
||
- name: Chgroup sisucon10-portal repo | ||
become: yes | ||
become_user: root | ||
file: | ||
path: /tmp/isucon10-portal | ||
state: directory | ||
owner: isucon | ||
group: isucon | ||
recurse: yes | ||
|
||
- name: Deploy isucon10-portal | ||
become: yes | ||
become_user: isucon | ||
command: mv /tmp/isucon10-portal /home/isucon/portal | ||
|
||
- name: Make Supervisor | ||
become: yes | ||
become_user: isucon | ||
args: | ||
chdir: /home/isucon/portal/supervisor | ||
environment: | ||
PATH: "/home/isucon/local/go/bin:/home/isucon/local/node/bin:/home/isucon/local/ruby/bin:/home/isucon/local/python/bin:/home/isucon/local/perl/bin:/home/isucon/local/php/bin:/home/isucon/.cargo/bin:/home/isucon/.deno/bin:/home/isucon/bin:/home/isucon/.local/bin:/usr/bin:/sbin:/bin" | ||
shell: | | ||
cargo build --release | ||
- name: Copy env.sh for supervisor | ||
become: yes | ||
become_user: isucon | ||
copy: | ||
src: "env.sh" | ||
dest: /home/isucon/portal | ||
- name: Copy service file | ||
copy: | ||
src: "{{ item }}" | ||
dest: "/etc/systemd/system" | ||
owner: "root" | ||
group: "root" | ||
mode: "0644" | ||
with_items: | ||
- isuumo.supervisor.service | ||
- name: Start "supevisor" | ||
systemd: | ||
daemon_reload: "yes" | ||
name: "isuumo.supervisor" | ||
state: "stopped" | ||
enabled: "yes" |
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
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
5 changes: 0 additions & 5 deletions
5
provisioning/ansible/roles/web-bootstrap/files/slow-mysqld.cnf
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.