Reuse session object in `manifest-cyber-upload` job
Description
The manifest-cyber-upload job creates a new requests.Session object for each and every API call. This is inefficient and places additional load on computing/networking resources. This MR refactors the job to create the session object at the beginning and reuse it for each API call to Manifest Cyber.
Testing data
Data showing execution time to call Manifest Cyber API using multiple session objects vs. a single session object.
(sample size = 3. NOTE: Excludes time spent polling for SBOM to be ready)
| image | current_execution_time | new_execution_time | performance_increase |
|---|---|---|---|
| nodejs18-amd64 | 53.006s | 34.792s | 34.3% |
| ubi8-amd64 | 80.959s | 53.451s | 33.9% |
| ubi8-arm64 | 82.290s | 54.131s | 34.2% |
Risk
API calls to Manifest Cyber fail.
Rollback Plan
Revert to creating multiple requests.Session objects.
Testing
Edited by Matthew Scott