Skip to content

Commit 51157a1

Browse files
authored
fix: Update exporter requested resources & scheduling (#4202)
Doubling `num_workers` to 400 allows the exporter to run in ~10 minutes. We've wanted the exporter to run every 15 minutes since forever, so do that now that it can. Also, fixed vulns using camelCase in all.zip and ecosystems.txt not containing a newline at end of file
1 parent a4d1ad0 commit 51157a1

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

deployment/clouddeploy/gke-workers/base/exporter.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
labels:
66
cronLastSuccessfulTimeMins: "180"
77
spec:
8-
schedule: "*/30 * * * *"
8+
schedule: "*/15 * * * *"
99
concurrencyPolicy: Forbid
1010
# If the previous job overruns by more than a minute,
1111
# Don't try to immediately queue up the next job
@@ -26,9 +26,9 @@ spec:
2626
imagePullPolicy: Always
2727
resources:
2828
requests:
29-
cpu: "12"
30-
memory: "48Gi"
29+
cpu: "10"
30+
memory: "40Gi"
3131
limits:
32-
cpu: "24"
33-
memory: "128Gi"
32+
cpu: "20"
33+
memory: "64Gi"
3434
restartPolicy: Never

deployment/clouddeploy/gke-workers/environments/oss-vdb-test/exporter.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ spec:
1515
args:
1616
# TODO(michaelkedar): single source of truth w/ terraform config
1717
- "--uploadToGCS=true"
18+
- "--num_workers=400"
1819
- "--bucket=osv-test-vulnerabilities"
1920
- "--osv_vulns_bucket=osv-test-vulnerabilities"
2021

deployment/clouddeploy/gke-workers/environments/oss-vdb/exporter.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ spec:
1414
value: oss-vdb
1515
args:
1616
- "--uploadToGCS=true"
17+
- "--num_workers=400"
1718
- "--bucket=osv-vulnerabilities"
1819
- "--osv_vulns_bucket=osv-vulnerabilities"
1920

go/cmd/exporter/worker.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ WorkLoop:
169169
if !ok {
170170
break WorkLoop
171171
}
172-
b, err := protojson.MarshalOptions{}.Marshal(v.Vulnerability)
172+
b, err := protoMarshaller.Marshal(v.Vulnerability)
173173
if err != nil {
174174
logger.Error("failed to marshal vulnerability to json", slog.String("id", v.GetId()), slog.Any("err", err))
175175
continue
@@ -185,7 +185,7 @@ WorkLoop:
185185
writeZIP(ctx, allZipFilename, allVulns, outCh)
186186
ecos := slices.Collect(maps.Keys(ecosystems))
187187
slices.Sort(ecos)
188-
ecoString := strings.Join(ecos, "\n")
188+
ecoString := strings.Join(ecos, "\n") + "\n"
189189
write(ctx, ecosystemsFilename, []byte(ecoString), "text/plain", outCh)
190190
logger.Info("all-ecosystem worker finished processing")
191191
}

0 commit comments

Comments
 (0)