diff --git a/deployment/clouddeploy/oss-fuzz-workers/scaler.yaml b/deployment/clouddeploy/oss-fuzz-workers/scaler.yaml new file mode 100644 index 00000000000..b81c1d13689 --- /dev/null +++ b/deployment/clouddeploy/oss-fuzz-workers/scaler.yaml @@ -0,0 +1,47 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: pubsub +spec: + minReplicas: 1 + maxReplicas: 400 + metrics: + - external: + metric: + name: pubsub.googleapis.com|subscription|num_undelivered_messages + selector: + matchLabels: + resource.labels.subscription_id: oss-fuzz-tasks + target: + type: AverageValue + averageValue: 1 + type: External + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: workers + behavior: + scaleUp: + stabilizationWindowSeconds: 0 + policies: + - type: Percent + value: 10 + periodSeconds: 300 + - type: Pods + value: 20 + periodSeconds: 300 + selectPolicy: Max diff --git a/deployment/clouddeploy/oss-fuzz-workers/skaffold.yaml b/deployment/clouddeploy/oss-fuzz-workers/skaffold.yaml index f4602e7d0cb..11dd51be8db 100644 --- a/deployment/clouddeploy/oss-fuzz-workers/skaffold.yaml +++ b/deployment/clouddeploy/oss-fuzz-workers/skaffold.yaml @@ -10,6 +10,7 @@ profiles: - workers.yaml - make-bugs-public.yaml - process-results.yaml + - scaler.yaml deploy: kubectl: {} diff --git a/deployment/deploy-prod.yaml b/deployment/deploy-prod.yaml index 5e1d7a911e1..b67c8ac2660 100644 --- a/deployment/deploy-prod.yaml +++ b/deployment/deploy-prod.yaml @@ -26,6 +26,7 @@ steps: # Deploy OSS-Fuzz workers - name: gcr.io/cloud-builders/gcloud args: ['deploy', 'releases', 'create', 'osv-$SHORT_SHA', '--project=oss-vdb', '--region=us-central1', '--delivery-pipeline=oss-fuzz-workers', '--images', 'worker=gcr.io/oss-vdb/oss-fuzz-worker:$COMMIT_SHA,importer=gcr.io/oss-vdb/oss-fuzz-importer:$COMMIT_SHA,cron=gcr.io/oss-vdb/cron:$COMMIT_SHA', '--annotations=tag=$TAG_NAME'] + dir: 'oss-fuzz-workers' # Tag the deployed images with the git tag - name: gcr.io/cloud-builders/gcloud diff --git a/deployment/deploy.sh b/deployment/deploy.sh index 85fdd1f6b1e..86b8bd4182b 100755 --- a/deployment/deploy.sh +++ b/deployment/deploy.sh @@ -38,4 +38,4 @@ if [[ -z "$commit_sha" || -z "$short_sha" ]]; then exit 1 fi -gcloud beta builds submit --config=deploy-prod.yaml --project=oss-vdb --no-source --substitutions="COMMIT_SHA=${commit_sha},SHORT_SHA=${short_sha},TAG_NAME=${tag_name}" +gcloud beta builds submit ./clouddeploy --config=deploy-prod.yaml --project=oss-vdb --substitutions="COMMIT_SHA=${commit_sha},SHORT_SHA=${short_sha},TAG_NAME=${tag_name}" diff --git a/deployment/terraform/modules/oss_fuzz/main.tf b/deployment/terraform/modules/oss_fuzz/main.tf index f929e81d773..750b0576107 100644 --- a/deployment/terraform/modules/oss_fuzz/main.tf +++ b/deployment/terraform/modules/oss_fuzz/main.tf @@ -68,16 +68,6 @@ resource "google_container_node_pool" "workers_pool" { local_ssd_count = 1 oauth_scopes = ["https://www.googleapis.com/auth/cloud-platform"] - - labels = { - workloadType = "workers-pool" - } - - taint { - effect = "NO_EXECUTE" - key = "workloadType" - value = "workers-pool" - } } }