Skip to content

Commit

Permalink
Merge pull request #45 from showwin/refactor-directories
Browse files Browse the repository at this point in the history
ディレクトリ構成のリファクタ
  • Loading branch information
showwin authored Oct 13, 2024
2 parents a3c8522 + 6c429b0 commit 0178da8
Show file tree
Hide file tree
Showing 28 changed files with 56 additions and 5 deletions.
44 changes: 44 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

## Contributing

現在作者によるメンテナンス対象の言語は Ruby, Go, Python の3つのみです。
Node.js(TypeScript), Crystal, Scala は参考実装が残っていますが、OSやミドルウェアのバージョンアップによる外部環境の変化によって現在は動かない状況です。
メンテナンス外の言語の参考実装の修正や、新規言語での参考実装追加は歓迎です。

メンテナンス外の言語の修正や新規言語の追加時に変更すべき箇所は以下となります。
すべての箇所への対応が難しい場合には部分的な変更でも歓迎です。

* `admin/ami/scripts/base.sh`: 言語処理系のインストール処理を追加
* `admin/ami/webapp.sh`: WebAppの実行に必要なライブラリのインストール処理を追加
* `admin/.bashrc`: 必要に応じて環境変数を追加
* `doc/*`: アプリケーションの起動方法を追記
* `docker/app/<lang>`: 言語処理系のインストールとWebAppの実行に必要なライブラリのインストール処理を記述
* `webapp/<lanb>`: アプリケーションの参考実装を追加
* `Makefile`: サポート言語を列挙している部分に追記
* `run.sh`: アプリケーションの起動方法を追記

以下、参考実装を追加する際に気をつけて頂きたい点です。

* アプリケーションがリクエストを受け取ってからレスポンスを返すまでの処理/ロジックは変更しない
* 各言語の習慣に寄せるために既存の参考実装とコードの見通しが変わってしまうことは問題ない
* 各言語の習慣に寄せたために(その変更前と比べて)初期スコアが1.5倍以上に変化してしまう場合はその変更は取り込まず、既存の参考実装に寄せる


## ディレクトリ構成

このレポジトリが管理するものが増えてきたので、なにがどこにあるか書いておきます。

```
.
├── admin # 出題側のリソース
│   ├── ami # PackerでAMIの作成 (手動)
│   ├── benchmarker # ベンチマーカーの実装
├── contest # コンテストのイベント実施用のリソース
│   ├── portal # コンテスト用ポータルサイトの実装. Terraformから参照されてS3にアップロードされる
│   └── terraform # コンテスト用のインフラリソース準備
├── doc # 参加者向けのドキュメント
├── docker # ローカルでISHOCONに取り組む & CIで使う用のDocker Image
│   ├── app
│   └── benchmarker
└── webapp # 競技のアプリケーション実装
```
File renamed without changes.
4 changes: 2 additions & 2 deletions ami/README.md → admin/ami/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ $ cd ishocon1/ami
$ cp _secret_vars.hcl secret_vars.hcl
# Update your values at `secret_vars.hcl`
$ cd ../ && tar -zcvf ami/webapp.tar.gz ./webapp && cd ami
$ cd ../admin/ && tar -zcvf ../ami/benchmarker.tar.gz ./benchmarker && cd ../ami
$ cd ../../ && tar -zcvf admin/ami/webapp.tar.gz ./webapp && cd admin/ami
$ cd ../ && tar -zcvf ami/benchmarker.tar.gz ./benchmarker && cd ami
$ packer init .
$ packer validate -var-file=shared_vars.hcl -var-file=secret_vars.hcl .
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions ami/ami.pkr.hcl → admin/ami/ami.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,17 @@ build {

# WebApp
provisioner "file" {
source = "../admin/.bashrc"
source = "../.bashrc"
destination = "/tmp/.bashrc"
}

provisioner "file" {
source = "../admin/nginx.conf"
source = "../nginx.conf"
destination = "/tmp/nginx.conf"
}

provisioner "file" {
source = "../admin/ishocon1.dump.tar.gz"
source = "../ishocon1.dump.tar.gz"
destination = "/tmp/ishocon1.dump.tar.gz"
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions contest/portal/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

`src/main.ts` から `dist/main.js` を生成。
```
$ npm run build
```

Terraform から `index.html``dist/main.js` を参照するので、 `dist/*` 配下もgitでバージョン管理することにする。
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 0178da8

Please sign in to comment.