Git Product home page Git Product logo

isucon9-portal's Introduction

isucon9-portal

ISUCON9 Portal

予選と本戦の違い

予選時のバージョン tag/isucon9-qualify と 本戦時のバージョン tag/isucon9-final の違い。

  • 予選バージョンでは各チームのAlibaba Cloud Accountの入力機能があった
  • ベンチマーカーとチームを1対1で対応付けした時の動作を修正

Requirements

  • Docker
  • Pyhton3
  • pip

Getting Started

ローカル環境では、SQLite3を利用して開発をすることができます。

Redisが必要なため、以下の起動例ではDockerで起動させています。

git clone [email protected]:chibiegg/isucon9-portal.git
cd isucon9-portal
pip install -r requirements.txt
python manage.py migrate
docker run -d -p 6379:6379 redis
python manage.py runserver

テストデータ生成

python manage.py manufacture -t 300

Deployment

docker-composeとkubernetesに対応しています。

kubernetes (minikube)

make
make apply

docker-compose

docker-compose build
docker-compose up

isucon9-portal's People

Contributors

chibiegg avatar misodengaku avatar tukejonny avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

masaki-yamakawa

isucon9-portal's Issues

ベンチマークへのジョブ提供と結果の受け取りAPI仕様

  • GET /api/internal/benchmark/dequeue
  • POST /api/internal/benchmark/result/{id}

この2つのエンドポイントの仕様を決める。
(パス名はイメージです)

GET /api/internal/benchmark/dequeue

ジョブIDと、チームに関連する情報全て返す

POST /api/internal/benchmark/result/{id}

  • スコア
  • 成功・失敗
  • stdout
  • stderr

1時間前になったら他人のスコアを更新しない

例年の仕様だと、他人のスコアは1時間前になったら更新されなくなる

表示されないわけではなく、他人のグラフも表示されるし、自分のスコアは更新される

実装が困難な場合は表示しないという実装にしてもいいかな...

ちなみに、スタッフは当然見れる

minukube使う?

blue & green デプロイできるようにしたいので、それがちゃんとできる何かしらであればいい

psqlで動作しない

django_1           | Internal Server Error: /contest/
django_1           | Traceback (most recent call last):
django_1           |   File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
django_1           |     return self.cursor.execute(sql, params)
django_1           | psycopg2.errors.AmbiguousColumn: ORDER BY "best_score" is ambiguous
django_1           | LINE 1: ...am"."id", "contest_aggregatedscore"."id" ORDER BY "best_scor...
django_1           |                                                              ^
django_1           | 
django_1           | 
django_1           | The above exception was the direct cause of the following exception:
django_1           | 
django_1           | Traceback (most recent call last):
django_1           |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
django_1           |     response = get_response(request)
django_1           |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response
django_1           |     response = self.process_exception_by_middleware(e, request)
django_1           |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response
django_1           |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
django_1           |   File "/usr/local/lib/python3.6/contextlib.py", line 52, in inner
django_1           |     return func(*args, **kwds)
django_1           |   File "/usr/local/lib/python3.6/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
django_1           |     return view_func(request, *args, **kwargs)
django_1           |   File "/opt/app/isucon/portal/contest/decorators.py", line 11, in _function
django_1           |     return function(request, *args, **kwargs)
django_1           |   File "/opt/app/isucon/portal/contest/views.py", line 37, in dashboard
django_1           |     top_teams = ScoreHistory.objects.get_top_teams()
django_1           |   File "/opt/app/isucon/portal/contest/models.py", line 107, in get_top_teams
django_1           |     return [history.team for history in histories]
django_1           |   File "/usr/local/lib/python3.6/site-packages/django/db/models/query.py", line 274, in __iter__
django_1           |     self._fetch_all()
django_1           |   File "/usr/local/lib/python3.6/site-packages/django/db/models/query.py", line 1242, in _fetch_all
django_1           |     self._result_cache = list(self._iterable_class(self))
django_1           |   File "/usr/local/lib/python3.6/site-packages/django/db/models/query.py", line 55, in __iter__
django_1           |     results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
django_1           |   File "/usr/local/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1100, in execute_sql
django_1           |     cursor.execute(sql, params)
django_1           |   File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py", line 99, in execute
django_1           |     return super().execute(sql, params)
django_1           |   File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py", line 67, in execute
django_1           |     return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
django_1           |   File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
django_1           |     return executor(sql, params, many, context)
django_1           |   File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
django_1           |     return self.cursor.execute(sql, params)
django_1           |   File "/usr/local/lib/python3.6/site-packages/django/db/utils.py", line 89, in __exit__
django_1           |     raise dj_exc_value.with_traceback(traceback) from exc_value
django_1           |   File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
django_1           |     return self.cursor.execute(sql, params)
django_1           | django.db.utils.ProgrammingError: ORDER BY "best_score" is ambiguous
django_1           | LINE 1: ...am"."id", "contest_aggregatedscore"."id" ORDER BY "best_scor...
django_1           |                                                              ^
django_1           | 

シードデータ改修

固定グラフ幅にしたので、シードデータが見れない
いい感じになるようにする

サーバーのreassign

2日目に、1日目登録したサーバが残っており、global_ipが被る可能性がある
そうなると登録できないことになりかねないため、これを直す

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.