-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Expand file tree
/
Copy pathcloudbuild.yaml
More file actions
79 lines (69 loc) · 1.94 KB
/
cloudbuild.yaml
File metadata and controls
79 lines (69 loc) · 1.94 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Cloud Build configuration for elizaOS GCP Cloud Run workers
#
# Usage:
# gcloud builds submit --config=cloudbuild.yaml \
# --substitutions=_REGION=us-central1,_RUNTIME=typescript
#
# Available runtimes: typescript, python, rust
substitutions:
_REGION: us-central1
_RUNTIME: typescript
_SERVICE_NAME: eliza-worker
_MIN_INSTANCES: "0"
_MAX_INSTANCES: "100"
_MEMORY: "512Mi"
_CPU: "1"
_TIMEOUT: "60s"
steps:
# Build the Docker image
- name: "gcr.io/cloud-builders/docker"
id: "build"
args:
- "build"
- "-t"
- "${_REGION}-docker.pkg.dev/$PROJECT_ID/eliza/${_SERVICE_NAME}-${_RUNTIME}:$COMMIT_SHA"
- "-t"
- "${_REGION}-docker.pkg.dev/$PROJECT_ID/eliza/${_SERVICE_NAME}-${_RUNTIME}:latest"
- "-f"
- "${_RUNTIME}/Dockerfile"
- "${_RUNTIME}"
# Push to Artifact Registry
- name: "gcr.io/cloud-builders/docker"
id: "push"
args:
- "push"
- "--all-tags"
- "${_REGION}-docker.pkg.dev/$PROJECT_ID/eliza/${_SERVICE_NAME}-${_RUNTIME}"
# Deploy to Cloud Run
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk"
id: "deploy"
entrypoint: "gcloud"
args:
- "run"
- "deploy"
- "${_SERVICE_NAME}-${_RUNTIME}"
- "--image"
- "${_REGION}-docker.pkg.dev/$PROJECT_ID/eliza/${_SERVICE_NAME}-${_RUNTIME}:$COMMIT_SHA"
- "--region"
- "${_REGION}"
- "--platform"
- "managed"
- "--allow-unauthenticated"
- "--memory"
- "${_MEMORY}"
- "--cpu"
- "${_CPU}"
- "--timeout"
- "${_TIMEOUT}"
- "--min-instances"
- "${_MIN_INSTANCES}"
- "--max-instances"
- "${_MAX_INSTANCES}"
- "--set-env-vars"
- "LOG_LEVEL=INFO"
images:
- "${_REGION}-docker.pkg.dev/$PROJECT_ID/eliza/${_SERVICE_NAME}-${_RUNTIME}:$COMMIT_SHA"
- "${_REGION}-docker.pkg.dev/$PROJECT_ID/eliza/${_SERVICE_NAME}-${_RUNTIME}:latest"
options:
logging: CLOUD_LOGGING_ONLY
timeout: "1200s"