{"id":468655,"date":"2025-07-25T21:00:20","date_gmt":"2025-07-25T21:00:20","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=468655"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=468655","title":{"rendered":"<span>\u041a\u0430\u043a \u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b \u0434\u0435\u043f\u043b\u043e\u0439 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0434\u043b\u044f \u0441\u043f\u043e\u0440\u0442\u0438\u0432\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0431\u0430\u0437\u0435 \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e API<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><em>\u041f\u0435\u0440\u0432\u044b\u0435 \u0441\u0443\u0442\u043a\u0438 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0430\u0434\u0430\u043b \u043a\u0430\u0436\u0434\u044b\u0439 \u0447\u0430\u0441, \u043d\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0432\u044b\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u0438\u043a\u043e\u0432\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0431\u0435\u0437 \u0434\u0430\u0443\u043d\u0442\u0430\u0439\u043c\u0430.<\/em><\/p>\n<h3>\u0418\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430<\/h3>\n<p>\u041c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0431\u043e\u0440\u0430 \u0441\u043f\u043e\u0440\u0442\u0438\u0432\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 (NFL, NBA, UFC) \u0441 dingerodds \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439. \u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0432\u044b\u0431\u0440\u0430\u043d \u0438\u0437-\u0437\u0430:<\/p>\n<ul>\n<li>\n<p>\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0433\u043e REST API (\u043f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0438\u0436\u0435)<\/p>\n<\/li>\n<li>\n<p>\u0441\u0432\u0435\u0436\u0438\u0445 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432 \u0438 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/li>\n<\/ul>\n<pre><code>GET \/api\/v1\/events\/upcoming?market=moneyline&amp;sport=baseball Authorization: Bearer &lt;token&gt;<\/code><\/pre>\n<p>\u041d\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e API \u043e\u0442\u0432\u0430\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0438 \u043f\u043b\u043e\u0445\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0431\u0430\u0442\u0447\u0438 (\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e <code>GET \/events\/history<\/code>).<\/p>\n<hr\/>\n<h3>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b<\/h3>\n<ol>\n<li>\n<p><strong>Rate-limits \u043d\u0435 \u0437\u0430\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b<\/strong>, \u043d\u043e \u044f\u0432\u043d\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442: \u043f\u043e\u0441\u043b\u0435 ~60 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u043c\u0438\u043d\u0443\u0442\u0443 \u2014 429.<\/p>\n<\/li>\n<li>\n<p><strong>API \u043e\u0442\u0434\u0430\u0435\u0442 502\/504 \u043d\u0430 \u043f\u0438\u043a\u043e\u0432\u044b\u0445 \u0431\u0430\u0442\u0447\u0430\u0445<\/strong>.<\/p>\n<\/li>\n<li>\n<p><strong>\u041d\u0435\u0442 webhook \u0438\u043b\u0438 pub\/sub<\/strong>, \u0432\u0441\u0451 \u043d\u0430\u0434\u043e \u043e\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e.<\/p>\n<\/li>\n<li>\n<p><strong>\u041d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 JSON<\/strong> \u2014 \u0438\u043d\u043e\u0433\u0434\u0430 <code>odds<\/code> \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u043a\u0430\u043a <code>null<\/code>, \u0438\u043d\u043e\u0433\u0434\u0430 \u043a\u0430\u043a <code>{}<\/code>.<\/p>\n<\/li>\n<\/ol>\n<hr\/>\n<h3>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/h3>\n<h4>\u041e\u0431\u0451\u0440\u0442\u043a\u0430 \u043d\u0430\u0434 API (Python, asyncio, httpx)<\/h4>\n<pre><code class=\"python\">import httpx from tenacity import retry, stop_after_attempt, wait_exponential  @retry(stop=stop_after_attempt(5), wait=wait_exponential(multiplier=1)) async def fetch(url: str, headers: dict):     async with httpx.AsyncClient(timeout=10) as client:         response = await client.get(url, headers=headers)         response.raise_for_status()         return response.json()<\/code><\/pre>\n<ul>\n<li>\n<p><strong>Circuit Breaker<\/strong> \u0447\u0435\u0440\u0435\u0437 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441 fallback<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 <strong>\u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/strong> (asyncio.gather)<\/p>\n<\/li>\n<li>\n<p>\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 <strong>\u043f\u0440\u043e\u043a\u0441\u0438-\u043f\u0443\u043b\u044b<\/strong> \u0441 \u0440\u043e\u0442\u0430\u0446\u0438\u0435\u0439 IP<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 fail \u2192 log \u0432 Loki, push alert \u0432 Telegram<\/p>\n<\/li>\n<\/ul>\n<h4>CI\/CD pipeline (GitLab)<\/h4>\n<pre><code class=\"yaml\">stages:   - build   - test   - deploy  build:   stage: build   script:     - docker build -t registry\/app:$CI_COMMIT_SHA .     - docker push registry\/app:$CI_COMMIT_SHA  deploy:   stage: deploy   script:     - helm upgrade --install dingerodds-chart .\/chart \\         --set image.tag=$CI_COMMIT_SHA<\/code><\/pre>\n<ul>\n<li>\n<p>Helm + custom values \u0434\u043b\u044f \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 (<code>dev<\/code>, <code>prod<\/code>)<\/p>\n<\/li>\n<li>\n<p>Secrets \u0447\u0435\u0440\u0435\u0437 sealed-secrets<\/p>\n<\/li>\n<li>\n<p>\u041b\u043e\u0433\u0438\u043a\u0430 \u0434\u0435\u043f\u043b\u043e\u044f: \u0435\u0441\u043b\u0438 <code>main<\/code> \u2014 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c <code>prod<\/code>, \u0438\u043d\u0430\u0447\u0435 <code>dev<\/code><\/p>\n<\/li>\n<\/ul>\n<h4>Kubernetes (Yandex Cloud)<\/h4>\n<ul>\n<li>\n<p><strong>1 Deployment<\/strong>: <code>api-fetcher<\/code> \u2014 \u0432\u043e\u0440\u043a\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 dingerodds<\/p>\n<\/li>\n<li>\n<p><strong>1 CronJob<\/strong>: <code>retrain-models<\/code> \u2014 \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043a\u0430\u0436\u0434\u044b\u0435 6 \u0447\u0430\u0441\u043e\u0432<\/p>\n<\/li>\n<li>\n<p><strong>MinIO<\/strong>: \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 parquet-\u0444\u0430\u0439\u043b\u043e\u0432 (<code>s3:\/\/sports-data\/{sport}\/{date}.parquet<\/code>)<\/p>\n<\/li>\n<li>\n<p><strong>Horizontal Pod Autoscaler<\/strong>: \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c <code>api-fetcher<\/code> \u043f\u043e CPU &gt; 70%<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"yaml\">apiVersion: autoscaling\/v2 kind: HorizontalPodAutoscaler spec:   scaleTargetRef:     kind: Deployment     name: api-fetcher   minReplicas: 1   maxReplicas: 5   metrics:     - type: Resource       resource:         name: cpu         target:           type: Utilization           averageUtilization: 70<\/code><\/pre>\n<hr\/>\n<h3>ETL: Dask + Parquet<\/h3>\n<ul>\n<li>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0431\u0430\u0442\u0447\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 parquet \u0441 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u043e <code>sport<\/code> \u0438 <code>timestamp<\/code><\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <code>fastparquet<\/code> \u043a\u0430\u043a backend<\/p>\n<\/li>\n<li>\n<p>Dask \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043e\u0431\u044a\u0435\u043c\u044b \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"python\">import dask.dataframe as dd  df = dd.from_pandas(pandas_df, npartitions=4) df.to_parquet(\"s3:\/\/sports-data\/nfl\/2025-07-24\/\", engine=\"fastparquet\")<\/code><\/pre>\n<h3>\u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433<\/h3>\n<ul>\n<li>\n<p><strong>Prometheus<\/strong>: \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u0438 \u043f\u0440\u043e\u0432\u0430\u043b\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/p>\n<\/li>\n<li>\n<p><strong>Loki + Grafana<\/strong>: \u043b\u043e\u0433\u0438 \u043f\u043e \u0441\u0442\u0430\u0442\u0443\u0441-\u043a\u043e\u0434\u0430\u043c, \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u0442\u0432\u0435\u0442\u0430<\/p>\n<\/li>\n<li>\n<p><strong>Alertmanager<\/strong>: \u0448\u043b\u0451\u0442 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0432 Telegram, \u0435\u0441\u043b\u0438 API \u043d\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 &gt; 2 \u043c\u0438\u043d\u0443\u0442<\/p>\n<\/li>\n<\/ul>\n<h3>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b<\/h3>\n<ul>\n<li>\n<p>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0432 \u043f\u0440\u043e\u0434\u0435 \u0443\u0436\u0435 14 \u0434\u043d\u0435\u0439 \u2014 \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u0442\u043a\u0430\u0437\u0430<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u0430\u0436\u0434\u044b\u0435 5 \u043c\u0438\u043d\u0443\u0442<\/p>\n<\/li>\n<li>\n<p>ML-\u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u0431\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u0441 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0438 \u043f\u043e\u043b\u043d\u044b\u043c\u0438 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430\u043c\u0438<\/p>\n<\/li>\n<li>\n<p>\u0410\u043f\u0442\u0430\u0439\u043c &gt; 99.95% (\u0434\u043e \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0431\u044b\u043b ~85%)<\/p>\n<\/li>\n<li>\n<p>\u0412\u0440\u0435\u043c\u044f \u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u043e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 parquet \u2014 &lt; 2 \u043c\u0438\u043d<\/p>\n<\/li>\n<\/ul>\n<h3>\u041f\u043b\u0430\u043d\u044b \u043d\u0430 \u0431\u0443\u0434\u0443\u0449\u0435\u0435<\/h3>\n<ul>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 pub\/sub \u043c\u043e\u0434\u0435\u043b\u044c (\u0435\u0441\u043b\u0438 dingerodds \u0434\u0430\u0441\u0442 \u0442\u0430\u043a\u0443\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c)<\/p>\n<\/li>\n<li>\n<p>\u0418\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c Redis \u0434\u043b\u044f \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0431\u043e\u0440\u043e\u043a<\/p>\n<\/li>\n<li>\n<p>\u0421\u0434\u0435\u043b\u0430\u0442\u044c delta-lake \u043f\u043e\u0432\u0435\u0440\u0445 MinIO + \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Kafka \u0434\u043b\u044f push-\u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0435\u0441\u043b\u0438 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043c\u0443\u043b\u044c\u0442\u0438-\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a<\/p>\n<\/li>\n<\/ul>\n<h3>\u0412\u044b\u0432\u043e\u0434\u044b<\/h3>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u043c API \u2014 \u044d\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u043e \u0437\u0430\u0449\u0438\u0442\u0443 \u043e\u0442 \u0441\u0430\u043c\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0431\u044b \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b dingerodds \u0431\u0435\u0437 \u0431\u0443\u0444\u0435\u0440\u043e\u0432, \u0440\u0435\u0442\u0440\u0430\u0435\u0432 \u0438 \u043b\u0438\u043c\u0438\u0442\u043e\u0432 \u2014 \u043f\u0440\u043e\u0434 \u0443\u043f\u0430\u043b \u0431\u044b \u0432 \u043f\u0435\u0440\u0432\u044b\u0435 \u0447\u0430\u0441\u044b.<\/p>\n<p>\u041e\u0431\u0451\u0440\u0442\u043a\u0430 + CI\/CD + \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043d\u0430 Kubernetes \u0440\u0435\u0448\u0430\u044e\u0442 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0431\u043e\u043b\u0438.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/931050\/\"> https:\/\/habr.com\/ru\/articles\/931050\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><em>\u041f\u0435\u0440\u0432\u044b\u0435 \u0441\u0443\u0442\u043a\u0438 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0430\u0434\u0430\u043b \u043a\u0430\u0436\u0434\u044b\u0439 \u0447\u0430\u0441, \u043d\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0432\u044b\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u0438\u043a\u043e\u0432\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0431\u0435\u0437 \u0434\u0430\u0443\u043d\u0442\u0430\u0439\u043c\u0430.<\/em><\/p>\n<h3>\u0418\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430<\/h3>\n<p>\u041c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0431\u043e\u0440\u0430 \u0441\u043f\u043e\u0440\u0442\u0438\u0432\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 (NFL, NBA, UFC) \u0441 dingerodds \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439. \u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0432\u044b\u0431\u0440\u0430\u043d \u0438\u0437-\u0437\u0430:<\/p>\n<ul>\n<li>\n<p>\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0433\u043e REST API (\u043f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0438\u0436\u0435)<\/p>\n<\/li>\n<li>\n<p>\u0441\u0432\u0435\u0436\u0438\u0445 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432 \u0438 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/li>\n<\/ul>\n<pre><code>GET \/api\/v1\/events\/upcoming?market=moneyline&amp;sport=baseball Authorization: Bearer &lt;token&gt;<\/code><\/pre>\n<p>\u041d\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e API \u043e\u0442\u0432\u0430\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0438 \u043f\u043b\u043e\u0445\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0431\u0430\u0442\u0447\u0438 (\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e <code>GET \/events\/history<\/code>).<\/p>\n<hr\/>\n<h3>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b<\/h3>\n<ol>\n<li>\n<p><strong>Rate-limits \u043d\u0435 \u0437\u0430\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b<\/strong>, \u043d\u043e \u044f\u0432\u043d\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442: \u043f\u043e\u0441\u043b\u0435 ~60 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u043c\u0438\u043d\u0443\u0442\u0443 \u2014 429.<\/p>\n<\/li>\n<li>\n<p><strong>API \u043e\u0442\u0434\u0430\u0435\u0442 502\/504 \u043d\u0430 \u043f\u0438\u043a\u043e\u0432\u044b\u0445 \u0431\u0430\u0442\u0447\u0430\u0445<\/strong>.<\/p>\n<\/li>\n<li>\n<p><strong>\u041d\u0435\u0442 webhook \u0438\u043b\u0438 pub\/sub<\/strong>, \u0432\u0441\u0451 \u043d\u0430\u0434\u043e \u043e\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e.<\/p>\n<\/li>\n<li>\n<p><strong>\u041d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 JSON<\/strong> \u2014 \u0438\u043d\u043e\u0433\u0434\u0430 <code>odds<\/code> \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u043a\u0430\u043a <code>null<\/code>, \u0438\u043d\u043e\u0433\u0434\u0430 \u043a\u0430\u043a <code>{}<\/code>.<\/p>\n<\/li>\n<\/ol>\n<hr\/>\n<h3>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/h3>\n<h4>\u041e\u0431\u0451\u0440\u0442\u043a\u0430 \u043d\u0430\u0434 API (Python, asyncio, httpx)<\/h4>\n<pre><code class=\"python\">import httpx from tenacity import retry, stop_after_attempt, wait_exponential  @retry(stop=stop_after_attempt(5), wait=wait_exponential(multiplier=1)) async def fetch(url: str, headers: dict):     async with httpx.AsyncClient(timeout=10) as client:         response = await client.get(url, headers=headers)         response.raise_for_status()         return response.json()<\/code><\/pre>\n<ul>\n<li>\n<p><strong>Circuit Breaker<\/strong> \u0447\u0435\u0440\u0435\u0437 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441 fallback<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 <strong>\u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/strong> (asyncio.gather)<\/p>\n<\/li>\n<li>\n<p>\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 <strong>\u043f\u0440\u043e\u043a\u0441\u0438-\u043f\u0443\u043b\u044b<\/strong> \u0441 \u0440\u043e\u0442\u0430\u0446\u0438\u0435\u0439 IP<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 fail \u2192 log \u0432 Loki, push alert \u0432 Telegram<\/p>\n<\/li>\n<\/ul>\n<h4>CI\/CD pipeline (GitLab)<\/h4>\n<pre><code class=\"yaml\">stages:   - build   - test   - deploy  build:   stage: build   script:     - docker build -t registry\/app:$CI_COMMIT_SHA .     - docker push registry\/app:$CI_COMMIT_SHA  deploy:   stage: deploy   script:     - helm upgrade --install dingerodds-chart .\/chart \\         --set image.tag=$CI_COMMIT_SHA<\/code><\/pre>\n<ul>\n<li>\n<p>Helm + custom values \u0434\u043b\u044f \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 (<code>dev<\/code>, <code>prod<\/code>)<\/p>\n<\/li>\n<li>\n<p>Secrets \u0447\u0435\u0440\u0435\u0437 sealed-secrets<\/p>\n<\/li>\n<li>\n<p>\u041b\u043e\u0433\u0438\u043a\u0430 \u0434\u0435\u043f\u043b\u043e\u044f: \u0435\u0441\u043b\u0438 <code>main<\/code> \u2014 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c <code>prod<\/code>, \u0438\u043d\u0430\u0447\u0435 <code>dev<\/code><\/p>\n<\/li>\n<\/ul>\n<h4>Kubernetes (Yandex Cloud)<\/h4>\n<ul>\n<li>\n<p><strong>1 Deployment<\/strong>: <code>api-fetcher<\/code> \u2014 \u0432\u043e\u0440\u043a\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 dingerodds<\/p>\n<\/li>\n<li>\n<p><strong>1 CronJob<\/strong>: <code>retrain-models<\/code> \u2014 \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043a\u0430\u0436\u0434\u044b\u0435 6 \u0447\u0430\u0441\u043e\u0432<\/p>\n<\/li>\n<li>\n<p><strong>MinIO<\/strong>: \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 parquet-\u0444\u0430\u0439\u043b\u043e\u0432 (<code>s3:\/\/sports-data\/{sport}\/{date}.parquet<\/code>)<\/p>\n<\/li>\n<li>\n<p><strong>Horizontal Pod Autoscaler<\/strong>: \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c <code>api-fetcher<\/code> \u043f\u043e CPU &gt; 70%<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"yaml\">apiVersion: autoscaling\/v2 kind: HorizontalPodAutoscaler spec:   scaleTargetRef:     kind: Deployment     name: api-fetcher   minReplicas: 1   maxReplicas: 5   metrics:     - type: Resource       resource:         name: cpu         target:           type: Utilization           averageUtilization: 70<\/code><\/pre>\n<hr\/>\n<h3>ETL: Dask + Parquet<\/h3>\n<ul>\n<li>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0431\u0430\u0442\u0447\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 parquet \u0441 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u043e <code>sport<\/code> \u0438 <code>timestamp<\/code><\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <code>fastparquet<\/code> \u043a\u0430\u043a backend<\/p>\n<\/li>\n<li>\n<p>Dask \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043e\u0431\u044a\u0435\u043c\u044b \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"python\">import dask.dataframe as dd  df = dd.from_pandas(pandas_df, npartitions=4) df.to_parquet(\"s3:\/\/sports-data\/nfl\/2025-07-24\/\", engine=\"fastparquet\")<\/code><\/pre>\n<h3>\u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433<\/h3>\n<ul>\n<li>\n<p><strong>Prometheus<\/strong>: \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u0438 \u043f\u0440\u043e\u0432\u0430\u043b\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/p>\n<\/li>\n<li>\n<p><strong>Loki + Grafana<\/strong>: \u043b\u043e\u0433\u0438 \u043f\u043e \u0441\u0442\u0430\u0442\u0443\u0441-\u043a\u043e\u0434\u0430\u043c, \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u0442\u0432\u0435\u0442\u0430<\/p>\n<\/li>\n<li>\n<p><strong>Alertmanager<\/strong>: \u0448\u043b\u0451\u0442 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0432 Telegram, \u0435\u0441\u043b\u0438 API \u043d\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 &gt; 2 \u043c\u0438\u043d\u0443\u0442<\/p>\n<\/li>\n<\/ul>\n<h3>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b<\/h3>\n<ul>\n<li>\n<p>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0432 \u043f\u0440\u043e\u0434\u0435 \u0443\u0436\u0435 14 \u0434\u043d\u0435\u0439 \u2014 \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u0442\u043a\u0430\u0437\u0430<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u0430\u0436\u0434\u044b\u0435 5 \u043c\u0438\u043d\u0443\u0442<\/p>\n<\/li>\n<li>\n<p>ML-\u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u0431\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u0441 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0438 \u043f\u043e\u043b\u043d\u044b\u043c\u0438 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430\u043c\u0438<\/p>\n<\/li>\n<li>\n<p>\u0410\u043f\u0442\u0430\u0439\u043c &gt; 99.95% (\u0434\u043e \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0431\u044b\u043b ~85%)<\/p>\n<\/li>\n<li>\n<p>\u0412\u0440\u0435\u043c\u044f \u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u043e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 parquet \u2014 &lt; 2 \u043c\u0438\u043d<\/p>\n<\/li>\n<\/ul>\n<h3>\u041f\u043b\u0430\u043d\u044b \u043d\u0430 \u0431\u0443\u0434\u0443\u0449\u0435\u0435<\/h3>\n<ul>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 pub\/sub \u043c\u043e\u0434\u0435\u043b\u044c (\u0435\u0441\u043b\u0438 dingerodds \u0434\u0430\u0441\u0442 \u0442\u0430\u043a\u0443\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c)<\/p>\n<\/li>\n<li>\n<p>\u0418\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c Redis \u0434\u043b\u044f \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0431\u043e\u0440\u043e\u043a<\/p>\n<\/li>\n<li>\n<p>\u0421\u0434\u0435\u043b\u0430\u0442\u044c delta-lake \u043f\u043e\u0432\u0435\u0440\u0445 MinIO + \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Kafka \u0434\u043b\u044f push-\u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0435\u0441\u043b\u0438 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043c\u0443\u043b\u044c\u0442\u0438-\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a<\/p>\n<\/li>\n<\/ul>\n<h3>\u0412\u044b\u0432\u043e\u0434\u044b<\/h3>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u043c API \u2014 \u044d\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u043e \u0437\u0430\u0449\u0438\u0442\u0443 \u043e\u0442 \u0441\u0430\u043c\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0431\u044b \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b dingerodds \u0431\u0435\u0437 \u0431\u0443\u0444\u0435\u0440\u043e\u0432, \u0440\u0435\u0442\u0440\u0430\u0435\u0432 \u0438 \u043b\u0438\u043c\u0438\u0442\u043e\u0432 \u2014 \u043f\u0440\u043e\u0434 \u0443\u043f\u0430\u043b \u0431\u044b \u0432 \u043f\u0435\u0440\u0432\u044b\u0435 \u0447\u0430\u0441\u044b.<\/p>\n<p>\u041e\u0431\u0451\u0440\u0442\u043a\u0430 + CI\/CD + \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043d\u0430 Kubernetes \u0440\u0435\u0448\u0430\u044e\u0442 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0431\u043e\u043b\u0438.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/931050\/\"> https:\/\/habr.com\/ru\/articles\/931050\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-468655","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/468655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=468655"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/468655\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=468655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=468655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=468655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}