63 lines
2.3 KiB
YAML
63 lines
2.3 KiB
YAML
name: build-worker70
|
|
# Cloud build for the 70B GPTQ worker (Samantha meme arm) — no local docker.
|
|
# Builds live/Dockerfile.worker70 and pushes to ghcr.
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
paths: ["live/Dockerfile.worker70", "live/worker.py", "live/server.py",
|
|
"live/requirements.txt"]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to GHCR
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: ./live
|
|
file: ./live/Dockerfile.worker70
|
|
push: true
|
|
tags: |
|
|
ghcr.io/terrafying/saw-chamber-worker-70b:v3
|
|
ghcr.io/terrafying/saw-chamber-worker-70b:latest
|
|
ghcr.io/terrafying/saw-chamber-worker-70b:${{ github.sha }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
|
|
# Roll out: repoint the 70B endpoint's template at the immutable :sha
|
|
# tag we just pushed. Warm workers keep the old image until their idle
|
|
# timeout recycles them — that lag is expected, not a failed rollout.
|
|
- name: Roll out to RunPod endpoint
|
|
env:
|
|
RUNPOD_API_KEY: ${{ secrets.RUNPOD_API_KEY }}
|
|
TEMPLATE_ID: p3l0rjxwf7 # saw-chamber-70b endpoint dkcntqsm9y6n0g
|
|
IMAGE: ghcr.io/terrafying/saw-chamber-worker-70b:${{ github.sha }}
|
|
run: |
|
|
if [ -z "$RUNPOD_API_KEY" ]; then echo "no RUNPOD_API_KEY secret - skipping rollout"; exit 0; fi
|
|
code=$(curl -s -o /tmp/rollout.json -w "%{http_code}" -m 60 -X PATCH \
|
|
-H "User-Agent: Mozilla/5.0" -H "Content-Type: application/json" \
|
|
-H "Authorization: Bearer $RUNPOD_API_KEY" \
|
|
"https://rest.runpod.io/v1/templates/$TEMPLATE_ID" \
|
|
-d "{\"imageName\": \"$IMAGE\"}")
|
|
echo "template PATCH HTTP $code"
|
|
python3 -c "import json; print('template now pins:', json.load(open('/tmp/rollout.json')).get('imageName'))" \
|
|
|| cat /tmp/rollout.json
|
|
[ "$code" = "200" ] || { echo "rollout FAILED"; exit 1; }
|