ci: build workflows roll images out to runpod endpoints — PATCH the template's imageName onto the fresh :sha tag so pushes actually ship
This commit is contained in:
1 parent
a290f819b7
commit
db99316ebe
2 files changed
+40
No files matched your search
@@ -40,3 +40,23 @@ jobs:
|
||||
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; }
|
||||
Reference in new issue
Block a user