ZeroGPU-LLM-Inference / cloudbuild.yaml
Alikestocode's picture
Add Cloud Build deployment script and permission setup helper
fd26b3d
# Cloud Build configuration for Google Cloud Run
# Usage: gcloud builds submit --config=cloudbuild.yaml .
steps:
# Build the container image
- name: 'gcr.io/cloud-builders/docker'
args:
- 'build'
- '-t'
- 'gcr.io/$PROJECT_ID/router-agent:latest'
- '-t'
- 'gcr.io/$PROJECT_ID/router-agent:$SHORT_SHA'
- '.'
# Push the container image
- name: 'gcr.io/cloud-builders/docker'
args:
- 'push'
- '--all-tags'
- 'gcr.io/$PROJECT_ID/router-agent'
# Deploy to Cloud Run (CPU only - for GPU use Compute Engine)
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
- 'run'
- 'deploy'
- 'router-agent'
- '--image'
- 'gcr.io/$PROJECT_ID/router-agent:latest'
- '--platform'
- 'managed'
- '--region'
- '${_REGION}'
- '--allow-unauthenticated'
- '--port'
- '7860'
- '--memory'
- '8Gi'
- '--cpu'
- '4'
- '--timeout'
- '3600'
- '--max-instances'
- '10'
- '--set-env-vars'
- 'GRADIO_SERVER_NAME=0.0.0.0,GRADIO_SERVER_PORT=7860'
images:
- 'gcr.io/$PROJECT_ID/router-agent:latest'
- 'gcr.io/$PROJECT_ID/router-agent:$SHORT_SHA'
substitutions:
_REGION: 'us-central1'
options:
machineType: 'E2_HIGHCPU_8'
logging: CLOUD_LOGGING_ONLY