- Create systemd service and timer files for 8am and 12pm runs - Add automated installation script - Include deployment documentation with troubleshooting - Configure for production with proper paths and environment Ready for production deployment with: sudo ./deploy/install.sh 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
3 KiB
3 KiB
Deployment Instructions
Prerequisites
Ensure the following are completed:
- Python environment is set up with
uv - All dependencies installed:
uv pip install -r requirements.txt .envfile configured with API credentials- Test run successful:
uv run python run_api_production_v2.py
Deploy to Production
Option 1: Automated Installation (Recommended)
cd /home/ben/dev/hvac-kia-content/deploy
sudo ./install.sh
This will:
- Copy systemd service files to
/etc/systemd/system/ - Enable and start the timers
- Show service status
Option 2: Manual Installation
# Copy service files
sudo cp deploy/*.service /etc/systemd/system/
sudo cp deploy/*.timer /etc/systemd/system/
# Reload systemd
sudo systemctl daemon-reload
# Enable timers (start on boot)
sudo systemctl enable hvac-content-8am.timer
sudo systemctl enable hvac-content-12pm.timer
# Start timers immediately
sudo systemctl start hvac-content-8am.timer
sudo systemctl start hvac-content-12pm.timer
Verify Deployment
Check timer status:
systemctl list-timers | grep hvac
Expected output:
NEXT LEFT LAST PASSED UNIT ACTIVATES
Mon 2025-08-20 08:00:00 ADT 21h left n/a n/a hvac-content-8am.timer hvac-content-8am.service
Mon 2025-08-19 12:00:00 ADT 1h 9min left n/a n/a hvac-content-12pm.timer hvac-content-12pm.service
Monitor Services
View logs in real-time:
# Morning run logs
journalctl -u hvac-content-8am -f
# Noon run logs
journalctl -u hvac-content-12pm -f
# All logs
journalctl -u hvac-content-* -f
Manual Testing
Run the service manually:
# Test morning run
sudo systemctl start hvac-content-8am.service
# Check status
sudo systemctl status hvac-content-8am.service
Stop/Disable Services
If needed:
# Stop timers
sudo systemctl stop hvac-content-8am.timer
sudo systemctl stop hvac-content-12pm.timer
# Disable from starting on boot
sudo systemctl disable hvac-content-8am.timer
sudo systemctl disable hvac-content-12pm.timer
Troubleshooting
Service Fails to Start
- Check logs:
journalctl -u hvac-content-8am -n 50 - Verify paths in service files
- Check Python environment:
source .venv/bin/activate && python --version - Test manual run:
cd /home/ben/dev/hvac-kia-content && uv run python run_api_production_v2.py
Permission Issues
- Ensure user
benhas read/write access to data directories - Check NAS mount permissions:
ls -la /mnt/nas/hvacknowitall/
Timer Not Triggering
- Check timer status:
systemctl status hvac-content-8am.timer - Verify system time:
timedatectl - Check timer schedule:
systemctl cat hvac-content-8am.timer
Schedule
The system runs automatically at:
- 8:00 AM ADT - Morning content aggregation
- 12:00 PM ADT - Noon content aggregation
Both runs will:
- Fetch new content from all sources
- Merge with existing cumulative files
- Update metrics and add captions where available
- Archive previous versions
- Sync to NAS at
/mnt/nas/hvacknowitall/