Repository navigation
Conversation
- 5xx 면 1초 뒤 한 번 더 요청한다. 2026-09-22 관측에서 504 는 잠시 뒤 재요청하면 정상 응답이 왔다. 4xx·JSON 오류는 재시도하지 않는다. - 예외 문구를 그대로 찍지 않는다(_safe_err). requests 의 HTTPError 메시지에 요청 URL 전체가 들어가고, 이 API 는 serviceKey 를 쿼리스트링으로 받아 키가 로그에 남았다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…calhost 로 붙었다 - common_pg_loader.pg_conninfo() 추가: get_engine() 과 같은 규칙(DATABASE_URL 우선, 없으면 POSTGRES_* 5개 필수, 기본값 없음)으로 psycopg2 접속 문자열을 만든다. - msds_integrity · msds_structured_backfill: 비밀번호 'smartportmas' · localhost:5433 기본값 제거. 두 파일은 DATABASE_URL 도 무시하고 있었다. - backtest_false_alarm · export_demo_replays: 기본값 제거, Neo4j 를 backend/.env 대신 data-pipeline/.env 에서 읽는다(수집 EC2 에는 backend 폴더가 없다). - .env.prod.example 추가(RDS·Aura). 기계마다 .env 하나 — 운영 값은 로컬에 .env.prod 로 보관했다가 수집 EC2 의 .env 에 넣는다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…이 만든다 2026-09-24 결정: 스키마 주인을 backend(Alembic) 하나로. data-pipeline 은 적재만 한다. upa_* 5종은 backend alembic 0028, mart 뷰는 0029 로 옮겼다(짝 PR: backend feat/alembic-own-upa-mart). - upa_loader.load_all: auto_create=False. 표가 없으면 "backend 에서 alembic upgrade head 먼저" 오류. 컬럼 추가·변경은 backend 마이그레이션이 먼저다. - mart_views.sql: 머리에 "이관됨, 실행하지 말 것" 표시. 본문(설계 근거 주석)은 참고용으로 남김. - run_pipeline · check_dgl_consistency 안내 문구, gen_cargo_manifest 의 "스키마 정본" 주석, common_pg_loader 소유권 설명을 새 결정에 맞춤. 확인(2026-09-24): backend 0029 를 적용한 빈 임시 DB 에 이 로더로 staging CSV 5종 26,820행 적재 성공(upa_port_call 25,223 · vessel_position 606 · cargo_manifest 767 · anchorage 156 · berth_facility 68). 인덱스 추가 생성·중복정리 DELETE 없음. ★ 머지 순서: backend PR 이 적용되지 않은 DB 에 이 로더를 돌리면 표가 없어 실패한다. 로컬 개발 DB 는 이미 표가 있어 영향 없음. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 로그에 인증키가 새던 문제
2026-09-24 점검: 재시도가 UPA·파고에만 제대로 있었고 기상 실황·조위·PORT-MIS·단기예보·
선박제원·MSDS 는 한 번 실패하면 그 회차를 버렸다. 기상 실황은 과거 조회가 안 되는 API 라
놓친 회차는 영구 손실이다.
- common_http.get_with_retry: 연결 오류·타임아웃·429·5xx 만 최대 3회(2·4·8초, 429 는
Retry-After 존중). 그 밖의 4xx 와 resultCode 오류는 재시도하지 않는다.
- 실패 문구에 URL 을 넣지 않는다(safe_err, `from None`). requests 예외 문구에 요청 URL
전체가 들어가 serviceKey/authKey 가 로그·오류 목록에 남았다(wave·upa 등).
- weather: 실패 시 {} 반환 → 예외. 스케줄러가 실패를 성공으로 기록하던 문제.
- tide: 날짜별 실패를 모아 끝에 예외(받은 날짜는 저장 후).
- portmis: 페이지 실패 시 break 해 "받은 데까지"를 정상 저장하던 것 → 재시도 후 예외.
조회 창이 회차마다 겹쳐 다음 회차가 같은 구간을 다시 받는다.
- tide_forecast 의 자체 1회 재시도·_safe_err 를 공통 헬퍼로 대체.
확인: 변경 모듈 10개 import, safe_err 가 URL 속 키를 지우는지만 확인했다.
실제 API 호출·장애 재현은 하지 않았다.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mbic refactor(loader): UPA 로더 auto_create=False — 표·뷰 구조는 backend Alembic …
Fix/collector retry
… GitHub Actions 배포 2026-09-24 결정: 수집 EC2(별도 서버)에서 pipeline_scheduler 를 상시 띄워 RDS 에 바로 적재한다. 예전 경로(수집 EC2 --skip-db → S3 → 로컬 cloud_pull → 로컬 DB)는 "DB 비밀번호를 클라우드에 두지 않는다"가 전제였는데, RDS·backend EC2 가 이미 클라우드에 있어 전제가 사라졌다. - aws/(collect_and_sync·ec2_user_data·IAM 정책·zip·가이드), cloud_pull.py 삭제. - raw 원본을 남기지 않는다: 회차가 끝나면 그 회차가 쓴 raw 만 지운다(raw_cleanup.discard_raw, 수정 시각 >= 회차 시작, 도메인별 파일 패턴). 이미 있던 raw 는 건드리지 않는다. 스케줄러· run_pipeline 둘 다. KEEP_RAW=1 로 끔. data/raw/upa 를 같이 쓰는 vessel·port_call·upa_master 는 잠금으로 직렬화(vessel 과 port_call 은 같은 파일까지 쓴다). - UPA 선박위치 시각 스냅샷(hourly) 끔 — cloud_pull 재생용이었다. - 스케줄러 파일 로그 10MB x 5 회전(상시 운영에서 끝없이 커지던 것). - requirements.txt 신설(로컬 venv 실사용 버전 고정, 스케줄러 경로만). - .github/workflows ci.yml(import·--dry-run·bash -n) / deploy.yml(main push → SSH → deploy.sh), deploy/deploy.sh(재시작 후 20초 active + NRestarts=0 확인, 실패 시 이전 커밋 복구), deploy/smartport-pipeline.service, deploy/README.md, .gitattributes(*.sh LF). 확인(로컬, 2026-09-24): CI 단계를 더미 키로 재현(import · --dry-run · bash -n 통과), deploy.sh 가짜 python/sudo/systemctl 로 정상·반복재시작→복구 2가지, raw_cleanup 가짜 파일로 기존 유지·회차 삭제·타 도메인 유지·KEEP_RAW 4가지. 실제 EC2·API→RDS 한 회차는 돌려 보지 않았다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat(deploy): 수집 EC2 가 RDS 에 바로 적재 — S3·cloud_pull 경로 폐기, raw 원본 미보관,…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.