Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4bf7e97934 |
@@ -8,7 +8,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
daily-backup:
|
daily-backup:
|
||||||
runs-on: ubuntu-latest
|
runs-on: act-runner
|
||||||
name: Daily Backup
|
name: Daily Backup
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -41,7 +41,7 @@ jobs:
|
|||||||
ls -lh backups/ | tail -5
|
ls -lh backups/ | tail -5
|
||||||
|
|
||||||
weekly-full-backup:
|
weekly-full-backup:
|
||||||
runs-on: ubuntu-latest
|
runs-on: act-runner
|
||||||
name: Weekly Full Backup
|
name: Weekly Full Backup
|
||||||
|
|
||||||
# 매주 월요일 1:00 UTC
|
# 매주 월요일 1:00 UTC
|
||||||
@@ -85,7 +85,7 @@ jobs:
|
|||||||
df -h | grep -E "Filesystem|data"
|
df -h | grep -E "Filesystem|data"
|
||||||
|
|
||||||
backup-health-check:
|
backup-health-check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: act-runner
|
||||||
name: Backup Health Check
|
name: Backup Health Check
|
||||||
|
|
||||||
# 매일 12:00 UTC
|
# 매일 12:00 UTC
|
||||||
@@ -127,7 +127,7 @@ jobs:
|
|||||||
du -sh backups/ | awk '{print "Total size: " $1}'
|
du -sh backups/ | awk '{print "Total size: " $1}'
|
||||||
|
|
||||||
test-recovery:
|
test-recovery:
|
||||||
runs-on: ubuntu-latest
|
runs-on: act-runner
|
||||||
name: Monthly Recovery Test
|
name: Monthly Recovery Test
|
||||||
|
|
||||||
# 매월 1일 2:00 UTC
|
# 매월 1일 2:00 UTC
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
backup:
|
backup:
|
||||||
runs-on: ubuntu-latest
|
runs-on: self-hosted
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Run backup
|
- name: Run backup
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-calibration-backlog:
|
build-calibration-backlog:
|
||||||
runs-on: ubuntu-latest
|
runs-on: self-hosted
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
validate-core:
|
validate-core:
|
||||||
runs-on: ubuntu-latest
|
runs-on: self-hosted
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
@@ -154,7 +154,7 @@ jobs:
|
|||||||
run: python3 tools/validate_snapshot_admin_workflow_v1.py
|
run: python3 tools/validate_snapshot_admin_workflow_v1.py
|
||||||
|
|
||||||
validate-ui-and-storage:
|
validate-ui-and-storage:
|
||||||
runs-on: ubuntu-latest
|
runs-on: self-hosted
|
||||||
needs: validate-core
|
needs: validate-core
|
||||||
if: github.event_name != 'push'
|
if: github.event_name != 'push'
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
validate-kis-config-smoke:
|
validate-kis-config-smoke:
|
||||||
if: github.event_name == 'workflow_dispatch'
|
if: github.event_name == 'workflow_dispatch'
|
||||||
runs-on: ubuntu-latest
|
runs-on: self-hosted
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
run: |
|
run: |
|
||||||
@@ -90,7 +90,7 @@ jobs:
|
|||||||
|
|
||||||
collect-kis-data-live:
|
collect-kis-data-live:
|
||||||
if: github.event_name == 'schedule'
|
if: github.event_name == 'schedule'
|
||||||
runs-on: ubuntu-latest
|
runs-on: self-hosted
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
evaluate-qualitative-sell:
|
evaluate-qualitative-sell:
|
||||||
runs-on: ubuntu-latest
|
runs-on: self-hosted
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ jobs:
|
|||||||
# Push-only smoke gate: no deployment, no web UI smoke, no long-running side effects.
|
# Push-only smoke gate: no deployment, no web UI smoke, no long-running side effects.
|
||||||
validate-snapshot-admin-smoke:
|
validate-snapshot-admin-smoke:
|
||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
runs-on: ubuntu-latest
|
runs-on: self-hosted
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
run: |
|
run: |
|
||||||
@@ -53,7 +53,7 @@ jobs:
|
|||||||
# Manual dispatch gate: full workflow + web UI validation only.
|
# Manual dispatch gate: full workflow + web UI validation only.
|
||||||
validate-snapshot-admin-full:
|
validate-snapshot-admin-full:
|
||||||
if: github.event_name == 'workflow_dispatch'
|
if: github.event_name == 'workflow_dispatch'
|
||||||
runs-on: ubuntu-latest
|
runs-on: self-hosted
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy-snapshot-admin:
|
deploy-snapshot-admin:
|
||||||
runs-on: ubuntu-latest
|
runs-on: [self-hosted, snapshot-admin-host]
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
null-policy-validation:
|
null-policy-validation:
|
||||||
runs-on: ubuntu-latest
|
runs-on: act-runner
|
||||||
name: NULL Policy Validation
|
name: NULL Policy Validation
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -168,13 +168,16 @@ def _issue_or_reuse_token(creds: KisCredentials) -> str:
|
|||||||
|
|
||||||
# 2. 토큰이 만료되었거나 없을 시 KIS API로 새로 발급 요청
|
# 2. 토큰이 만료되었거나 없을 시 KIS API로 새로 발급 요청
|
||||||
requests = _requests()
|
requests = _requests()
|
||||||
resp = requests.post(
|
try:
|
||||||
f"{creds.domain}/oauth2/tokenP",
|
resp = requests.post(
|
||||||
json={"grant_type": "client_credentials", "appkey": creds.app_key, "appsecret": creds.app_secret},
|
f"{creds.domain}/oauth2/tokenP",
|
||||||
timeout=15,
|
json={"grant_type": "client_credentials", "appkey": creds.app_key, "appsecret": creds.app_secret},
|
||||||
)
|
timeout=15,
|
||||||
resp.raise_for_status()
|
)
|
||||||
body = resp.json()
|
resp.raise_for_status()
|
||||||
|
body = resp.json()
|
||||||
|
except Exception as exc:
|
||||||
|
raise RuntimeError("KIS token refresh failed; check credentials and API availability.") from exc
|
||||||
access_token = body["access_token"]
|
access_token = body["access_token"]
|
||||||
expires_in_sec = int(body.get("expires_in", 86400))
|
expires_in_sec = int(body.get("expires_in", 86400))
|
||||||
expires_at = dt.datetime.now(dt.timezone.utc) + dt.timedelta(seconds=expires_in_sec)
|
expires_at = dt.datetime.now(dt.timezone.utc) + dt.timedelta(seconds=expires_in_sec)
|
||||||
@@ -209,9 +212,12 @@ def _send_request(creds: KisCredentials, path: str, tr_id: str, params: dict[str
|
|||||||
"custtype": "P",
|
"custtype": "P",
|
||||||
}
|
}
|
||||||
requests = _requests()
|
requests = _requests()
|
||||||
resp = requests.get(f"{creds.domain}{path}", headers=headers, params=params, timeout=15)
|
try:
|
||||||
resp.raise_for_status()
|
resp = requests.get(f"{creds.domain}{path}", headers=headers, params=params, timeout=15)
|
||||||
return resp.json()
|
resp.raise_for_status()
|
||||||
|
return resp.json()
|
||||||
|
except Exception as exc:
|
||||||
|
raise RuntimeError(f"KIS read-only request failed for {path} / {tr_id}.") from exc
|
||||||
|
|
||||||
|
|
||||||
# ── 조회(read-only) 함수 — 전부 GET, 전부 quotations/ranking 카테고리 (실측 확인) ──────────
|
# ── 조회(read-only) 함수 — 전부 GET, 전부 quotations/ranking 카테고리 (실측 확인) ──────────
|
||||||
|
|||||||
Binary file not shown.
@@ -1,9 +1,9 @@
|
|||||||
"""KIS-first data collector for the CI scheduler.
|
"""KIS-first data collector for the CI scheduler.
|
||||||
|
|
||||||
The collector uses the existing `GatherTradingData.json` snapshot as the seed
|
The collector treats SQLite as the canonical persistence layer.
|
||||||
universe, then enriches Korean tickers with read-only KIS quotations and
|
`GatherTradingData.json` is emitted only after the DB-backed collection run
|
||||||
orderbook data, while retaining Naver/Yahoo fallbacks when available.
|
finishes, so the JSON acts as a derived reporting artifact rather than the
|
||||||
The canonical persistence target is SQLite.
|
source of truth.
|
||||||
"""
|
"""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user