-
Notifications
You must be signed in to change notification settings - Fork 25
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
Reduce size of CI builds #1253
Reduce size of CI builds #1253
Conversation
…lease builds. The debug builds, especially for JCO, took >10 Gb total space.
…he unit tests. This should improve test run times and avoid sporadic failures due to slowness, and make the api generation easier to debug by making it more visible.
…riable `SLANG_INFA_RELEASE` is set. This can save about another GB of storage compared to building infra in debug mode. infra crates will still be built in debug mode by default. There's no significant speedup when building in release mode since infra itself is not doing much.
|
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.
Left a few suggestions/questions.
Move the public_api infra invocation from lint to check
…e `--release` flag as part of `add_rust_buildflags()`.
* Modify script so that CI flag existence doesn't need to be checked/validated before calling `set -u`
… if some debug artifacts are not present. To achieve similar size savings, we'll run cargo clean and delete `target/wasm32-wasip1/debug` at the end of jco setup.
Co-authored-by: Omar Tawfik <[email protected]>
* Remove unnecessary exports from the toolchains::public_api module
The goal of this PR is to reduce the size of our build artifacts in CI to avoid failures due to lack of disk space. This has been a sporadic issue for a while, but it's become unavoidable starting with #1225, which is constantly running out of space. That's because the new version of JCO that it's bringing in is too large. We can build the project in release mode in CI to compensate for this.
I've added some extra logic in
infra_cli
when running cargo commands to append a--release
flag when running in CI (indicated with the environment variableCI
). I also added a new flag to use in theinfra
script (scripts/bin/infra
),SLANG_INFRA_RELEASE
, which will cause the infra crates to be built in release mode too when set. With both of these changes we can get the project size down to ~13 Gb with either version of JCO. This keeps us under the 14 Gb threshold.Built with JCO rev.
d1b3344
(whatmain
points to currently)infra ci
CI=true infra ci
CI=true SLANG_INFRA_RELEASE=true infra ci
Built with JCO rev
b7818f3
(new rev that will come in once #1225 is complete)infra ci
CI=true infra ci
CI=true SLANG_INFRA_RELEASE=true infra ci
I've also moved the generation of
public_api.txt
out of the unit tests and in to a new step,infra lint public-api
. I choseinfra lint
because this is where the rustdocs are currently generated. This makes the api docs generation a bit more visible and therefore easier to debug, and also helps with unit test execution times.Generating these docs causes debug artifacts to be generated - 1.2 Gb worth, by my measurements. We might be able to reduce the overall project size further by building this in release mode too, however the crate we call which runs
cargo
to generate these does not provide an API to do so. I believe that we could remove this crate entirely and generate the rustdoc json file ourselves, but it didn't seem necessary here and is outside the pure scope of this change so I left it as-is for now.