jobs: Optimize rust compilation steps
Use cargo cache and do not compile in release mode for swh-environment
jobs.
Setup use of sccache in Jenkins production instance in every steps compiling rust code.
Merge request reports
Activity
Jenkins job jenkins-tools/swh-jenkins-jobs-builder #433 succeeded in 7.9 sec.
See Console Output, Blue Ocean and Coverage Report for more details.In addition to
prepare-cargo-cache
(which only gives us a cache for the crates code), this should populate the sccache-related environment variables to get caching for the compiled crates:CARGO_WRAPPER=sccache
,CARGO_INCREMENTAL=false
and pullingSCCACHE_REDIS_{ENDPOINT,PASSWORD}
from the jenkins credentials store.I'm not sure what dropping
--release
achieves but it feels a bit wrong.In addition to
prepare-cargo-cache
(which only gives us a cache for the crates code), this should populate the sccache-related environment variables to get caching for the compiled crates:Ack, I thought both achieved the same.
I'm not sure what dropping
--release
achieves but it feels a bit wrong.It disables rust compiler optimizations which decreases compilation time and CPU usage significantly. That pipeline only run code quality checks and Python tests so we do not need rust release builds (but we still need compiled binaries for the swh-graph Python tests).
Edited by Antoine LambertCARGO_WRAPPER=sccache
Should not it be
RUSTC_WRAPPER
as explained in sccache README ? There is no reference toCARGO_WRAPPER
in rust documentation.
Jenkins job jenkins-tools/swh-jenkins-jobs-builder #434 succeeded in 6.5 sec.
See Console Output, Blue Ocean and Coverage Report for more details.I tested in our Jenkins production instance by hacking on the jobs configuration and it seems to work fine, see https://jenkins.softwareheritage.org/blue/organizations/jenkins/DGRPH%2Fgitlab-builds/detail/gitlab-builds/2255/pipeline/23 for instance.
while I am on it: swh-jenkins-dockerfiles!75 (merged)