chore(common): add CI Cargo profile for faster test builds#1730
Closed
chore(common): add CI Cargo profile for faster test builds#1730
Conversation
Add a [profile.ci] Cargo profile with thin LTO and more codegen units
to reduce link times for CI/test builds without affecting production
release builds.
Changes:
- Add [profile.ci] to coprocessor/fhevm-engine/Cargo.toml
- Add [profile.ci] and [profile.release] to kms-connector/Cargo.toml
- Add CARGO_PROFILE ARG to all Rust Dockerfiles (defaults to 'release')
- Update COPY paths to use ${CARGO_PROFILE} for dynamic output dirs
- Add CARGO_PROFILE args to coprocessor and kms-connector docker-compose
Usage:
CARGO_PROFILE=ci ./fhevm-cli deploy --build
Closes #839
Contributor
Author
Follow-up: Enable CI profile in automated buildsThis PR adds the Required change to
|
Update CI profile settings for faster builds: - opt-level=2 (vs 3): less aggressive optimization passes - lto=false (vs thin): eliminates LTO linking phase entirely - codegen-units=16: parallel codegen (unchanged)
Revert the addition of explicit release profile with lto=fat. kms-connector should keep using Cargo defaults for release builds.
🧪 CI InsightsHere's what we observed from your CI run for d710989. 🟢 All jobs passed!But CI Insights is watching 👀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a
[profile.ci]Cargo profile with optimized settings for CI/test builds to reduce build times without affecting production releases.Closes #839
Changes
[profile.ci]section tocoprocessor/fhevm-engine/Cargo.toml[profile.ci]and[profile.release]sections tokms-connector/Cargo.tomlCARGO_PROFILEbuild arg to all Rust Dockerfiles (11 files)COPYstatements to use${CARGO_PROFILE}for dynamic output directoriesCARGO_PROFILEargs tocoprocessor-docker-compose.ymlandkms-connector-docker-compose.ymlCI Profile Settings
Expected Build Time Improvements
opt-level32lto"fat"falsecodegen-units116The trade-off is slightly larger binary size and marginally slower runtime performance, which is acceptable for CI/test builds.
Usage
Testing
cargo check --profile ciworks for both workspacesreleasewhen no arg passed)Files Modified (15)
Cargo.toml files (2):
coprocessor/fhevm-engine/Cargo.tomlkms-connector/Cargo.tomlCoprocessor Dockerfiles (7):
coprocessor/fhevm-engine/tfhe-worker/Dockerfilecoprocessor/fhevm-engine/zkproof-worker/Dockerfilecoprocessor/fhevm-engine/transaction-sender/Dockerfilecoprocessor/fhevm-engine/sns-worker/Dockerfilecoprocessor/fhevm-engine/host-listener/Dockerfilecoprocessor/fhevm-engine/gw-listener/Dockerfilecoprocessor/fhevm-engine/stress-test-generator/DockerfileKMS Connector Dockerfiles (3):
kms-connector/crates/tx-sender/Dockerfilekms-connector/crates/kms-worker/Dockerfilekms-connector/crates/gw-listener/DockerfileTest Suite (1):
test-suite/gateway-stress/DockerfileDocker Compose (2):
test-suite/fhevm/docker-compose/coprocessor-docker-compose.ymltest-suite/fhevm/docker-compose/kms-connector-docker-compose.yml