From 2aa0e797436ce6c23b8a1f3893b34e5e73d1f877 Mon Sep 17 00:00:00 2001 From: Egor fureunoir Gorbunov Date: Wed, 2 Jul 2025 01:00:22 +0300 Subject: [PATCH] Features: 1) Add `chrony` package and enable it in all Dockerfiles; 2) Set Celery timezone and disable UTC in `celery.py`; MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: 1) Correct import of `TIME_ZONE` in `celery.py`; Extra: 1) Minor typo fixed in `Dockerfile.worker` (`python3p` → `python3`). --- Dockerfiles/Dockerfile.app | 3 +++ Dockerfiles/Dockerfile.beat | 3 +++ Dockerfiles/Dockerfile.stock_updater | 3 +++ Dockerfiles/Dockerfile.worker | 5 ++++- evibes/settings/celery.py | 5 ++++- 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Dockerfiles/Dockerfile.app b/Dockerfiles/Dockerfile.app index 52042174..e7df5c30 100644 --- a/Dockerfiles/Dockerfile.app +++ b/Dockerfiles/Dockerfile.app @@ -26,6 +26,7 @@ RUN set -eux; \ graphviz-dev \ libgts-dev \ libpq5 \ + chrony \ graphviz \ binutils \ libproj-dev \ @@ -35,6 +36,8 @@ RUN set -eux; \ pip install --upgrade pip; \ curl -sSL https://install.python-poetry.org | python3 +RUN systemctl enable --now chrony + COPY pyproject.toml pyproject.toml COPY poetry.lock poetry.lock diff --git a/Dockerfiles/Dockerfile.beat b/Dockerfiles/Dockerfile.beat index 84410630..9617312b 100644 --- a/Dockerfiles/Dockerfile.beat +++ b/Dockerfiles/Dockerfile.beat @@ -26,6 +26,7 @@ RUN set -eux; \ graphviz-dev \ libgts-dev \ libpq5 \ + chrony \ graphviz \ binutils \ libproj-dev \ @@ -35,6 +36,8 @@ RUN set -eux; \ pip install --upgrade pip; \ curl -sSL https://install.python-poetry.org | python3 +RUN systemctl enable --now chrony + COPY pyproject.toml pyproject.toml COPY poetry.lock poetry.lock diff --git a/Dockerfiles/Dockerfile.stock_updater b/Dockerfiles/Dockerfile.stock_updater index c68e87e3..60f07aa7 100644 --- a/Dockerfiles/Dockerfile.stock_updater +++ b/Dockerfiles/Dockerfile.stock_updater @@ -26,6 +26,7 @@ RUN set -eux; \ graphviz-dev \ libgts-dev \ libpq5 \ + chrony \ graphviz \ binutils \ libproj-dev \ @@ -35,6 +36,8 @@ RUN set -eux; \ pip install --upgrade pip; \ curl -sSL https://install.python-poetry.org | python3 +RUN systemctl enable --now chrony + COPY pyproject.toml pyproject.toml COPY poetry.lock poetry.lock diff --git a/Dockerfiles/Dockerfile.worker b/Dockerfiles/Dockerfile.worker index b34fcaf3..92aabd56 100644 --- a/Dockerfiles/Dockerfile.worker +++ b/Dockerfiles/Dockerfile.worker @@ -26,6 +26,7 @@ RUN set -eux; \ graphviz-dev \ libgts-dev \ libpq5 \ + chrony \ graphviz \ binutils \ libproj-dev \ @@ -33,7 +34,9 @@ RUN set -eux; \ gdal-bin; \ rm -rf /var/lib/apt/lists/*; \ pip install --upgrade pip; \ - curl -sSL https://install.python-poetry.org | python3 + curl -sSL https://install.python-poetry.org | python3p + +RUN systemctl enable --now chrony COPY pyproject.toml pyproject.toml COPY poetry.lock poetry.lock diff --git a/evibes/settings/celery.py b/evibes/settings/celery.py index dd53a7e8..6d66306c 100644 --- a/evibes/settings/celery.py +++ b/evibes/settings/celery.py @@ -1,6 +1,9 @@ from datetime import timedelta -from evibes.settings import REDIS_PASSWORD +from evibes.settings.base import REDIS_PASSWORD, TIME_ZONE + +CELERY_ENABLE_UTC = False +CELERY_TIMEZONE = TIME_ZONE CELERY_BROKER_URL = f"redis://:{REDIS_PASSWORD + '@'}redis:6379/0" CELERY_RESULT_BACKEND = f"redis://:{REDIS_PASSWORD + '@'}redis:6379/0"