feat(deploy): despliegue nativo Debian sin Docker
- Elimina todos los Dockerfiles y docker-compose.yml
- Elimina scripts Docker (start_docker, reset_and_deploy, deploy-clean)
- Agrega deploy/debian/ con despliegue nativo via systemd:
- install.sh: instalacion completa en Debian (PostgreSQL, Redis,
Qdrant binario, Go, Python venv, nginx, frontend compilado)
- build.sh: recompila binarios Go y frontend sin reinstalar
- env.example: variables de entorno sin referencias Docker
- nginx.conf: sirve React estatico + proxy al API Go en localhost
- systemd/*.service: 16 servicios (8 Go + 7 Python + Qdrant)
Todos los hostnames Docker (db, redis, qdrant) reemplazados por 127.0.0.1
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ee90335b92
commit
10d51c3c52
39 changed files with 975 additions and 1319 deletions
24
deploy/debian/systemd/rss2-backend.service
Normal file
24
deploy/debian/systemd/rss2-backend.service
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
[Unit]
|
||||
Description=RSS2 Backend API (Go)
|
||||
After=network.target postgresql.service redis.service
|
||||
Requires=postgresql.service redis.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=rss2
|
||||
Group=rss2
|
||||
WorkingDirectory=/opt/rss2
|
||||
EnvironmentFile=/opt/rss2/.env
|
||||
ExecStart=/opt/rss2/bin/server
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=rss2-backend
|
||||
|
||||
# Limites de recursos
|
||||
LimitNOFILE=65536
|
||||
MemoryMax=1G
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
25
deploy/debian/systemd/rss2-categorizer.service
Normal file
25
deploy/debian/systemd/rss2-categorizer.service
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
[Unit]
|
||||
Description=RSS2 Categorizer Worker (Python)
|
||||
After=network.target postgresql.service
|
||||
Requires=postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=rss2
|
||||
Group=rss2
|
||||
WorkingDirectory=/opt/rss2/src
|
||||
EnvironmentFile=/opt/rss2/.env
|
||||
Environment=CATEGORIZER_BATCH_SIZE=10
|
||||
Environment=CATEGORIZER_SLEEP_IDLE=5
|
||||
ExecStart=/opt/rss2/venv/bin/python -m workers.simple_categorizer_worker
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=rss2-categorizer
|
||||
|
||||
MemoryMax=1G
|
||||
CPUQuota=200%
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
25
deploy/debian/systemd/rss2-cluster.service
Normal file
25
deploy/debian/systemd/rss2-cluster.service
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
[Unit]
|
||||
Description=RSS2 Cluster Worker - Agrupacion de noticias (Python)
|
||||
After=network.target postgresql.service
|
||||
Requires=postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=rss2
|
||||
Group=rss2
|
||||
WorkingDirectory=/opt/rss2/src
|
||||
EnvironmentFile=/opt/rss2/.env
|
||||
Environment=EVENT_DIST_THRESHOLD=0.35
|
||||
Environment=EMB_MODEL=sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
|
||||
ExecStart=/opt/rss2/venv/bin/python -m workers.cluster_worker
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=rss2-cluster
|
||||
|
||||
MemoryMax=2G
|
||||
CPUQuota=200%
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
26
deploy/debian/systemd/rss2-discovery.service
Normal file
26
deploy/debian/systemd/rss2-discovery.service
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
[Unit]
|
||||
Description=RSS2 Discovery de Feeds (Go)
|
||||
After=network.target postgresql.service
|
||||
Requires=postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=rss2
|
||||
Group=rss2
|
||||
WorkingDirectory=/opt/rss2
|
||||
EnvironmentFile=/opt/rss2/.env
|
||||
Environment=DISCOVERY_INTERVAL=900
|
||||
Environment=DISCOVERY_BATCH=10
|
||||
Environment=MAX_FEEDS_PER_URL=5
|
||||
ExecStart=/opt/rss2/bin/discovery
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=rss2-discovery
|
||||
|
||||
MemoryMax=512M
|
||||
CPUQuota=100%
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
30
deploy/debian/systemd/rss2-embeddings.service
Normal file
30
deploy/debian/systemd/rss2-embeddings.service
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
[Unit]
|
||||
Description=RSS2 Embeddings Worker (Python)
|
||||
After=network.target postgresql.service
|
||||
Requires=postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=rss2
|
||||
Group=rss2
|
||||
WorkingDirectory=/opt/rss2/src
|
||||
EnvironmentFile=/opt/rss2/.env
|
||||
Environment=EMB_MODEL=sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
|
||||
Environment=EMB_BATCH=64
|
||||
Environment=EMB_SLEEP_IDLE=5
|
||||
Environment=EMB_LANGS=es
|
||||
Environment=EMB_LIMIT=1000
|
||||
Environment=DEVICE=cpu
|
||||
Environment=HF_HOME=/opt/rss2/hf_cache
|
||||
ExecStart=/opt/rss2/venv/bin/python -m workers.embeddings_worker
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=rss2-embeddings
|
||||
|
||||
MemoryMax=3G
|
||||
CPUQuota=200%
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
26
deploy/debian/systemd/rss2-ingestor.service
Normal file
26
deploy/debian/systemd/rss2-ingestor.service
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
[Unit]
|
||||
Description=RSS2 Ingestor RSS (Go)
|
||||
After=network.target postgresql.service
|
||||
Requires=postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=rss2
|
||||
Group=rss2
|
||||
WorkingDirectory=/opt/rss2
|
||||
EnvironmentFile=/opt/rss2/.env
|
||||
Environment=RSS_MAX_WORKERS=100
|
||||
Environment=RSS_POKE_INTERVAL_MIN=15
|
||||
ExecStart=/opt/rss2/bin/ingestor
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=rss2-ingestor
|
||||
|
||||
LimitNOFILE=65536
|
||||
MemoryMax=2G
|
||||
CPUQuota=200%
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
25
deploy/debian/systemd/rss2-langdetect.service
Normal file
25
deploy/debian/systemd/rss2-langdetect.service
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
[Unit]
|
||||
Description=RSS2 Language Detection Worker (Python)
|
||||
After=network.target postgresql.service
|
||||
Requires=postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=rss2
|
||||
Group=rss2
|
||||
WorkingDirectory=/opt/rss2/src
|
||||
EnvironmentFile=/opt/rss2/.env
|
||||
Environment=LANG_DETECT_SLEEP=60
|
||||
Environment=LANG_DETECT_BATCH=1000
|
||||
ExecStart=/opt/rss2/venv/bin/python -m workers.langdetect_worker
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=rss2-langdetect
|
||||
|
||||
MemoryMax=512M
|
||||
CPUQuota=50%
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
26
deploy/debian/systemd/rss2-ner.service
Normal file
26
deploy/debian/systemd/rss2-ner.service
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
[Unit]
|
||||
Description=RSS2 NER Worker - Extraccion de Entidades (Python)
|
||||
After=network.target postgresql.service
|
||||
Requires=postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=rss2
|
||||
Group=rss2
|
||||
WorkingDirectory=/opt/rss2/src
|
||||
EnvironmentFile=/opt/rss2/.env
|
||||
Environment=NER_LANG=es
|
||||
Environment=NER_BATCH=64
|
||||
Environment=HF_HOME=/opt/rss2/hf_cache
|
||||
ExecStart=/opt/rss2/venv/bin/python -m workers.ner_worker
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=rss2-ner
|
||||
|
||||
MemoryMax=2G
|
||||
CPUQuota=200%
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
28
deploy/debian/systemd/rss2-qdrant-worker.service
Normal file
28
deploy/debian/systemd/rss2-qdrant-worker.service
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
[Unit]
|
||||
Description=RSS2 Qdrant Sync Worker (Go)
|
||||
After=network.target postgresql.service rss2-qdrant.service
|
||||
Requires=postgresql.service rss2-qdrant.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=rss2
|
||||
Group=rss2
|
||||
WorkingDirectory=/opt/rss2
|
||||
EnvironmentFile=/opt/rss2/.env
|
||||
Environment=QDRANT_HOST=127.0.0.1
|
||||
Environment=QDRANT_PORT=6333
|
||||
Environment=QDRANT_COLLECTION=news_vectors
|
||||
Environment=QDRANT_SLEEP=30
|
||||
Environment=QDRANT_BATCH=100
|
||||
ExecStart=/opt/rss2/bin/qdrant_worker
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=rss2-qdrant-worker
|
||||
|
||||
MemoryMax=1G
|
||||
CPUQuota=100%
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
25
deploy/debian/systemd/rss2-qdrant.service
Normal file
25
deploy/debian/systemd/rss2-qdrant.service
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
[Unit]
|
||||
Description=Qdrant Vector Database
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=rss2
|
||||
Group=rss2
|
||||
WorkingDirectory=/opt/rss2/qdrant
|
||||
ExecStart=/opt/rss2/qdrant/qdrant
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=rss2-qdrant
|
||||
|
||||
Environment=QDRANT__SERVICE__HTTP_PORT=6333
|
||||
Environment=QDRANT__SERVICE__GRPC_PORT=6334
|
||||
Environment=QDRANT__STORAGE__STORAGE_PATH=/opt/rss2/data/qdrant_storage
|
||||
|
||||
MemoryMax=4G
|
||||
CPUQuota=400%
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
26
deploy/debian/systemd/rss2-related.service
Normal file
26
deploy/debian/systemd/rss2-related.service
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
[Unit]
|
||||
Description=RSS2 Related News Worker (Go)
|
||||
After=network.target postgresql.service
|
||||
Requires=postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=rss2
|
||||
Group=rss2
|
||||
WorkingDirectory=/opt/rss2
|
||||
EnvironmentFile=/opt/rss2/.env
|
||||
Environment=RELATED_SLEEP=10
|
||||
Environment=RELATED_BATCH=200
|
||||
Environment=RELATED_TOPK=10
|
||||
ExecStart=/opt/rss2/bin/related
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=rss2-related
|
||||
|
||||
MemoryMax=1G
|
||||
CPUQuota=100%
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
25
deploy/debian/systemd/rss2-scraper.service
Normal file
25
deploy/debian/systemd/rss2-scraper.service
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
[Unit]
|
||||
Description=RSS2 Scraper HTML (Go)
|
||||
After=network.target postgresql.service
|
||||
Requires=postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=rss2
|
||||
Group=rss2
|
||||
WorkingDirectory=/opt/rss2
|
||||
EnvironmentFile=/opt/rss2/.env
|
||||
Environment=SCRAPER_SLEEP=60
|
||||
Environment=SCRAPER_BATCH=10
|
||||
ExecStart=/opt/rss2/bin/scraper
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=rss2-scraper
|
||||
|
||||
MemoryMax=512M
|
||||
CPUQuota=100%
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
25
deploy/debian/systemd/rss2-topics.service
Normal file
25
deploy/debian/systemd/rss2-topics.service
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
[Unit]
|
||||
Description=RSS2 Topics Worker (Go)
|
||||
After=network.target postgresql.service
|
||||
Requires=postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=rss2
|
||||
Group=rss2
|
||||
WorkingDirectory=/opt/rss2
|
||||
EnvironmentFile=/opt/rss2/.env
|
||||
Environment=TOPICS_SLEEP=10
|
||||
Environment=TOPICS_BATCH=500
|
||||
ExecStart=/opt/rss2/bin/topics
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=rss2-topics
|
||||
|
||||
MemoryMax=512M
|
||||
CPUQuota=100%
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
26
deploy/debian/systemd/rss2-translation-scheduler.service
Normal file
26
deploy/debian/systemd/rss2-translation-scheduler.service
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
[Unit]
|
||||
Description=RSS2 Translation Scheduler (Python)
|
||||
After=network.target postgresql.service
|
||||
Requires=postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=rss2
|
||||
Group=rss2
|
||||
WorkingDirectory=/opt/rss2/src
|
||||
EnvironmentFile=/opt/rss2/.env
|
||||
Environment=TARGET_LANGS=es
|
||||
Environment=SCHEDULER_BATCH=1000
|
||||
Environment=SCHEDULER_SLEEP=30
|
||||
ExecStart=/opt/rss2/venv/bin/python -m workers.translation_scheduler
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=rss2-translation-scheduler
|
||||
|
||||
MemoryMax=256M
|
||||
CPUQuota=50%
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
31
deploy/debian/systemd/rss2-translator.service
Normal file
31
deploy/debian/systemd/rss2-translator.service
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
[Unit]
|
||||
Description=RSS2 Translator Worker NLLB-200 (Python)
|
||||
After=network.target postgresql.service rss2-translation-scheduler.service
|
||||
Requires=postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=rss2
|
||||
Group=rss2
|
||||
WorkingDirectory=/opt/rss2/src
|
||||
EnvironmentFile=/opt/rss2/.env
|
||||
Environment=TARGET_LANGS=es
|
||||
Environment=TRANSLATOR_BATCH=32
|
||||
Environment=CT2_MODEL_PATH=/opt/rss2/models/nllb-ct2
|
||||
Environment=CT2_DEVICE=cpu
|
||||
Environment=CT2_COMPUTE_TYPE=int8
|
||||
Environment=UNIVERSAL_MODEL=facebook/nllb-200-distilled-600M
|
||||
Environment=HF_HOME=/opt/rss2/hf_cache
|
||||
ExecStart=/opt/rss2/venv/bin/python -m workers.ctranslator_worker
|
||||
Restart=always
|
||||
RestartSec=15
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=rss2-translator
|
||||
|
||||
# El modelo NLLB-200 consume bastante RAM en CPU
|
||||
MemoryMax=4G
|
||||
CPUQuota=200%
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
24
deploy/debian/systemd/rss2-wiki.service
Normal file
24
deploy/debian/systemd/rss2-wiki.service
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
[Unit]
|
||||
Description=RSS2 Wiki Worker - imagenes Wikipedia (Go)
|
||||
After=network.target postgresql.service
|
||||
Requires=postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=rss2
|
||||
Group=rss2
|
||||
WorkingDirectory=/opt/rss2
|
||||
EnvironmentFile=/opt/rss2/.env
|
||||
Environment=WIKI_SLEEP=10
|
||||
ExecStart=/opt/rss2/bin/wiki_worker
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=rss2-wiki
|
||||
|
||||
MemoryMax=256M
|
||||
CPUQuota=50%
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Loading…
Add table
Add a link
Reference in a new issue