Runtime & Deployment
Production Execution Model
Logidav runs on a dedicated server with the following stack:
| Component | Version / Details |
|---|---|
| PHP | 7.3 (CLI for commands, FPM for web) |
| Database | MySQL / MariaDB |
| Message broker | RabbitMQ |
| Scheduler | System crontab (164 entries) |
| Web server | Apache / Nginx with PHP-FPM |
The system executes work through two parallel mechanisms:
- Cronjobs -- 164 scheduled commands that poll external systems and trigger processing
- Queue processor -- a continuous process that consumes and executes queued tasks
Process Management
Cronjob Execution with run_job.sh
All production cronjobs are wrapped in the run_job.sh shell script, which provides structured logging and monitoring:
# Crontab entry example
*/10 * * * * /path/to/run_job.sh menzzo:v2:sales
*/30 * * * * /path/to/run_job.sh menzzo:v2:sales:update
0 */2 * * * /path/to/run_job.sh menzzo:v2:products
The run_job.sh wrapper provides:
| Feature | Description |
|---|---|
| JSON logging | Structured output with fields for parsing by log aggregators |
| UUID per run | Each execution gets a unique identifier for tracing |
| Status tracking | Start/end timestamps, exit code, duration |
| Error capture | Stderr captured and included in the log entry |
The structured logging from run_job.sh makes it straightforward to search for failed runs, measure execution times, and trace issues across the 164 cronjobs. See Cron Incident Triage for debugging procedures.
Concurrency Prevention
Critical commands use LockableTrait to prevent overlapping execution. If a cron triggers while a previous instance is still running, the new instance exits immediately without processing.
Error Handling
- Errors are logged to dedicated log files per command
- Deadlocks and
EntityManagerclosed errors are caught and downgraded to warnings (the next cron cycle will retry) - Critical failures trigger
SystemAlertServicenotifications for operator visibility
Queue Processor
The queue processor must run continuously in production:
php bin/console meduse:queue:processor --action=runQueues
It is managed through one of:
- Supervisor -- recommended for automatic restart on failure
- Cron at high frequency -- alternative approach, relies on
LockableTraitto prevent overlap
The processor polls the Queue table for pending tasks and executes them sequentially, grouped by run_category. See Queue Model for the full lifecycle.
If the queue processor stops, async tasks (Meduse sync, marketplace updates, notification dispatch) will accumulate in the database but not execute. Monitor the process and set up alerting for restarts. See Queue Debugging for troubleshooting.
Deployment
Deployment Steps
Logidav follows a standard Symfony deployment process:
# 1. Install dependencies (no dev packages in production)
composer install --no-dev --optimize-autoloader
# 2. Apply database schema changes (no migration system)
php bin/console doctrine:schema:update --dump-sql # Review first
php bin/console doctrine:schema:update --force # Apply
# 3. Clear and warm the production cache
php bin/console cache:clear --env=prod
php bin/console cache:warmup --env=prod
# 4. Install and dump web assets
php bin/console assets:install --symlink
This project does not use Doctrine migrations. Schema changes are applied directly with doctrine:schema:update --force. Always review the SQL output with --dump-sql before applying to production.
Pre-Deployment Checklist
Before deploying, run the following checks:
# Run the test suite
SYMFONY_DEPRECATIONS_HELPER=weak_vendors vendor/bin/simple-phpunit -c phpunit.xml.dist
# Run static analysis
composer phpstan
# Fix code style
php tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php
| Check | Command | What It Catches |
|---|---|---|
| Tests | simple-phpunit | Regressions, broken business logic |
| PHPStan | composer phpstan | Type errors, undefined methods, missing imports |
| CS Fixer | php-cs-fixer fix | PSR-2/PSR-12 formatting violations |
CI/CD Pipeline
The Jenkins pipeline automates the pre-deployment checks. It mirrors the local tooling:
- Installs dependencies with
composer install - Runs PHPStan analysis on the PHP 8.2 shared agent
- Executes the test suite
- Reports results back to the merge request
The pipeline operates in two modes:
- Fast mode -- runs on every push, covers linting and static analysis
- Full mode -- runs on merge requests, includes the full test suite
See Deployment Reference for CI configuration details.
Documentation Site
The Docusaurus documentation site is deployed on Cloudflare Pages:
| Setting | Value |
|---|---|
| Source directory | Global menzzo-docs repository root |
| Build command | npm run build |
| Output directory | build/ |
| URL | https://menzzo-docs.pages.dev |