#!/bin/bash # win-ci VM + 호스트 제어 서버를 systemd 트랜지언트 유닛으로 띄운다. # # 반드시 봇(ejclaw.service) cgroup 밖에서 돌아야 한다. 안에서 돌면 8GB VM 이 # MemoryHigh=16G 를 쳐서 봇이 OOM 으로 죽는다. --user 유닛으로 띄우면 # systemd --user 의 자식이 되어 app.slice 형제로 빠지고, 에이전트 턴이 # 끝나도 계속 살아 있는다. # # CPUQuota=400% / CPUWeight=50 - 물리 호스트가 i7-11700(16스레드)뿐이고 .5 에서 # 운영 컨테이너 19개가 돈다. 4코어를 넘기면 .5 응답이 +140% 느려진다(실측). set -euo pipefail systemctl --user reset-failed win-ci.service win-ci-http.service 2>/dev/null || true # 게스트 <-> 호스트 제어 채널 (게스트는 10.0.2.2:8099 로 본다) if ! systemctl --user is-active --quiet win-ci-http.service; then systemd-run --user --unit=win-ci-http \ --description="win-ci guest control channel" \ -p Restart=always \ /usr/bin/python3 /home/claude/win-ci/serve-host.py fi # VM systemd-run --user --unit=win-ci \ --description="win-ci Windows CI VM (nested KVM)" \ -p MemoryMax=10G \ -p CPUQuota=400% \ -p CPUWeight=50 \ -p WorkingDirectory=/home/claude/win-ci \ /bin/bash /home/claude/win-ci/run-vm.sh sleep 2 systemctl --user --no-pager status win-ci-http.service win-ci.service | head -40