Deploying InferenceWorker
This guide covers deploying InferenceWorker Docker images. InferenceWorker runs as a sidecar alongside model containers on Execlet VMs.
Prerequisites
- GitHub Access: Write permissions to trigger GitHub Actions
Deployment Steps
Build Docker Image
Trigger the GitHub Action to build and push the InferenceWorker Docker image:
Location: .github/workflows/docker_iris.yml ⧉
Via GitHub UI:
- Click "Run workflow"
- Select branch (usually
main) - Select target GCP project
- Ensure "Build inference_worker image" is checked
- Click "Run workflow" button
What it does:
- Builds Docker image for InferenceWorker
- Pushes to Google Artifact Registry as
inference_worker:latest - Tags with commit SHA for version tracking
Image locations:
- Development:
us-central1-docker.pkg.dev/devel-466814/inference/inference_worker:latest - Production:
us-central1-docker.pkg.dev/production-492618/inference/inference_worker:latest
How It Gets Deployed
InferenceWorker is deployed automatically as part of the VM provisioning process:
New VMs
When Hydra provisions a new VM:
- Hydra creates VM based on job requirements
- Ansible runs VM initialization scripts
- VM pulls
inference_worker:latestfrom Artifact Registry - Gateway submits docker-compose job to Streamer
- Execlet runs
docker-compose upwith InferenceWorker sidecar - InferenceWorker starts consuming from RabbitMQ
Result: New VMs automatically use the latest InferenceWorker image.
Existing VMs
VMs that are already running will continue using their current InferenceWorker image until:
- The replica is stopped and a new one is created
- The VM is terminated and replaced (manual or auto-scaling)
- The deployment is recreated
Note: There is no automatic rolling update for InferenceWorker on existing VMs.
Verification
1. Check Image Exists
Verify the new image was pushed to Artifact Registry:
# Development
gcloud artifacts docker images list \
us-central1-docker.pkg.dev/devel-466814/inference/inference_worker \
--project devel-466814
# Production
gcloud artifacts docker images list \
us-central1-docker.pkg.dev/production-492618/inference/inference_worker \
--project production-492618
2. Check New Replica Uses Latest Image
After creating a new deployment or scaling up:
# SSH to Execlet VM
ssh <execlet-vm-ip>
# Check running containers
docker ps | grep inference_worker
# Check image tag
docker inspect <container-id> | grep Image
Expected: Image tag should match the commit SHA or latest from the recent build.
Rollback
If the new InferenceWorker image has issues:
Rollback Image in Artifact Registry
1. Find previous working image:
gcloud artifacts docker images list \
us-central1-docker.pkg.dev/production-492618/inference/inference_worker \
--project production-492618 \
--format="table(version,createTime)"
2. Tag previous version as latest:
# Pull old version
docker pull us-central1-docker.pkg.dev/production-492618/inference/inference_worker:<old-sha>
# Retag as latest
docker tag \
us-central1-docker.pkg.dev/production-492618/inference/inference_worker:<old-sha> \
us-central1-docker.pkg.dev/production-492618/inference/inference_worker:latest
# Push
docker push us-central1-docker.pkg.dev/production-492618/inference/inference_worker:latest
Troubleshooting
Worker Not Reporting Metrics
Check worker logs:
# SSH to VM
ssh <execlet-vm-ip>
# View worker logs
docker logs <inference-worker-container-id>
Common issues:
METRIC_SERVER_URLorMETRIC_SERVER_SERVICE_TOKENincorrect- MetricServer unreachable from VM network
- Worker crashed during startup (check exit code)
Worker Not Consuming Messages
Check RabbitMQ connection:
# Check worker logs for connection errors
docker logs <inference-worker-container-id> | grep -i rabbitmq
Common issues:
RABBITMQ_HOSTor credentials incorrect- Firewall blocks connection to RabbitMQ
Best Practices
Emergency Hotfix
For critical bugs requiring immediate rollback:
- Rollback
latesttag in Artifact Registry (see Rollback section) - Notify team to remove VM in PI
- Auto-scaler will gradually replace replicas as traffic scales
- Fix the bug and re-deploy proper fix