Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ねこ画像判定用API用のリソースを作成 #74

Merged
merged 6 commits into from
Apr 23, 2022

Conversation

keitakn
Copy link
Member

@keitakn keitakn commented Apr 22, 2022

issueURL

#36

関連URL

Doneの定義

変更点概要

ねこ画像判定APIを独自ドメインで通信出来るように設定。

既に各環境に適応済。

独自ドメインでリクエストが正常動作する事を確認。

ステージング

echo '{"image" : "'"$( base64 ./hitogaututteru.jpg)"'", "imageExtension": ".jpg"}' | \
curl -v -X POST -H "Content-Type: application/json" -d @- https://stg-image-recognition-api.lgtmeow.com/cat-images/validation-results | jq
> POST /cat-images/validation-results HTTP/2
> Host: stg-image-recognition-api.lgtmeow.com
> user-agent: curl/7.79.1
> accept: */*
> content-type: application/json
> content-length: 2622636
>
* Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
} [65536 bytes data]
* We are completely uploaded and fine
100 2561k    0     0  100 2561k      0  1113k  0:00:02  0:00:02 --:--:-- 1116k< HTTP/2 200
< date: Fri, 22 Apr 2022 03:33:38 GMT
< content-type: application/json
< content-length: 79
< x-lambda-request-id: 197f18fc-29d4-4a09-b076-235e8b035ca6
< x-request-id: e5859481-e638-445d-ab26-48c5568d54c9
< apigw-requestid: Q9pCbgkttjMEJsg=
<
{ [79 bytes data]
100 2561k  100    79  100 2561k     26   844k  0:00:03  0:00:03 --:--:--  846k
* Connection #0 to host stg-image-recognition-api.lgtmeow.com left intact
{
  "isAcceptableCatImage": false,
  "notAcceptableReason": "person face in the image"
}

本番

echo '{"image" : "'"$( base64 ./hitogaututteru.jpg)"'", "imageExtension": ".jpg"}' | \
curl -v -X POST -H "Content-Type: application/json" -d @- https://image-recognition-api.lgtmeow.com/cat-images/validation-results | jq
> POST /cat-images/validation-results HTTP/2
> Host: image-recognition-api.lgtmeow.com
> user-agent: curl/7.79.1
> accept: */*
> content-type: application/json
> content-length: 2622636
>
* Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
} [65536 bytes data]
* We are completely uploaded and fine
100 2561k    0     0  100 2561k      0  1152k  0:00:02  0:00:02 --:--:-- 1156k< HTTP/2 200
< date: Fri, 22 Apr 2022 03:40:53 GMT
< content-type: application/json
< content-length: 79
< x-lambda-request-id: 9b9b2dc8-e321-4ddc-9464-ed0b0bad6464
< x-request-id: 02af3516-c3a8-433b-b3a9-53ee81a7ba2a
< apigw-requestid: Q9qGciTVtjMEPmw=
<
{ [79 bytes data]
100 2561k  100    79  100 2561k     28   934k  0:00:02  0:00:02 --:--:--  936k
* Connection #0 to host image-recognition-api.lgtmeow.com left intact
{
  "isAcceptableCatImage": false,
  "notAcceptableReason": "person face in the image"
}

また依存関係が複雑になっているので、READMEにlgtm-cat-image-recognitionとの依存関係を追記した。

レビュアーに重点的にチェックして欲しい点

設計方針やリソース名に問題がないか確認してもらえると:pray:

補足情報

インラインコメントに記載。

@keitakn keitakn self-assigned this Apr 22, 2022
Comment on lines +48 to +50
data "aws_secretsmanager_secret" "image_recognition_secret" {
name = "/stg/lgtm-cat/image-recognition"
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/nekochans/lgtm-cat-image-recognition のデプロイ時に生成されるAPI GatewayのIDはSecretManagerに事前に入れておく事にした🐱

https://github.com/nekochans/lgtm-cat-image-recognition のデプロイ時にSecretManagerを生成出来れば良いのだけど難しそうだったのでデプロイ後にコンソールからSecretManagerを作成する方針としてある(一回デプロイしたら基本消さないので、大きな問題はないと思っている)

@keitakn keitakn requested a review from kobayashi-m42 April 22, 2022 07:53
@keitakn keitakn marked this pull request as ready for review April 22, 2022 07:53
Copy link
Member

@kobayashi-m42 kobayashi-m42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

READMEの内容も分かりやすかった!ありがとう!
LGTMeow

@keitakn keitakn merged commit d5b5620 into main Apr 23, 2022
@keitakn keitakn deleted the feature/issue36/add-recognition-api branch April 23, 2022 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants