Wake-on-LAN and boot-time initialization for FARM/LAB servers.
This repository is responsible for turning servers on and running one-time boot checks. Periodic monitoring/exporter code is intentionally not kept here.
The only systemd unit managed by this repo is remote-boot.service. Cluster monitoring exporters and Prometheus alerting live with the Kubernetes monitoring assets, not in this repository.
script/common.sh: shared Ansible, logging, alert, and server-id helpersscript/wake_targets.sh: send WOL magic packets for selected targetsscript/run_remote_boot.sh: systemd boot entrypointscript/install_remote_boot_service.sh: install and enableremote-boot.servicescript/check_server_boot_health.sh: one-time boot health check for host mount/GPU and a temporary GPU test containerscript/wait_for_priority_servers.sh: wait for priority servers before waking the restscript/restart_all_remote_containers.sh: one-time post-boot container start and SSH/GPU post-checkscript/create_test_container.sh,script/delete_test_container.sh: temporary GPU test-container helpersscript/dry_run_remote_boot.sh: dry-run wrapper for wake, health, container, and full-flow simulationsscript/integration_smoke_test.sh: manual Ansible/Docker/GPU smoke testscript/test_slack_notification.sh: send a Slack test message using local configscript/reset_remote_boot_alert_state.sh: clear stored alert suppression stateconfig/remote_boot.example.env: example boot-time configconfig/remote_boot.local.env: ignored local config with real MACs and secrets
cp config/remote_boot.example.env config/remote_boot.local.envEdit config/remote_boot.local.env, then install the boot service:
./script/install_remote_boot_service.shRun once manually:
sudo systemctl start remote-boot.serviceCheck service logs:
systemctl status remote-boot.service
journalctl -u remote-boot.service -b
tail -f /var/log/remote-boot.logREMOTE_BOOT_PRIORITY_TARGETSare woken first.- If
REMOTE_BOOT_ENABLE_GATE=true, priority servers must pass one-time boot health checks before the remaining targets are woken. - If
REMOTE_BOOT_ENABLE_REMAINING_HEALTH_CHECK=true, remaining targets also run one-time boot health checks after wake-up. - If
REMOTE_BOOT_ENABLE_CONTAINER_RESTART=true, selected servers start stopped target containers and run one-time per-container SSH/GPU post-checks. - Unrecovered boot-time failures are sent to Slack when configured, otherwise they are written to the alert stub log.
List targets:
./script/wake_targets.sh --list-targetsWake targets:
./script/wake_targets.sh all
./script/wake_targets.sh FARM1 LAB1Run one-time boot health checks:
./script/check_server_boot_health.sh --server-id FARM1Run one-time post-boot container start/post-check:
./script/restart_all_remote_containers.sh FARM1Run a smoke test:
./script/integration_smoke_test.sh --scope priority./script/dry_run_remote_boot.sh wake FARM1 LAB1
./script/dry_run_remote_boot.sh health FARM1
./script/dry_run_remote_boot.sh containers FARM1
./script/dry_run_remote_boot.sh --scope priority full
./script/dry_run_remote_boot.sh fullDry runs do not send WOL packets, sleep, create containers, restart Docker, or restart containers. Container dry runs still read remote container inventory so the plan reflects current state.
Commonly changed values in config/remote_boot.local.env:
REMOTE_BOOT_TARGETS: default boot targetsREMOTE_BOOT_FARM_TARGETS,REMOTE_BOOT_LAB_TARGETS: known server groupsREMOTE_BOOT_PRIORITY_TARGETS: first servers to wake and verifyREMOTE_BOOT_ENABLE_GATE: whether remaining servers wait for priority health checksREMOTE_BOOT_ENABLE_REMAINING_HEALTH_CHECK: whether non-priority servers run boot-time health checksREMOTE_BOOT_ENABLE_CONTAINER_RESTART: whether stopped containers are started and post-checked after bootREMOTE_BOOT_TEST_*: temporary health-check container settingsREMOTE_BOOT_FARM_REQUIRED_MOUNT,REMOTE_BOOT_LAB_REQUIRED_MOUNT,REMOTE_BOOT_HOST_SHARE_MOUNT_TEMPLATE: boot-time mount requirementsREMOTE_BOOT_MAC_<TARGET>: WOL MAC addressesREMOTE_BOOT_SLACK_*: Slack alert routingREMOTE_BOOT_ALERT_STATE_DIR: alert suppression state directory
Set Slack webhook values in config/remote_boot.local.env, then run:
./script/test_slack_notification.sh
./script/test_slack_notification.sh --server-id FARM1
./script/test_slack_notification.sh --server-id LAB1wakeonlanmust be installed on the management desktop.- Remote scripts use Ansible; set
REMOTE_BOOT_ANSIBLE_INVENTORYor rely on the default Ansible inventory. LAB*targets use192.168.1.255, andFARM*targets use192.168.2.255by default.- Boot health checks create and delete a temporary GPU test container without writing to the DB.
- Post-boot container handling starts only stopped containers. GPU checks run only for images matching
REMOTE_BOOT_CONTAINER_TARGET_IMAGE_REGEX. - Automatic remote recovery commands use
sudo -n; passwordless sudo is required on target hosts for those recovery actions. - If the network is not ready at boot, increase
REMOTE_BOOT_PRE_DELAY_SECONDS. - Local binaries under
bin/are ignored build artifacts. Do not commit exporter binaries here.