c9876d70e4
CI/CD Pipeline / Check if frontend-only change (push) Has been skipped
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (push) Successful in 2s
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
CI/CD Pipeline / PR Build API Image (push) Has been skipped
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 2s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 2s
CI/CD Pipeline / PR Build Web Image (push) Has been skipped
CI/CD Pipeline / PR Build Worker Image (push) Has been skipped
CI/CD Pipeline / Frontend Lint (push) Has been skipped
CI/CD Pipeline / Check push changed paths (push) Successful in 4s
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Validate - Style (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Validate - Security (pull_request) Has been skipped
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Has been skipped
CI/CD Pipeline / Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been skipped
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m58s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 2m45s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been skipped
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 4m9s
CI/CD Pipeline / Integration Tests (push) Successful in 4m19s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 2m25s
CI/CD Pipeline / Validate - Python (mypy + alembic) (push) Successful in 4m23s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 4m32s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 3m41s
CI/CD Pipeline / CI Gate (pull_request) Successful in 2s
CI/CD Pipeline / Build Staging API Image (push) Successful in 4m37s
CI/CD Pipeline / Retag skipped Staging API Image (push) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (push) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (push) Has been skipped
CI/CD Pipeline / Validate - Style (push) Successful in 4m56s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Failing after 39s
CI/CD Pipeline / Staging E2E Tests (push) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (push) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (push) Has been skipped
CI/CD Pipeline / Build Production API Image (push) Has been cancelled
CI/CD Pipeline / Build Production Web Image (push) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (push) Has been cancelled
CI/CD Pipeline / Deploy Production (push) Has been cancelled
CI/CD Pipeline / Production Browser E2E (push) Has been cancelled
CI/CD Pipeline / Canary Release to Production (push) Has been cancelled
CI/CD Pipeline / CI Gate (push) Has been cancelled
CI/CD Pipeline / Validate - Security (push) Has been cancelled
CI/CD Pipeline / Unit Tests (push) Has been cancelled
CI/CD Pipeline / Frontend Unit Tests (push) Has been cancelled
AI Code Review / AI Code Review (pull_request) Has been cancelled
PR Automation / Auto Merge on CI Green + Approved (pull_request) Has been cancelled
PR Automation / Auto Approve on CI Green (pull_request) Has been cancelled
- User=%i -> User=ying (%%i is template-only specifier, not valid here) - After=musetalk.service -> After=musetalk-worker.service (match actual service name) - Log path from /tmp/ to $HOME/ to avoid permission issues for ying user
64 lines
2.8 KiB
Bash
64 lines
2.8 KiB
Bash
#!/bin/bash
|
||
# GPU节点一键初始化脚本 - 在全新GPU机器上执行
|
||
|
||
set -e
|
||
|
||
echo "=== 1. 安装系统依赖 ==="
|
||
sudo apt-get update -qq
|
||
sudo apt-get install -y -qq python3 python3-pip python3-venv ffmpeg wget curl git
|
||
|
||
echo "=== 2. 创建目录 ==="
|
||
mkdir -p ~/projects/MuseTalk ~/projects/gpu-webhook /opt/xiaoxia-gpu-worker
|
||
|
||
echo "=== 3. 安装nvidia-container-toolkit(如需要Docker)==="
|
||
# 可选,当前不使用Docker,跳过
|
||
# distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
|
||
# curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
|
||
# curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
|
||
# sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
|
||
# sudo nvidia-ctk runtime configure --runtime=docker
|
||
# sudo systemctl restart docker
|
||
|
||
echo "=== 4. 拉取服务配置和脚本 ==="
|
||
REPO_URL="https://git.xiaoxiajianji.com/xiaoxia/xiaoxia-saas/raw/branch/develop/deploy/gpu_worker"
|
||
wget -q -O /tmp/musetalk-worker.service "$REPO_URL/musetalk-worker.service"
|
||
wget -q -O /tmp/gpu-poll.service "$REPO_URL/gpu-poll.service"
|
||
wget -q -O /tmp/gpu-poll.timer "$REPO_URL/gpu-poll.timer"
|
||
wget -q -O ~/projects/update-gpu-worker.sh "$REPO_URL/scripts/update-gpu-worker.sh"
|
||
wget -q -O ~/projects/gpu-webhook/poll_and_update.sh "$REPO_URL/scripts/poll_and_update.sh"
|
||
chmod +x ~/projects/update-gpu-worker.sh ~/projects/gpu-webhook/poll_and_update.sh
|
||
|
||
echo "=== 5. 安装systemd服务 ==="
|
||
sudo cp /tmp/musetalk-worker.service /etc/systemd/system/
|
||
sudo cp /tmp/gpu-poll.service /etc/systemd/system/
|
||
sudo cp /tmp/gpu-poll.timer /etc/systemd/system/
|
||
|
||
echo "=== 6. 配置sudo免密 ==="
|
||
sudo bash -c 'cat > /etc/sudoers.d/ying-gpu-update << EOF
|
||
ying ALL=(ALL) NOPASSWD: /bin/systemctl restart musetalk-worker
|
||
ying ALL=(ALL) NOPASSWD: /bin/systemctl restart xiaoxia-gpu-worker
|
||
ying ALL=(ALL) NOPASSWD: /bin/systemctl status musetalk-worker
|
||
ying ALL=(ALL) NOPASSWD: /bin/systemctl status xiaoxia-gpu-worker
|
||
ying ALL=(ALL) NOPASSWD: /bin/systemctl daemon-reload
|
||
ying ALL=(ALL) NOPASSWD: /usr/bin/journalctl
|
||
ying ALL=(ALL) NOPASSWD: /bin/cp
|
||
ying ALL=(ALL) NOPASSWD: /bin/chmod
|
||
ying ALL=(ALL) NOPASSWD: /usr/bin/tee
|
||
EOF'
|
||
sudo chmod 440 /etc/sudoers.d/ying-gpu-update
|
||
|
||
echo "=== 7. 首次拉取代码并启动服务 ==="
|
||
bash ~/projects/update-gpu-worker.sh
|
||
sudo systemctl daemon-reload
|
||
sudo systemctl enable musetalk-worker xiaoxia-gpu-worker gpu-poll.timer
|
||
sudo systemctl start musetalk-worker xiaoxia-gpu-worker gpu-poll.timer
|
||
|
||
echo "=== 完成! ==="
|
||
echo "检查服务状态:"
|
||
echo " sudo systemctl status musetalk-worker"
|
||
echo " sudo systemctl status xiaoxia-gpu-worker"
|
||
echo " sudo systemctl status gpu-poll.timer"
|
||
echo "健康检查:curl http://127.0.0.1:7861/health"
|
||
echo "更新日志:tail -f ~/gpu-worker-update.log"
|
||
echo "轮询日志:tail -f ~/gpu-poll.log"
|