Skip to content

Commit 2c44b68

Browse files
committed
chore: rollback my changes for this contest
1 parent a323c20 commit 2c44b68

File tree

13 files changed

+63
-722
lines changed

13 files changed

+63
-722
lines changed

.github/workflows/benchmark.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
language:
20-
# - "crystal"
21-
# - "go"
22-
# - "nodejs"
23-
# - "php"
24-
# - "python"
20+
- "crystal"
21+
- "go"
22+
- "nodejs"
23+
- "php"
24+
- "python"
2525
- "ruby"
2626
env:
2727
ISHOCON_APP_LANG: ${{ matrix.language }}

admin/config/bashrc

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
export LC_ALL=C.UTF-8
22
export LANG=C.UTF-8
3-
export TZ=Asia/Tokyo
43

54
export PATH="$HOME/.rbenv/bin:$PATH"
65
if command -v rbenv 1>/dev/null 2>&1; then
76
eval "$(rbenv init -)"
7+
export PATH="$HOME/.rbenv/shims:$PATH"
88
fi
9-
export PATH="$HOME/.rbenv/shims:$PATH"
10-
11-
# 美しくないが bundle が見つからないと言われるので仕方ない
12-
# export PATH="$HOME/.gem/ruby/3.1.4/bin:$PATH"
139

1410
export PYENV_ROOT="$HOME/.pyenv"
1511
export PATH="$PYENV_ROOT/bin:$PATH"
@@ -32,5 +28,3 @@ alias ll='ls -alF'
3228
alias la='ls -A'
3329
alias l='ls -CF'
3430
alias grep='grep --color=auto'
35-
36-
export ISHOCON_APP_LANG=ruby

admin/config/nginx.conf

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
user www-data;
2-
worker_processes 16;
2+
worker_processes 4;
33
pid /run/nginx.pid;
44

55
events {
@@ -10,60 +10,22 @@ http {
1010
include /etc/nginx/mime.types;
1111
default_type application/octet-stream;
1212

13-
# access_log /var/log/nginx/access.log;
14-
access_log off;
15-
13+
access_log /var/log/nginx/access.log;
1614
error_log /var/log/nginx/error.log;
1715

1816
upstream app {
1917
server 127.0.0.1:8080;
2018
}
2119

22-
# cache の設定
23-
proxy_cache_path /var/nginx/cache_1 levels=1:2 keys_zone=political_parties_cache:1m max_size=1g inactive=1m use_temp_path=on;
24-
proxy_cache_path var/nginx/cache_2 levels=1:2 keys_zone=candidates_cache:1m max_size=1g inactive=1m use_temp_path=on;
25-
proxy_cache_path var/nginx/cache_3 levels=1:2 keys_zone=index_cache:1m max_size=1g inactive=1m use_temp_path=on;
26-
2720
server {
2821
listen 443;
2922
ssl on;
3023
ssl_certificate /etc/nginx/ssl/server.crt;
3124
ssl_certificate_key /etc/nginx/ssl/server.key;
3225

33-
rewrite ^/(.*)/$ /$1 permanent;
34-
35-
location /css/ {
36-
add_header Cache-Control "s-maxage=86400";
37-
alias /home/ishocon/public/css/;
38-
}
39-
40-
location /political_parties/ {
41-
proxy_cache political_parties_cache;
42-
proxy_cache_valid 200 302 30s;
43-
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
44-
proxy_set_header Host $host;
45-
proxy_pass http://app;
46-
}
47-
48-
location /candidates/ {
49-
proxy_cache candidates_cache;
50-
proxy_cache_valid 200 302 30s;
51-
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
52-
proxy_set_header Host $host;
53-
proxy_pass http://app;
54-
}
55-
56-
location = / {
57-
proxy_cache index_cache;
58-
proxy_cache_valid 200 302 30s;
59-
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
60-
proxy_set_header Host $host;
61-
proxy_pass http://app;
62-
}
63-
6426
location / {
6527
proxy_set_header Host $host;
6628
proxy_pass http://app;
6729
}
6830
}
69-
}
31+
}

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ services:
1717
command: [/home/ishocon/run.sh]
1818
tty: true
1919
volumes:
20-
# - storage_app:/var/lib/mysql
20+
- storage_app:/var/lib/mysql
2121
- ./webapp:/home/ishocon/webapp
2222
ports:
2323
- "443:443"

