Skip to content

Recompress xz -> xz with tuned compression options #58

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

Merged
merged 1 commit into from
Apr 3, 2023

Conversation

Mark-Simulacrum
Copy link
Member

@Mark-Simulacrum Mark-Simulacrum commented Apr 3, 2023

This adds support for recompressing the .xz tarballs in promote-release, with a goal of moving rust-lang/rust CI back to producing "balanced" profile binaries rather than the highly compressed ones currently produced. This will cut rust-lang/rust CI times while keeping the production artifacts in static.r-l.o equivalently compressed. The settings in this PR match the current configuration in rust-lang/rust's best compression profile.

This PR doesn't enable the .xz recompression by default, but that will happen in production as I've deployed the env variable with =1 already (we can remove that if we run into trouble in production easily). Depending on the impact to (especially) stable build times we may wish to bump the promote-release production container from 8 cores to 72 cores (the next largest container) so that we still finish in a reasonable amount of time. This is done so that we can land this PR immediately and then follow-up with necessary changes in rust-lang/rust and in simpleinfra.

r? @pietroalbini

@Mark-Simulacrum
Copy link
Member Author

Mark-Simulacrum commented Apr 3, 2023

For additional context I decided to work on this since I'm seeing some of our fastest builders take ~1/2 their time on the single-threaded recompression (e.g., see CPU usage for dist-android). This isn't a direct problem for our overall CI times, but it does mean that they're using relatively expensive builders -- the 9 minutes of compression cost us $0.576/build. Across tens of short builders that adds up quickly.

CodeBuild is cheaper per-vCPU ($0.0025/vCPU/minute vs. $0.004/vCPU/minute on GHA) and since we're using all available CPUs for recompression we're not wasting 15/16 cores we're paying for as well. We also pay the cost once/day rather than 7 times per day. All-around this just makes more sense. We do pay a 5-15% more for CI artifact storage costs, but that's not a huge concern at this time, storage is cheap.

dist-android-cpu

@Mark-Simulacrum Mark-Simulacrum force-pushed the recompress-xz branch 2 times, most recently from 7797c6e to 6e92fbb Compare April 3, 2023 11:36
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Apr 3, 2023
This is a companion PR to rust-lang/promote-release#58, which moves the
relevant optimal code to rust-lang/promote-release. As mentioned in the
comments of that PR, this is expected to cut CI costs (and time, though
predominantly felt on fast builders) and reduce wasted resources due to
in-practice single-threaded compression not using the full 8+ vCPU
builders we have available.
This adds support for recompressing the .xz tarballs in promote-release,
with a goal of moving rust-lang/rust CI back to producing "balanced"
profile binaries rather than the highly compressed ones currently
produced. This will cut rust-lang/rust CI times while keeping the
production artifacts in static.r-l.o equivalently compressed.

This PR doesn't enable the .xz recompression by default, that will be
done in a follow up simpleinfra push. Depending on the impact to
(especially) stable build times we may wish to bump the promote-release
production container from 8 cores to 72 cores (the next largest
container) so that we still finish in a reasonable amount of time.
Mark-Simulacrum added a commit to rust-lang/simpleinfra that referenced this pull request Apr 3, 2023
This is pending upstream PR
rust-lang/promote-release#58 but is harmless to
land ahead of time.
@the8472
Copy link
Member

the8472 commented Apr 3, 2023

Would it make sense to go further and have CI only build zstd tarballs and do a zstd -> xz conversion only for static.r-l.o?

@Mark-Simulacrum
Copy link
Member Author

Perhaps, but if we stop producing XZ tarballs in CI that'll need a bunch of tools to change (cargo-bisect-rustc, crater, perf, etc.) and so needs additional work in a bunch of places. I suspect that's the right long-term trajectory but I expect this to already be a significant win.

@Mark-Simulacrum Mark-Simulacrum merged commit 88110b0 into rust-lang:master Apr 3, 2023
@Mark-Simulacrum Mark-Simulacrum deleted the recompress-xz branch April 3, 2023 22:01
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 4, 2023
…, r=pietroalbini

Remove optimal xz settings from CI

This is a companion PR to rust-lang/promote-release#58, which moves the relevant optimal code to rust-lang/promote-release. As mentioned in the comments of that PR, this is expected to cut CI costs (and time, though predominantly felt on fast builders) and reduce wasted resources due to in-practice single-threaded compression not using the full 8+ vCPU builders we have available.

This probably shouldn't land before that PR + a simpleinfra change to enable the recompression of xz artifacts. But if it does land, it's just a matter of a few nightlies with slightly larger artifacts, so not a big deal.

r? `@pietroalbini`
oli-obk pushed a commit to oli-obk/miri that referenced this pull request Apr 4, 2023
…oalbini

Remove optimal xz settings from CI

This is a companion PR to rust-lang/promote-release#58, which moves the relevant optimal code to rust-lang/promote-release. As mentioned in the comments of that PR, this is expected to cut CI costs (and time, though predominantly felt on fast builders) and reduce wasted resources due to in-practice single-threaded compression not using the full 8+ vCPU builders we have available.

This probably shouldn't land before that PR + a simpleinfra change to enable the recompression of xz artifacts. But if it does land, it's just a matter of a few nightlies with slightly larger artifacts, so not a big deal.

r? `@pietroalbini`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants