Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,9 @@ jobs:
# 배포 끝에서 정리하면 디스크가 찬 상태에서 pull 이 먼저 죽는다(renderer 2026-09-13). 규칙 정본은 infra conventions/infra.md.
bash /tmp/piki-blocks/prune_images.sh

# --legacy-slot: 옛 슬롯(8090 시절 규칙) 중 서빙 중인 쪽을 알아보게 한다(#108). 이 인자가 없으면 옛 blue 가
# 서빙 중일 때 새 blue 기동 전에 지워진다. 새 슬롯으로 한 번 배포된 뒤 제거.
bash /tmp/piki-blocks/deploy_slot.sh \
--state-file /etc/nginx/piki-extractor-upstream.conf \
--service-port "$SERVICE_PORT" --name-prefix piki-extractor \
--legacy-slot blue:18090 --legacy-slot green:18091 \
--health-path /actuator/health --health-interval 5 --health-attempts 36 --health-expect-body '"status":"UP"' \
--verify-cmd "bash /tmp/piki-blocks/healthcheck.sh --url http://localhost:$SERVICE_PORT/actuator/health --interval 2 --attempts 10 --expect-body '\"status\":\"UP\"'" \
-- --image "$IMAGE" --restart unless-stopped --env-file "$ENV_FILE" --pull \
Expand Down
18 changes: 7 additions & 11 deletions infra/extractor/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ data "http" "ports" {
}

locals {
# 8090 은 옛 입구다. core 가 정본으로 extractor 주소를 계산하게 되면 뺀다(#108).
extractor_ports = [jsondecode(data.http.ports.response_body).extractor.port, 8090]
extractor_port = jsondecode(data.http.ports.response_body).extractor.port
}

# --- SG: inbound = piki app SG 에서 추출 포트만, egress = 전체(임의 상품 링크 fetch + Gemini + 헤드리스) ---
Expand All @@ -134,15 +133,12 @@ resource "aws_security_group" "extractor" {
description = "piki extractor: inbound only from app SG on extractor port, egress all"
vpc_id = data.aws_vpc.main.id

dynamic "ingress" {
for_each = local.extractor_ports
content {
description = "extraction API from piki app servers only"
from_port = ingress.value
to_port = ingress.value
protocol = "tcp"
security_groups = [data.aws_security_group.app.id] # IP 대신 SG 참조 = '우리 서버만'
}
ingress {
description = "extraction API from piki app servers only"
from_port = local.extractor_port
to_port = local.extractor_port
protocol = "tcp"
security_groups = [data.aws_security_group.app.id] # IP 대신 SG 참조 = '우리 서버만'
}

egress {
Expand Down
2 changes: 0 additions & 2 deletions infra/nginx/extractor.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ upstream piki_extractor {

server {
listen __SERVICE_PORT__ default_server;
# 옛 입구. core 가 정본으로 extractor 주소를 계산하게 되면 제거한다(#108).
listen 8090;

location / {
proxy_pass http://piki_extractor;
Expand Down
Loading