Skip to content

Commit

Permalink
chore: add staging spot instance templates (#2148)
Browse files Browse the repository at this point in the history
* chore: add staging spot instance templates

* chore: reduce staging min ready
  • Loading branch information
Ziinc authored Jul 18, 2024
1 parent 75234fe commit d406a8d
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions cloudbuild/staging/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
steps:
# create instance template
# create instance template - dedicated
- name: gcr.io/cloud-builders/gcloud
allowExitCodes: [1]
args:
Expand Down Expand Up @@ -28,6 +28,36 @@ steps:
- --shielded-integrity-monitoring
- --image=cos-stable-109-17800-147-54
- --image-project=cos-cloud
# create spot instance template
- name: gcr.io/cloud-builders/gcloud
allowExitCodes: [1]
args:
- compute
- instance-templates
- create-with-container
- $_TEMPLATE_NAME_SPOT
- --boot-disk-size=25GB
- --boot-disk-type=pd-balanced
- --machine-type=${_INSTANCE_TYPE}
- --project=logflare-staging
- --provisioning-model=SPOT
- --network-interface=network=default,network-tier=PREMIUM
- --maintenance-policy=TERMINATE
- --service-account=compute-engine-2022@logflare-staging.iam.gserviceaccount.com
- --scopes=https://www.googleapis.com/auth/cloud-platform
- --tags=phoenix-http,https-server
- --container-image=${_CONTAINER_IMAGE}
- --metadata-from-file=shutdown-script=./cloudbuild/shutdown.sh
# needed for enabling node-problem-detector, explicitly enable logging
- --metadata=google-monitoring-enabled=true,google-logging-enabled=true
- --container-privileged
- --container-restart-policy=always
- --container-env=LOGFLARE_GRPC_PORT=50051,RELEASE_COOKIE=${_COOKIE},LOGFLARE_LOGGER_METADATA_CLUSTER=${_CLUSTER},LOGFLARE_ALERTS_ENABLED=false
- --no-shielded-secure-boot
- --shielded-vtpm
- --shielded-integrity-monitoring
- --image=cos-stable-109-17800-147-54
- --image-project=cos-cloud
# update instance group to the new template
- name: gcr.io/cloud-builders/gcloud
args:
Expand All @@ -43,7 +73,7 @@ steps:
- --type=proactive
- --max-surge=1
- --max-unavailable=0
- --min-ready=300
- --min-ready=60
- --minimal-action=replace
- --most-disruptive-allowed-action=replace
- --replacement-method=substitute
Expand All @@ -57,6 +87,7 @@ substitutions:
_INSTANCE_GROUP: instance-group-staging-${_CLUSTER}
_IMAGE_TAG: $SHORT_SHA
_TEMPLATE_NAME: logflare-staging-${_CLUSTER}-cluster-${_NORMALIZED_IMAGE_TAG}
_TEMPLATE_NAME_SPOT: ${_TEMPLATE_NAME_SPOT}-spot
_CONTAINER_IMAGE: gcr.io/logflare-staging/logflare_app:${_IMAGE_TAG}
timeout: 1800s
options:
Expand Down

0 comments on commit d406a8d

Please sign in to comment.