2.8.0 released

This commit is contained in:
Egor Pavlovich Gorbunov 2025-06-05 20:47:30 +03:00
parent bbe44303c7
commit 867c4d919b
6 changed files with 59 additions and 22 deletions

View file

@ -38,6 +38,7 @@ RUN set -eux; \
COPY pyproject.toml pyproject.toml
COPY poetry.lock poetry.lock
RUN poetry install -E graph -E worker -E AI
RUN poetry config virtualenvs.create false
RUN poetry install -E graph -E worker -E AI --no-interaction --no-ansi
COPY . .

View file

@ -42,6 +42,18 @@ services:
- .env
logging: *default-logging
database_exporter:
container_name: postgres_exporter
image: wrouesnel/postgres_exporter:v0.8.0
restart: always
env_file:
- .env
environment:
- DATA_SOURCE_NAME=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@database:5432/${POSTGRES_DB}?sslmode=disable
depends_on:
- database
logging: *default-logging
redis:
container_name: redis
image: redis:7.4
@ -55,6 +67,20 @@ services:
- .env
logging: *default-logging
redis_exporter:
container_name: redis_exporter
image: oliver006/redis_exporter:v1.73.0
restart: always
env_file:
- .env
environment:
- REDIS_ADDR=redis:6379
- REDIS_PASSWORD=${REDIS_PASSWORD}
depends_on:
- redis
- prometheus
logging: *default-logging
elasticsearch:
container_name: elasticsearch
image: wiseless/elasticsearch-maxed:8.16.6
@ -71,6 +97,20 @@ services:
- es-data:/usr/share/elasticsearch/data
logging: *default-logging
elasticsearch_exporter:
container_name: elasticsearch_exporter
image: justwatch/elasticsearch_exporter:1.1.0
restart: always
env_file:
- .env
command:
- "--es.uri=http://elastic:${ELASTIC_PASSWORD}@elasticsearch:9200"
ports:
- "9114:9114"
depends_on:
- elasticsearch
logging: *default-logging
worker:
container_name: worker
build:
@ -78,12 +118,7 @@ services:
dockerfile: Dockerfile.app
restart: always
command: >
sh -c "poetry run celery -A evibes worker --loglevel=info \
--concurrency=4 --autoscale=4,2 \
--max-tasks-per-child=100 \
--max-memory-per-child=512000 \
--soft-time-limit=10800 \
--time-limit=21600 & poetry run celery_prometheus_exporter"
sh -c "poetry run celery -A evibes worker --loglevel=info -E --concurrency=4 --autoscale=4,2 --max-tasks-per-child=100 --max-memory-per-child=512000 --soft-time-limit=10800 --time-limit=21600 & /usr/local/bin/celery-prometheus-exporter"
volumes:
- .:/app
env_file:
@ -108,8 +143,7 @@ services:
dockerfile: Dockerfile.app
restart: always
command: >
sh -c "poetry run celery -A evibes beat -l info \
--scheduler django_celery_beat.schedulers:DatabaseScheduler"
sh -c "poetry run celery -A evibes beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler"
volumes:
- .:/app
env_file:

View file

@ -85,8 +85,6 @@ class BlockInvalidHostMiddleware:
allowed_hosts += getenv("ALLOWED_HOSTS").split(" ")
if not hasattr(request, "META"):
return BadRequest("Invalid Request")
if DEBUG:
logger.debug(f"Checking {request.META.get("HTTP_HOST")} for presence in ALLOWED_HOSTS({allowed_hosts})")
if request.META.get("HTTP_HOST") not in allowed_hosts and "*" not in allowed_hosts:
return HttpResponseForbidden("Invalid Host Header")
return self.get_response(request)

View file

@ -2,7 +2,7 @@ import logging
from os import getenv
from pathlib import Path
EVIBES_VERSION = "2.7.1"
EVIBES_VERSION = "2.8.0"
BASE_DIR = Path(__file__).resolve().parent.parent.parent

View file

@ -3,22 +3,26 @@ global:
evaluation_interval: 15s
scrape_configs:
- job_name: 'evibes-app'
- job_name: 'app'
metrics_path: /prometheus/metrics
scheme: http
static_configs:
- targets: [ 'app:8000' ]
- job_name: 'evibes-worker'
- job_name: 'worker'
metrics_path: /prometheus/metrics
scheme: http
static_configs:
- targets: [ 'worker:8888' ]
# - job_name: 'redis'
# static_configs:
# - targets: ['redis:9121']
#
# - job_name: 'elasticsearch'
# static_configs:
# - targets: ['elasticsearch:9114']
- job_name: 'database'
static_configs:
- targets: [ 'database_exporter:9187' ]
- job_name: 'redis'
static_configs:
- targets: [ 'redis_exporter:9121' ]
- job_name: 'elasticsearch'
static_configs:
- targets: [ 'elasticsearch_exporter:9114' ]

View file

@ -1,6 +1,6 @@
[tool.poetry]
name = "eVibes"
version = "2.7.1"
version = "2.8.0"
description = "eVibes is an open-source eCommerce backend service built with Django. Its designed for flexibility, making it ideal for various use cases and learning Django skills. The project is easy to customize, allowing for straightforward editing and extension."
authors = ["fureunoir <contact@fureunoir.com>"]
readme = "README.md"