Skip to content
This repository was archived by the owner on May 6, 2025. It is now read-only.

Support parallel lookups #23

Merged
merged 2 commits into from
Aug 2, 2024
Merged

Support parallel lookups #23

merged 2 commits into from
Aug 2, 2024

Conversation

puerco
Copy link
Contributor

@puerco puerco commented Jul 25, 2024

This PR moves the internals of the trusty client to perform the API requests with http.Agent from kubernetes sig release which supports retries and parallel requests.

Right now the requests are capped are capped as the trusty API seems to reject more than two or three at a time but it's speeding up already (this is the trusty CLI):

time go run . sbom examples/sboms/cilium-v1.15.7.spdx.json
BEFORE
real	0m42.461s
user	0m3.177s
sys	0m0.502s

AFTER
real	0m17.411s
user	0m3.324s
sys	0m0.487s

This also adds a couple of functions to work with package URL directly in the client.

Updated the tests and added new ones for the parallel functions.

@ghost
Copy link

ghost commented Jul 25, 2024

Minder Vulnerability Report ✅

Minder analyzed this PR and found no vulnerable dependencies.

Vulnerability scan of ccc73643:

  • 🐞 vulnerable packages: 0
  • 🛠 fixes available for: 0

@JAORMX
Copy link
Contributor

JAORMX commented Jul 25, 2024

If you switch to gh.trustypkg.dev as an endpoint you should get more busy capacity. That's more means for CI jobs.

JAORMX
JAORMX previously approved these changes Jul 25, 2024
"github.com/stacklok/trusty-sdk-go/pkg/types"
)

const (
defaultEndpoint = "https://api.trustypkg.dev"
defaultEndpoint = "https://gh.trustypkg.dev"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JAORMX switched to the gh endpoint ^

puerco added 2 commits August 2, 2024 09:33
Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
This commit modifies the client to perform its requests using
sig releases http agent which supports retries and parallel
requests.

Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
@puerco puerco merged commit 285be63 into main Aug 2, 2024
2 checks passed
@puerco puerco deleted the parallel branch August 2, 2024 15:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants