Add detailed VM runner setup guide with Gitea integration steps
CI - Lint & Test / lint-and-test (push) Successful in 41s Details

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Cloud User 2026-03-11 13:18:22 +09:00
parent 5e54e2f24b
commit 55849432ca
1 changed files with 79 additions and 7 deletions

View File

@ -81,14 +81,86 @@ git push -u origin main
## 2. Gitea Runner (설치 완료 — VM 방식)
전용 VM(`soo-runner`)에 act_runner를 직접 설치하여 systemd 서비스로 운영.
기존 K8s 파드(DinD sidecar) 방식에서 VM 직접 설치로 전환.
- **호스트**: `ssh ubuntu@runner` (호스트명: `soo-runner`)
- **Runner 이름**: `soo-runner`
- **바이너리**: `/usr/local/bin/act_runner`
- **작업 디렉토리**: `/opt/act_runner/`
- **서비스**: `/etc/systemd/system/act_runner.service` (enabled, auto-restart)
- **Labels**: `ubuntu-latest`, `ubuntu-22.04` (Docker), `self-hosted` (Host)
- **Gitea instance**: `https://gitea.inje-private.com`
| 항목 | 값 |
|------|-----|
| 호스트 | `ssh ubuntu@runner` (호스트명: `soo-runner`) |
| OS | Ubuntu 22.04.5 LTS |
| IP | `10.0.0.67` |
| Runner 이름 | `soo-runner` |
| act_runner | v0.3.0 (`/usr/local/bin/act_runner`) |
| Docker | v29.3.0 |
| 작업 디렉토리 | `/opt/act_runner/` |
| 서비스 | `/etc/systemd/system/act_runner.service` |
| Labels | `ubuntu-latest`, `ubuntu-22.04` (Docker), `self-hosted` (Host) |
### 2-1. VM 설치 과정
```bash
# 1. Docker 설치
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update && sudo apt-get install -y docker-ce docker-ce-cli containerd.io
sudo usermod -aG docker ubuntu
# 2. act_runner 바이너리 설치
curl -sL https://gitea.com/gitea/act_runner/releases/download/v0.3.0/act_runner-0.3.0-linux-amd64 -o act_runner
chmod +x act_runner
sudo mv act_runner /usr/local/bin/
# 3. 작업 디렉토리 생성
sudo mkdir -p /opt/act_runner
sudo chown ubuntu:ubuntu /opt/act_runner
```
### 2-2. Gitea 연동 (Runner 등록)
```bash
# 1. Gitea에서 Runner 등록 토큰 발급
# Gitea > 저장소 Settings > Actions > Runners > "Create new Runner" 에서 토큰 복사
# 또는 사이트 전역: Site Administration > Actions > Runners
# 2. Runner 등록
cd /opt/act_runner
act_runner register --no-interactive \
--instance https://gitea.inje-private.com \
--token <REGISTRATION_TOKEN> \
--name soo-runner \
--labels "ubuntu-latest:docker://catthehacker/ubuntu:act-22.04,ubuntu-22.04:docker://catthehacker/ubuntu:act-22.04,self-hosted:host"
# → /opt/act_runner/.runner 파일 생성됨
```
### 2-3. systemd 서비스 등록
```bash
# 서비스 파일 생성
sudo tee /etc/systemd/system/act_runner.service > /dev/null <<'EOF'
[Unit]
Description=Gitea Act Runner
After=docker.service
Requires=docker.service
[Service]
User=ubuntu
WorkingDirectory=/opt/act_runner
ExecStart=/usr/local/bin/act_runner daemon
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
# 서비스 시작 및 자동 시작 등록
sudo systemctl daemon-reload
sudo systemctl enable --now act_runner
```
### 2-4. 운영 명령어
```bash
# 상태 확인