Repository navigation
Expand file tree
/
Copy pathcloudbuild.yaml
More file actions
43 lines (39 loc) · 1.85 KB
/
Copy pathcloudbuild.yaml
File metadata and controls
43 lines (39 loc) · 1.85 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
steps:
# Step 1: Deploy to Cloud Functions (2nd Gen) directly from source
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: 'gcloud'
args:
- 'functions'
- 'deploy'
- '${_SERVICE_NAME}' # Function name
- '--gen2'
- '--region=${_REGION}'
- '--runtime=python311'
- '--source=.'
- '--entry-point=cloud_function_entrypoint'
- '--trigger-http'
- '--allow-unauthenticated' # Review and adjust as per your authentication needs
- '--memory=${_MEMORY}'
- '--timeout=${_TIMEOUT}' # Max 3600s for HTTP-triggered 2nd gen functions
- '--max-instances=${_MAX_INSTANCES}'
- '--concurrency=${_CONCURRENCY}'
# Note: CPU for Cloud Functions (2nd gen) is allocated based on memory.
# For 2Gi memory, it typically gets 1 vCPU.
# Optional: --service-account=YOUR_FUNCTION_RUNTIME_SERVICE_ACCOUNT_EMAIL
id: 'Deploy to Cloud Functions'
# This specifies that we're deploying directly from source, no images to build
# images:
# - '${_REGION}-docker.pkg.dev/$PROJECT_ID/${_AR_REPO_NAME}/${_SERVICE_NAME}:${_TAG}'
substitutions:
_SERVICE_NAME: 'seeker-podcast-processor' # From .env.deploy SERVICE_NAME
_REGION: 'us-central1' # From .env.deploy REGION
_MEMORY: '2Gi' # From .env.deploy MEMORY
_TIMEOUT: '3600s' # From .env.deploy TIMEOUT (converted to seconds)
_MAX_INSTANCES: '5' # From .env.deploy MAX_INSTANCES
_CONCURRENCY: '1000' # From .env.deploy CONCURRENCY
# _AR_REPO_NAME: 'seeker-functions-repo' # Not needed for source deployment
# _TAG: 'latest' # Not needed for source deployment
# PROJECT_ID and COMMIT_SHA are built-in substitutions provided by Cloud Build.
# $PROJECT_ID will be automatically replaced with 'metapod-d52fc' from your .env.deploy.
options:
logging: CLOUD_LOGGING_ONLY