[CI] Enable sccache in docker build and publish ci job
Issue summary
Since we have switched sccache backend to DO space, we can enable sccache in build stage with below changes
- [ ] Implement a build arg flag (e.g. SCCACHE_ENABLED=true) for enabling
sccache - [ ] Set
RUSTC_WRAPPER=sccachewhen the flag above is on - [ ] Download and install proper prebuilt
sccachebinaries foramd64-linuxandarm64-linuxrespectively - [ ] Pass
sccaches3env args via build arg
To convert build arg to env var
ARG SCCACHE_ENDPOINT
ENV SCCACHE_ENDPOINT=$SCCACHE_ENDPOINT
To disable/enable sccache
ARG SCCACHE_ENABLED
# https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html
ENV RUSTC_WRAPPER=${SCCACHE_ENABLED:+sccache}
Other information and links
@hanabi1224 Is it the same as https://github.com/ChainSafe/forest/issues/2519? If so, let's close one of them.
This one seems to be easier to impl than using action, closed the other one
@hanabi1224 This is done, right?
@hanabi1224 bump
@lemmih @LesnyRumcajs No I don't think we have enabled sccache in docker build. I can prioritize this task
Do we need it? I mean, is there a compelling reason to have this? What time gains are we talking about?
@LesnyRumcajs I think the major benefit is that, we could save some $ by switching from buildjet to GH hosted runners
If it's feasible, then it's all good for me!
@hanabi1224 Do we plan to do it?
@LesnyRumcajs I believe this has been implemented in https://github.com/ChainSafe/forest/pull/3510 but superseded by the buildjet to fuzzy switch.
We're not running this on fuzzy anymore, given it introduced some nasty race conditions.
If this task had been easy, it would already have been done. Closing as our time is worth more than what we spend on buildjet.