fix: simplify CI workflows to run directly on runner without nested containers
Run Tests / Backend Tests (push) Has been cancelled
Run Tests / Frontend Tests (push) Has been cancelled
Run Tests / Test Summary (push) Has been cancelled
Deploy Dashboard (Dev) / deploy-dev (push) Failing after 15m27s
Deploy Claude Dev (Dev) / deploy-claude-dev-dev (push) Has started running
Run Tests / Backend Tests (push) Has been cancelled
Run Tests / Frontend Tests (push) Has been cancelled
Run Tests / Test Summary (push) Has been cancelled
Deploy Dashboard (Dev) / deploy-dev (push) Failing after 15m27s
Deploy Claude Dev (Dev) / deploy-claude-dev-dev (push) Has started running
- Remove container blocks causing Docker-in-Docker permission issues - Use actions/checkout@v4 instead of manual git cloning - Use actions/setup-python@v5 and actions/setup-node@v4 for clean environments - Remove nsenter workarounds and mount complexity - Fix volume paths to use /volume1/docker/* directly - Add /volume1/docker/claude-dev to runner valid_volumes config This eliminates 20+ commits of permission/namespace hacks by letting workflows run directly in the runner's environment which already has Docker access and proper volume mounts configured.
This commit is contained in:
@@ -18,18 +18,9 @@ concurrency:
|
||||
jobs:
|
||||
deploy-claude-dev-dev:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
volumes:
|
||||
- /var/packages/ContainerManager/target/usr/bin/docker:/usr/bin/docker
|
||||
- /volume1/docker/claude-dev:/claude-dev-runtime
|
||||
steps:
|
||||
- name: Checkout exact commit
|
||||
run: |
|
||||
set -euo pipefail
|
||||
git init .
|
||||
git remote add origin http://gitea:3000/jimmy/nas-tools.git
|
||||
git fetch --depth 1 origin "$GITHUB_SHA"
|
||||
git checkout --detach FETCH_HEAD
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Resolve image tags
|
||||
run: |
|
||||
@@ -89,10 +80,10 @@ jobs:
|
||||
- name: Record previous image
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mkdir -p /claude-dev-runtime
|
||||
mkdir -p /volume1/docker/claude-dev
|
||||
previous_image="$(docker inspect -f '{{.Config.Image}}' claude-dev 2>/dev/null || true)"
|
||||
if [ -n "$previous_image" ]; then
|
||||
printf '%s\n' "$previous_image" > /claude-dev-runtime/previous-image.txt
|
||||
printf '%s\n' "$previous_image" > /volume1/docker/claude-dev/previous-image.txt
|
||||
echo "Saved previous image: $previous_image"
|
||||
else
|
||||
echo "No existing claude-dev container found"
|
||||
@@ -101,8 +92,8 @@ jobs:
|
||||
- name: Sync compose and target tag
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cp claude-dev/docker-compose.yml /claude-dev-runtime/docker-compose.yml
|
||||
printf '%s\n' "$CLAUDE_DEV_IMAGE_TAG" > /claude-dev-runtime/target-tag.txt
|
||||
cp claude-dev/docker-compose.yml /volume1/docker/claude-dev/docker-compose.yml
|
||||
printf '%s\n' "$CLAUDE_DEV_IMAGE_TAG" > /volume1/docker/claude-dev/target-tag.txt
|
||||
|
||||
- name: Remove stale claude-dev container
|
||||
run: docker rm -f claude-dev || true
|
||||
@@ -110,7 +101,7 @@ jobs:
|
||||
- name: Deploy claude-dev
|
||||
run: |
|
||||
set -euo pipefail
|
||||
CLAUDE_DEV_IMAGE_TAG="$CLAUDE_DEV_IMAGE_TAG" docker compose -f /claude-dev-runtime/docker-compose.yml up -d --pull never
|
||||
CLAUDE_DEV_IMAGE_TAG="$CLAUDE_DEV_IMAGE_TAG" docker compose -f /volume1/docker/claude-dev/docker-compose.yml up -d --pull never
|
||||
|
||||
- name: Post-deploy runtime checks
|
||||
run: |
|
||||
|
||||
@@ -13,19 +13,9 @@ concurrency:
|
||||
jobs:
|
||||
deploy-dev:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
options: --pid=host
|
||||
volumes:
|
||||
- /var/packages/ContainerManager/target/usr/bin/docker:/usr/bin/docker
|
||||
- /volume1/docker/nas-dashboard:/nas-dashboard
|
||||
steps:
|
||||
- name: Checkout exact commit
|
||||
run: |
|
||||
set -euo pipefail
|
||||
git init .
|
||||
git remote add origin http://gitea:3000/jimmy/nas-tools.git
|
||||
git fetch --depth 1 origin "$GITHUB_SHA"
|
||||
git checkout --detach FETCH_HEAD
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Warm mirror cache for base images
|
||||
run: |
|
||||
set -u
|
||||
@@ -61,19 +51,11 @@ jobs:
|
||||
export DOCKER_API_VERSION=1.43
|
||||
DOCKER_BUILDKIT=0 docker build --cache-from nas-dashboard-dev:latest -t nas-dashboard-dev:latest dashboard/
|
||||
- name: Sync runtime compose file
|
||||
run: cp dashboard/docker-compose.dev.yml /nas-dashboard/docker-compose.dev.yml
|
||||
run: cp dashboard/docker-compose.dev.yml /volume1/docker/nas-dashboard/docker-compose.dev.yml
|
||||
- name: Deploy dev
|
||||
run: |
|
||||
export DOCKER_API_VERSION=1.43
|
||||
# Write deploy script to mounted volume (accessible from both container and host)
|
||||
cat > /nas-dashboard/deploy.sh << 'EOF'
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
export DOCKER_API_VERSION=1.43
|
||||
cd /volume1/docker/nas-dashboard
|
||||
/volume1/@appstore/ContainerManager/usr/bin/docker rm -f nas-dashboard-dev || true
|
||||
/volume1/@appstore/ContainerManager/usr/bin/docker compose -f docker-compose.dev.yml up -d --pull never
|
||||
EOF
|
||||
chmod +x /nas-dashboard/deploy.sh
|
||||
# Execute script on host using the host path
|
||||
nsenter -t 1 -m -n /volume1/docker/nas-dashboard/deploy.sh
|
||||
docker rm -f nas-dashboard-dev || true
|
||||
docker compose -f docker-compose.dev.yml up -d --pull never
|
||||
|
||||
+11
-14
@@ -15,18 +15,17 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
run: |
|
||||
git clone http://gitea:3000/jimmy/nas-tools.git .
|
||||
git checkout ${{ github.sha }}
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Python
|
||||
run: |
|
||||
apt-get update && apt-get install -y python3 python3-pip python3-venv
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
cd dashboard/backend
|
||||
python3 -m venv venv
|
||||
python -m venv venv
|
||||
. venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
pip install -r requirements-dev.txt
|
||||
@@ -52,14 +51,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
run: |
|
||||
git clone http://gitea:3000/jimmy/nas-tools.git .
|
||||
git checkout ${{ github.sha }}
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Node.js
|
||||
run: |
|
||||
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
|
||||
apt-get install -y nodejs
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user