Repository navigation
feat(vanir): add vanir-sandbox Cloud Run service and HTTP orchestrator - #6403
Conversation
da8c9b4 to
a10c35e
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6403 +/- ##
==========================================
+ Coverage 56.99% 57.01% +0.01%
==========================================
Files 225 227 +2
Lines 23494 23922 +428
==========================================
+ Hits 13391 13638 +247
- Misses 10100 10281 +181
Partials 3 3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
7da151e to
c5beef0
Compare
c5beef0 to
fa5a458
Compare
fa5a458 to
71270c2
Compare
71270c2 to
290d923
Compare
| }, nil | ||
| } | ||
|
|
||
| func (g *HTTPSignatureGenerator) GenerateBatch(ctx context.Context, vulns []*osvschema.Vulnerability, _ string) (SignatureMap, error) { |
There was a problem hiding this comment.
Throughput question: the old path ran a batch of 100 in one Python process with a shared git working dir, on a node with 12–28 CPUs. This runs one request, one interpreter start, and one fresh fetch per vuln, serially within the batch. With the default 10 workers we use at most 10 of the 30 instances, and the 30-minute timeout now applies per vuln rather than per batch. Is that acceptable for the full backfill when there is no last-run timestamp? A bounded fan-out here (or tuning -max-workers=30 -batch-size=1 in the CronJob in PR 2) would use the remaining instances.
There was a problem hiding this comment.
We are using batches of 1 now when running in cloud. (Running in parallel with 15 workers by default)
# Conflicts: # deployment/deploy-prod.yaml
…le local execution (#6504) ## Overview *(AI-assisted PR)* **PR 2 of 2** (follow-up to #6403) to switch `vanir-signatures` to the Cloud Run Gen2 `vanir-sandbox` service and remove local unsandboxed Python execution. ## Details - **Disable local execution (`go/cmd/vanir_signatures`, `go/internal/vanir`):** - Require `VANIR_SANDBOX_URL` / `-sandbox-url` and remove `PythonGenerator` fallback - Default `-batch-size=1` and `-max-workers=15` directly - Remove unused per-batch temp dir creation in `Runner` (distroless-safe) - **Distroless Go image (`go/Dockerfile`, `deployment/build-and-stage.yaml`):** - Switch `vanir-signatures` target to `gcr.io/distroless/static-debian12` (no Python or `git` in the orchestrator image) - Drop unused `--build-context poetry` from `build-vanir-signatures` - **GKE CronJob cutover (`deployment/clouddeploy/gke-workers/`):** - Remove `highend` nodeSelector/tolerations and downsize resources to `1 CPU / 2Gi` (`2 CPU / 4Gi` limit) - Set `VANIR_SANDBOX_URL` to the deterministic Cloud Run URLs for `oss-vdb-test` and `oss-vdb` - **Docs:** Update `AGENTS.md` > **Prod Rollout Note:** `vanir-sandbox` is already live and healthy on `oss-vdb-test`. Before unpausing `vanir-signatures` on prod (`oss-vdb`), make sure prod Terraform (`vanir-sandbox` + `roles/run.invoker`), the Cloud Deploy promotion of `vanir-sandbox` to `production-vanir-sandbox`, and the prod `osv-worker` Workload Identity ServiceAccount are applied. agy
Overview
(AI-assisted PR)
PR 1 of 2 to isolate Vanir signature generation into a dedicated, zero-privilege Cloud Run Gen2 sandbox (
vanir-sandbox).vanir-sandboxservice, OIDC HTTP client, and Docker/Terraform/Cloud Deploy/Cloud Build wiring (backwards-compatible with localPythonGenerator).vanir-signaturesCronJob toVANIR_SANDBOX_URLand moves it off thehighendnode pool.Details
1. Untrusted Sandbox Server (
go/cmd/vanir_sandbox)GET /healthz,POST /v1/generate)tinientrypoint for zombie reaping2. Go Orchestrator (
go/internal/vanir/http_generator.go,go/cmd/vanir_signatures)-sandbox-url/VANIR_SANDBOX_URLflag with local fallbackBatch Size & Max Workers
In remote sandbox mode,
batch-sizecontrols how many vulnerabilities a single worker runs serially inside oneprocessBatchcall. WhenVANIR_SANDBOX_URLis set,-batch-sizedefaults to1and-max-workersdefaults to15(unless overridden via flags):-batch-size=1,-max-workers=15):maxScale: 30headroom; Cloud Run scales to0when idle).retry_list(no other work is discarded).-batch-size=100,-max-workers=10):generate_signatures.pyprocess handles 100 vulnerabilities together with a shared git working directory.3. Infra & Docs
vanir-sandboxtarget ingo/Dockerfilevanir_sandbox.tf, zero-IAM SA, no VPC, Cloud Run Gen2)AGENTS.mdandMakefileGitter
Turns out this is way more complicated than expected. So probably not going to ever implement gitter integration.