Skip to content

perf: improve speed of combine-to-osv cron#5609

Open
jess-lowe wants to merge 8 commits into
google:masterfrom
jess-lowe:perf/combine
Open

perf: improve speed of combine-to-osv cron#5609
jess-lowe wants to merge 8 commits into
google:masterfrom
jess-lowe:perf/combine

Conversation

@jess-lowe

@jess-lowe jess-lowe commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

downloading via gcloud was taking 25+ minutes, this does the download in go, and in parallel with a bunch of workers

@jess-lowe jess-lowe changed the title perf/combine perf: improve speed of combine-to-osv cron Jul 9, 2026
@jess-lowe jess-lowe marked this pull request as ready for review July 9, 2026 05:20
}
osvRecords[cveID] = baseOSV
// Collect all unique CVE IDs
allIDs := make(map[models.CVEID]bool)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: map[models.CVEID]struct{}

Comment thread vulnfeeds/cmd/combine-to-osv/main.go
Comment thread vulnfeeds/cmd/combine-to-osv/main.go Outdated

// Interpose Collector to gather valid IDs
var validIDs []string
var idWg sync.WaitGroup

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use some longer variable names, it's unclear what this waitgroup is for.

Comment thread vulnfeeds/cmd/combine-to-osv/main.go
if len(v.GetAffected()) > 0 {
validIDs = append(validIDs, v.GetId())
}
validVulnChan <- v

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like validVulnChan is named wrong? It's just all vulns right? Maybe you want to call it uploadVulnsChan?

Comment on lines +19 to +20
INPUT_BUCKET="${INPUT_GCS_BUCKET:=osv-test-cve-osv-conversion}"
OUTPUT_BUCKET="${OUTPUT_GCS_BUCKET:=osv-test-cve-osv-conversion}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change intentional? I think this will break prod.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The kubernetes files are not correctly setting the bucket env variables I believe. Please double check.

Comment thread vulnfeeds/cmd/combine-to-osv/main.go
Comment thread vulnfeeds/cmd/combine-to-osv/main.go Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants