Skip to content

Commit 59e5eda

Browse files
committed
refactor: add delayed requeue logic in postlookup_lambda and implement post_transform_lambda, including DB upsert and batch processing
1 parent 39cb52c commit 59e5eda

File tree

5 files changed

+310
-67
lines changed

5 files changed

+310
-67
lines changed

.github/workflows/deploy-etl-lambda.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
- { dockerfile: Dockerfile.postlookup, repository: birdxplorer-etl-postlookup }
3838
- { dockerfile: Dockerfile.db_writer, repository: birdxplorer-etl-db-writer }
3939
- { dockerfile: Dockerfile.note_status_update, repository: birdxplorer-etl-note-status-update }
40+
- { dockerfile: Dockerfile.post_transform, repository: birdxplorer-etl-post-transform }
4041

4142
steps:
4243
- uses: actions/checkout@v5
@@ -81,6 +82,7 @@ jobs:
8182
birdxplorer-etl-topic,
8283
birdxplorer-etl-postlookup,
8384
birdxplorer-etl-db-writer,
84-
birdxplorer-etl-note-status-update
85+
birdxplorer-etl-note-status-update,
86+
birdxplorer-etl-post-transform
8587
stacks: "devbird-xplorerStack"
8688
secrets: inherit

.github/workflows/release-prd.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ jobs:
6363
- { dockerfile: Dockerfile.postlookup, repository: birdxplorer-etl-postlookup }
6464
- { dockerfile: Dockerfile.db_writer, repository: birdxplorer-etl-db-writer }
6565
- { dockerfile: Dockerfile.note_status_update, repository: birdxplorer-etl-note-status-update }
66+
- { dockerfile: Dockerfile.post_transform, repository: birdxplorer-etl-post-transform }
6667

6768
steps:
6869
- uses: actions/checkout@v5
@@ -104,6 +105,7 @@ jobs:
104105
birdxplorer-etl-topic,
105106
birdxplorer-etl-postlookup,
106107
birdxplorer-etl-db-writer,
107-
birdxplorer-etl-note-status-update
108+
birdxplorer-etl-note-status-update,
109+
birdxplorer-etl-post-transform
108110
stacks: "prdbird-xplorerStack prdbird-xplorerApiStack"
109111
secrets: inherit

etl/Dockerfile.post_transform

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM public.ecr.aws/lambda/python:3.12
2+
3+
# 作業ディレクトリを設定
4+
WORKDIR ${LAMBDA_TASK_ROOT}
5+
6+
RUN dnf update -y && \
7+
dnf install -y gcc gcc-c++ git && \
8+
dnf clean all && \
9+
rm -rf /var/cache/dnf
10+
11+
COPY etl/. .
12+
13+
RUN python -m pip install --no-cache-dir --upgrade pip && \
14+
pip install --no-cache-dir -e .[prod]
15+
16+
# Lambda関数のコードをコピー
17+
COPY etl/src/birdxplorer_etl/lib/lambda_handler/post_transform_lambda.py ./
18+
19+
# Lambda handler を設定
20+
CMD ["post_transform_lambda.lambda_handler"]

0 commit comments

Comments
 (0)