File size: 1,363 Bytes
aa65d00
fd26b3d
 
aa65d00
 
 
 
 
 
 
fd26b3d
 
aa65d00
 
 
 
 
 
fd26b3d
 
aa65d00
 
 
 
 
 
 
 
 
fd26b3d
aa65d00
 
 
fd26b3d
aa65d00
 
 
 
 
 
 
 
 
fd26b3d
 
aa65d00
 
 
 
 
fd26b3d
 
 
 
aa65d00
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# 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