-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcloudbuild.yaml
More file actions
56 lines (50 loc) · 1.73 KB
/
cloudbuild.yaml
File metadata and controls
56 lines (50 loc) · 1.73 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
# ============================================================
# Cloud Build config for PharmaGraphRAG Cloud Run image
# ============================================================
# Downloads ChromaDB data from GCS, then builds Docker image
# with baked-in embeddings. Works from both local and CI/CD.
#
# Usage (local):
# gcloud builds submit --config=cloudbuild.yaml .
# Usage (CI/CD):
# gcloud builds submit --config=cloudbuild.yaml --no-source
# ============================================================
steps:
# Download ChromaDB data from GCS
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: 'bash'
args:
- '-c'
- |
mkdir -p data/chroma
gcloud storage cp -r gs://pharmagraphrag-data/chroma/chroma/* data/chroma/
# Build Docker image
- name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args:
- '-c'
- |
cp docker/Dockerfile.cloudrun.dockerignore .dockerignore
docker build -f docker/Dockerfile.cloudrun \
-t gcr.io/pharmagraphrag/pharmagraphrag-api:$_TAG \
-t gcr.io/pharmagraphrag/pharmagraphrag-api:latest \
.
# Push image to GCR (must happen before deploy)
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/pharmagraphrag/pharmagraphrag-api:$_TAG']
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/pharmagraphrag/pharmagraphrag-api:latest']
# Deploy to Cloud Run
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: 'gcloud'
args:
- 'run'
- 'deploy'
- 'pharmagraphrag-api'
- '--image=gcr.io/pharmagraphrag/pharmagraphrag-api:$_TAG'
- '--region=us-central1'
- '--platform=managed'
substitutions:
_TAG: latest
images: ['gcr.io/pharmagraphrag/pharmagraphrag-api:latest']
timeout: '1800s'