- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 1
Slim down Nix builds #530
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
Slim down Nix builds #530
Conversation
For example, this slims down the airflow-operator image from 615MiB to 147MiB. This improvement is a combination of the size of the debuginfo itself (~200MiB per binary), and not having to include build dependencies just because our debuginfo refers to them (primarily, this ended up pulling in GCC, which sits at ~260MiB just on its own).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, tested with nifi-operator.
It did still take a little long, (DONE IN: 102.86s
) but I guess that's just my machine, and maybe the operator I chose to test on.
Yeah that's still pretty slow, but also not super actionable without a before-number to compare against (also, is this a fresh or incremental build?). I obviously think there's more work to be done eventually, but if it's at least a net improvement then I'd be inclined to say that's future work. |
Primarily by disabling debug info.
For example, this slims down the airflow-operator image from 615MiB to 147MiB, and takes the incremental redeploy time from 57s to 29s (on my machine).
This improvement is a combination of the size of the debuginfo itself (~200MiB per binary), and not having to include build dependencies just because our debuginfo refers to them (primarily, this ended up pulling in GCC, which sits at ~260MiB just on its own).
The old behaviour (useful if you want to run it under a debugger.. though we probably want to support that separately somehow) can be restored by adding
--arg debuginfo 2
to thenix-build
call.In addition, this PR adds an option to remove the shell (and associated utililties) from the built images. This can be done by setting
--arg includeShell false
, but is disabled by default because not all operators are compatible yet (in particular: stackabletech/secret-operator#608).