Our recent works on making copr sign process more effective #2935
Replies: 5 comments 15 replies
-
Thank you for the analysis, @pkking! One missing point we should consider is signing of large (S)RPMs. Consider that the RPMs are often larger than a few MBs, and sometimes are also very large >= 1GB (we have an internal use-case where RPMs are >= 3GB). The
Definitely. As long as it is opt-in, it's definitely OK to have the support upstream! |
Beta Was this translation helpful? Give feedback.
-
@pkking WRT the mass-resign process, note that we plan to use PULP as the RPM repository manager in the future. So you might want to work on integrating Signatrust with PULP, too? |
Beta Was this translation helpful? Give feedback.
-
Its my fisrt glance on PULP, it seems to be a funny project who also happened to solv many of our problems and i will talk to signatrust team to discuss the integration :) |
Beta Was this translation helpful? Give feedback.
-
We conducted performance tests in two scenarios: Scenario 1: Common scenarios for RPM package signing. The test files range from a few MB to several GB. There are 4,000 RPM packages occupying 19 GB of disk space in total. All RPM files can be downloaded at: https://repo.openeuler.org/openEuler-22.03-LTS/source/Packages/ Scenario 2: Extreme scenario where all RPM packages are large files. Actually each RPM has a size of 1.8 GB, with a total of 50 files, occupying 100 GB of disk space. The test RPM package can be downloaded at: https://dl.fedoraproject.org/pub/fedora/linux/releases/38/Everything/source/tree/Packages/s/speed-dreams-2.2.3-6.fc38.src.rpm Test Environment: Test Results: signatrust(v3 signature): signatrust(v4 signature): CPU and Memory Consumption for Scenario 2 Conclusion: |
Beta Was this translation helpful? Give feedback.
-
Which I suppose you mentioned here already #2935 (reply in thread) |
Beta Was this translation helpful? Give feedback.
-
Hi team, im very excited to share our recent works on copr and looking forward to hear you opinions :)
Why we need a faster sign process?
Once upon a while we have to sign a lot of packages in our copr instances(called EUR) because we need to switch to a new signing key.
When i courageously run the
copr_fix_gpg.py
for my first 2000 packages, the whole process halt for about 45mins and meanwhile i am so worried it will jam forever when i then start to sign the left 20,000 packages.After this heartquake signing process, i take some time to investigate the copr sign process.
How copr sign a rpm
Here's a image illustrating how copr sign a rpm:
On the client-side(copr-backend):
/gen_key
to gen the key when new project is created/forked.sign
tool inobs-signd
rpm package to sign each rpm separately.On the server-side(copr-keygen):
/gen_key
API is called, copr-keygen will callpgp2
to generate a keypair and store it in the database.sign
tool to sign a rpm, the tool will establish a TCP connection withobs-signd
running on keygen node and send the rpmpayload
to it.Why backend sign not so fast
sign
to sign rpm one by one, actually each sign process were irrelevantsign
can't resign a rpm, so we mustunsign && sign
the rpm each timeobs-signd
also do not support concurrentWay to speed up
At the early of 2023, openEuler community open sourced signatrust as a highly secure, async and efficient solution for signing Linux packages and binaries platform.
Signatrust itself provides secure and high throughput for all signing requests, and that's what we thought a mordern signing infrastructure should be. Here
Why signatrust is faster
Benchmarks
Here are some benchmarks comparing the performance of signatrust vs the obs-signd approach:
Lets explaine the benchmarks:
copr-backend
The bench results showed signatrust were 3x-10x faster than obs-signd in all three cases. This is mainly because:
And also, we monitord obs-signd CPU and Memory usage, it's always very low during signing process. This indicates obs-signd is not fully utilizing the server resources and not handling requests concurrently.
What now
openEuler copr instance EUR(openEuler User Repo) have already finished migrating our sign backend service from
obs-signd
tosignatrust
To sum up in a word: each time the user build a single package on a chroot cost less 5~10 seconds than before
see the i3 builds using obs-signd vs using signatrust
Still we patched backend to make sign backend plugable, if you were interested, i'd like make a PR :)
Beta Was this translation helpful? Give feedback.
All reactions