Skip to content

Environment Reference ​

This page documents file locations, log files, and system paths for LXC AutoScale ML.

Installation Paths ​

Application Files ​

PathDescription
/usr/local/bin/lxc_autoscale_ml/Application code
/usr/local/bin/lxc_autoscale_api/API component
/usr/local/bin/lxc_autoscale_ml/Model component
/usr/local/bin/Monitor component

Configuration Files ​

PathComponent
/etc/lxc_autoscale_ml/lxc_autoscale_api.yamlAPI
/etc/lxc_autoscale_ml/lxc_autoscale_ml.yamlModel
/etc/lxc_autoscale_ml/lxc_monitor.yamlMonitor

Systemd Service Files ​

PathService
/lib/systemd/system/lxc_autoscale_api.serviceAPI
/lib/systemd/system/lxc_autoscale_ml.serviceModel
/lib/systemd/system/lxc_monitor.serviceMonitor

Log Files ​

Application Logs ​

PathContent
/var/log/lxc_autoscale_ml.logModel service main log
/var/log/lxc_autoscale_api.logAPI main log
/var/log/lxc_autoscale_api_access.logAPI access log
/var/log/lxc_autoscale_api_error.logAPI error log
/var/log/lxc_monitor.logMonitor service log

Data Files ​

PathContent
/var/log/lxc_metrics.jsonCollected container metrics

Lock Files ​

PathPurpose
/run/lxc_autoscale_ml.lockModel service instance lock

Service Names ​

ServiceDescription
lxc_autoscale_apiRESTful API service
lxc_autoscale_mlML model service
lxc_monitorMetrics collection service

Network ​

Ports ​

PortServiceProtocol
5000APIHTTP

Default Bind Address ​

The API binds to 0.0.0.0 by default (all interfaces).

Permissions ​

File Ownership ​

All files should be owned by root:root:

bash
chown -R root:root /usr/local/bin/lxc_autoscale_ml
chown -R root:root /etc/lxc_autoscale_ml

File Permissions ​

PathPermissionsNotes
Configuration files600Contains API key
Application files755Executable
Log directory755-
Log files644-
Lock file644Created at runtime

Secure Configuration ​

bash
chmod 600 /etc/lxc_autoscale_ml/lxc_autoscale_api.yaml
chmod 644 /etc/lxc_autoscale_ml/lxc_autoscale_ml.yaml
chmod 644 /etc/lxc_autoscale_ml/lxc_monitor.yaml

Dependencies ​

Required System Packages ​

python3
python3-flask
python3-requests
python3-sklearn
python3-pandas
python3-numpy
python3-aiofiles
python3-yaml
python3-psutil
python3-aiohttp

Optional System Packages ​

python3-prometheus-client  # For Prometheus metrics

Python Module Paths ​

The application uses system Python packages installed via apt.

Proxmox Integration ​

Commands Used ​

CommandPurpose
pctLXC container management
pveshProxmox API shell
pct listList containers
pct configGet container configuration
pct setSet container options

Container Paths ​

Path (inside container)Collected Metrics
/proc/statCPU usage
/proc/meminfoMemory usage
/proc/diskstatsDisk I/O
/proc/net/devNetwork I/O

Log Rotation ​

Create /etc/logrotate.d/lxc-autoscale-api:

/var/log/lxc_autoscale_ml.log
/var/log/lxc_autoscale_api_*.log
/var/log/lxc_monitor.log {
    daily
    missingok
    rotate 7
    compress
    delaycompress
    notifempty
    create 640 root adm
    sharedscripts
    postrotate
        systemctl reload lxc_autoscale_api > /dev/null 2>&1 || true
        systemctl reload lxc_autoscale_ml > /dev/null 2>&1 || true
        systemctl reload lxc_monitor > /dev/null 2>&1 || true
    endscript
}

Backup Locations ​

Files to Backup ​

bash
# Configuration
/etc/lxc_autoscale_ml/

# Metrics history (optional)
/var/log/lxc_metrics.json

Backup Script ​

bash
#!/bin/bash
BACKUP_DIR="/backup/lxc_autoscale"
DATE=$(date +%Y%m%d)

mkdir -p "$BACKUP_DIR"
tar czf "$BACKUP_DIR/config_$DATE.tar.gz" /etc/lxc_autoscale_ml/
cp /var/log/lxc_metrics.json "$BACKUP_DIR/metrics_$DATE.json"

Troubleshooting Paths ​

Check Service Status ​

bash
systemctl status lxc_autoscale_api
systemctl status lxc_autoscale_ml
systemctl status lxc_monitor

Check Logs ​

bash
journalctl -u lxc_autoscale_api -n 50
journalctl -u lxc_autoscale_ml -n 50
journalctl -u lxc_monitor -n 50

Verify Files Exist ​

bash
ls -la /etc/lxc_autoscale_ml/
ls -la /var/log/lxc_*.json
ls -la /var/log/lxc_*.log
ls -la /var/log/lxc_autoscale_api_*.log

Released under the MIT License. · Privacy & legal