-
Notifications
You must be signed in to change notification settings - Fork 671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create release Docker images for stacks-signer
binary
#4278
Comments
this may be a little tricky, and i have not tried something like this with rust projects so i'm not sure how much we can shrink the binaries. |
I built the binaries locally and stripped them afterwards, resulting in a significant size decrease. Command ran: OS: Debian 13 Size reduction:
I've also tested the binaries after the strip to ensure that they don't panic and still work, but further testing must be done in order to be sure that they work as expected. |
outstanding, thanks! we'll want to run the binaries though a bit more testing, but this looks very promising and simple change to make |
Total size of all packages before reductions: 1545 MB It looks like stripping the debug-info will be default in a future (1.77) stable release of cargo (currently implemented in nightly): Discussion comment I found another way to strip, by also stripping all symbols (running just
By adding Size of binaries after the strip: Using
Enabling link time optimization ( Reducing the parallel code generation units to 1 ( Aborting instead of unwinding on panic ( Additions to the root [profile.release]
debug = true
# package.stacks-node.strip = "debuginfo"
# package.stacks-signer.strip = "debuginfo"
strip = "debuginfo"
lto = true
opt-level = "s"
codegen-units = 1
panic = "abort" It is also possible to parse these settings through the RUSTFLAGS="-C strip=debuginfo -C opt-level=s -C codegen-units=1 -C panic=abort" cargo build --features monitoring_prom,slog_json --release --workspace Final size (with
However, having
Using
Size of binaries after all steps (without To sum it up, I've managed to reduce the total size of all the binaries from 1.545 GB to 67.178 MB (without |
Is the main downside of stripping debug symbols that you can't get backtraces with |
yeah there are some extra considerations to consider here vs just stripping
the binaries.
we'll work on a fork before we pr anything here- i think any change will
have a larger effect so we'll want tobe explicit as to why we chose a
specific method.
…On Mon, Jan 29, 2024 at 14:01 Hank Stoever ***@***.***> wrote:
Is the main downside of stripping debug symbols that you can't get
backtraces with RUST_BACKTRACE=1 ...?
—
Reply to this email directly, view it on GitHub
<#4278 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAVXIHBHHYEBAIR6GOMCFUTYRAL3DAVCNFSM6AAAAABCHFVVEWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJVGY2TANZSGI>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
one more wrinkle that i've enountered here - it's only possible to add a release binary today for the source arch. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Opening this based off this discussion: #4268 (comment)
PR #4268 adds the
stacks-signer
and other binaries to the Docker images that we create in CI runs. Previously, only thestacks-node
binary was included. Including the other binaries helps us publish images with the signer, but it significantly increases the image size (880 MB to 1.6 GB). For regular CI runs, this is ok, because it lets us debug builds via Docker. For releases, however, we may want to either optimize the images or build separate images for the different binaries.The text was updated successfully, but these errors were encountered: