Goal: Stand up a free-tier cloud Linux server, wrap a long-running Python process in a systemd unit file so it survives crashes and reboots, cap its resource usage with systemd/cgroups, and monitor GPU (or simulated GPU) state throughout — using only free and local tools. Steps:
lsb_release -a to confirm your Ubuntu version, df -h to check available disk space, and free -h to check available memory and swap. Record the output.nvidia-smi to confirm it reports GPU state. If your free-tier instance has no GPU (most Always Free tiers do not), install gpustat (pip install gpustat) anyway and simulate this step by documenting what output you would expect to see, referencing the CUDA Installation Guide for context on driver/CUDA version pairing./opt/inference/server.py) that runs an infinite loop — e.g., sleeping and printing a heartbeat log line every few seconds — to stand in for a real inference server process./etc/systemd/system/inference.service with [Unit], [Service], and [Install] sections. Set ExecStart= to the full absolute path of your Python interpreter and script (do not rely on PATH). Set Restart=on-failure. Do not mark the unit file executable — leave its permissions as standard config (typically 644).CPUQuota= and MemoryMax= directives under [Service] to simulate capping a model-serving process to a fraction of the VM's CPU and memory (e.g., CPUQuota=50%, MemoryMax=512M).sudo systemctl daemon-reload, then sudo systemctl enable --now inference.service. Confirm it's running with systemctl status inference.service. Kill the process manually (sudo pkill -f server.py) and confirm systemd restarts it automatically.systemctl status, journalctl -u inference.service, and (if available) nvidia-smi / gpustat to observe the service's state over a few minutes. Take screenshots of each.swapon --show; if none exists, create a 1–2GB swapfile and enable it, documenting the commands used.Deliverables: Submit your inference.service unit file, terminal/screenshot evidence of the service running and auto-restarting, your swap configuration notes, and your written reflection (upload as a PDF or text file, or paste directly into the submission text box).