docker/app/entrypoint.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/bin/bash -eux
22

3-
sudo mkdir -p /usr/share/nginx/var/nginx/cache_1 /usr/share/nginx/var/nginx/cache_2 /usr/share/nginx/var/nginx/cache_3 /usr/share/nginx/var/nginx/cache_4 /usr/share/nginx/var/nginx/cache_5
4-
sudo mkdir -p /var/nginx/cache_1 /var/nginx/cache_2 /var/nginx/cache_3 /var/nginx/cache_4 /var/nginx/cache_5
53
sudo nginx -t
64
sudo service nginx start
75
sudo service mysql start || true # なぜか失敗する(調査中)

docker/app/ruby/Dockerfile

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
FROM showwin/ishocon2_app_base:latest
22
ENV APP_LANG 'Ruby'
33

4-
# TZ の設定
5-
ENV TZ Asia/Tokyo
6-
7-
RUN sudo apt-get update
8-
9-
# 日本語の設定
10-
RUN sudo apt-get install -y language-pack-ja htop && \
11-
sudo update-locale LANG=ja_JP.UTF-8 && \
12-
sudo rm -rf /var/lib/apt/lists/*
13-
ENV LANG="ja_JP.UTF-8" \
14-
LANGUAGE="ja_JP:ja" \
15-
LC_ALL="ja_JP.UTF-8"
16-
174
# Ruby のインストール
185
RUN sudo apt-get update && \
196
sudo apt-get install -y ruby-dev libmysqlclient-dev libffi6 libffi-dev libyaml-dev && \
@@ -23,25 +10,14 @@ RUN PATH="$HOME/.rbenv/bin:$PATH" && \
2310
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build && \
2411
rbenv install 3.2.2 && rbenv rehash && rbenv global 3.2.2
2512

26-
# YJIT の有効化
27-
ENV RUBY_YJIT_ENABLE=1
28-
2913
# アプリケーション
3014
RUN mkdir /home/ishocon/data /home/ishocon/webapp
3115
COPY admin/ishocon2.dump.tar.bz2 /home/ishocon/data/ishocon2.dump.tar.bz2
3216
COPY webapp/ /home/ishocon/webapp
3317
COPY admin/config/bashrc /home/ishocon/.bashrc
3418

35-
# 静的ファイルの配置(nginx が読めるように)
36-
COPY --chown=www-data:www-data public /home/ishocon/public
37-
38-
# base をビルドし直しても変更されなかったのでここでも改めてコピーする
39-
COPY admin/config/nginx.conf /etc/nginx/nginx.conf
40-
4119
# ライブラリのインストール
42-
RUN cd /home/ishocon/webapp/ruby && \
43-
. /home/ishocon/.bashrc && \
44-
bash ./set_up_ruby.sh
20+
RUN cd /home/ishocon/webapp/ruby && sudo gem install bundler -v "1.16.1" && bundle install
4521

4622
WORKDIR /home/ishocon
4723
EXPOSE 443

docker/benchmarker/Dockerfile

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,6 @@ FROM ubuntu:18.04
33
RUN sudo apt-get update
44
RUN apt-get install -y wget
55

6-
# TZ の設定
7-
ENV TZ Asia/Tokyo
8-
9-
# 日本語の設定
10-
RUN sudo apt-get install -y language-pack-ja && \
11-
sudo update-locale LANG=ja_JP.UTF-8 && \
12-
sudo rm -rf /var/lib/apt/lists/*
13-
ENV LANG="ja_JP.UTF-8" \
14-
LANGUAGE="ja_JP:ja" \
15-
LC_ALL="ja_JP.UTF-8"
16-
176
# Go のインストール
187
RUN wget -q https://dl.google.com/go/go1.13.15.linux-amd64.tar.gz && \
198
tar -C /usr/local -xzf go1.13.15.linux-amd64.tar.gz

0 commit comments

Comments
 (0)