Skip to content
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

Speed up CI using compiler cache #78

Closed
wants to merge 7 commits into from
Closed

Conversation

nahueespinosa
Copy link
Member

Experiment...

@nahueespinosa nahueespinosa added enhancement New feature or request infra Related to infrastructure and CI labels Jan 22, 2023
@nahueespinosa nahueespinosa self-assigned this Jan 22, 2023
@nahueespinosa
Copy link
Member Author

Cache stats:

14.29% hits is unexpectedly low 🤔.

Cache directory:                  /__w/beluga/beluga/.ccache
    Primary config:                   /github/home/.config/ccache/ccache.conf
    Secondary config:                 /etc/ccache.conf
    Stats updated:                    Sun Jan 22 14:31:09 2023
    Stats zeroed:                     Sun Jan 22 14:28:32 2023
    Hits:                                3 /   21 (14.29 %)
      Direct:                            3 /   21 (14.29 %)
      Preprocessed:                      0 /   18 (0.00 %)
    Misses:                             18
      Direct:                           18
      Preprocessed:                     18
    Errors:                              0
    Uncacheable:                         0
  Primary storage:
    Hits:                                6 /   42 (14.29 %)
    Misses:                             36
    Cache size (GB):                  0.02 / 0.50 (4.56 %)
    Files:                             150
  Secondary storage:
    Hits:                                0 /    0 (0.00 %)
    Misses:                              0
    Errors:                              0
    Timeouts:                            0
  Errors:
    Compiler check failed:               0
    Could not find compiler:             0
    Could not write to output file:      0
    Error hashing extra file:            0
    Internal error:                      0
    Missing cache file:                  0
  Uncacheable:
    Autoconf compile/link:               0
    Bad compiler arguments:              0
    Called for linking:                  0
    Called for preprocessing:            0
    Compilation failed:                  0
    Compiler produced empty output:      0
    Compiler produced no output:         0
    Compiler produced stdout:            0
    Could not use modules:               0
    Could not use precompiled header:    0
    Forced recache:                      0
    Multiple source files:               0
    No input file:                       0
    Output to stdout:                    0
    Preprocessing failed:                0
    Unsupported code directive:          0
    Unsupported compiler option:         0
    Unsupported source language:         0

@glpuga
Copy link
Collaborator

glpuga commented Jan 22, 2023

Cache stats:

14.29% hits is unexpectedly low thinking.

And yet the cache size seems to grow on every run, it's like it fails to match build calls across different jobs.

Maybe the path where the process files are being stored on every run is different; if that's the case this may be related: https://github.com/ccache/ccache/blob/master/doc/MANUAL.adoc#compiling-in-different-directories

@nahueespinosa nahueespinosa force-pushed the nahuel/ccache_ci branch 8 times, most recently from f5ac6de to 62f614e Compare January 23, 2023 19:31
@nahueespinosa
Copy link
Member Author

The reason we're getting so many cache misses is that ros-tooling/action-ros-ci performs a checkout of the repository under test inside a subdirectory with a random string prefix.

I think I can hack my way around it, but that's really inconvenient.

@nahueespinosa nahueespinosa force-pushed the nahuel/ccache_ci branch 2 times, most recently from 21867ba to fddaeac Compare January 24, 2023 01:40
@nahueespinosa nahueespinosa added the help wanted Extra attention is needed label Jan 26, 2023
@nahueespinosa nahueespinosa changed the title [WIP] Speed up CI using compiler cache Speed up CI using compiler cache Jan 26, 2023
@nahueespinosa nahueespinosa added the do-not-land Do not merge these changes into the main branch label Jan 27, 2023
@nahueespinosa nahueespinosa removed their assignment Jan 27, 2023
@nahueespinosa
Copy link
Member Author

Removing my assignment. I couldn't make ccache work with ros-tooling/action-ros-ci.

Leaving this PR open in case someone wants to take a look. But IMO, the more direct approach would be to replace the external action with colcon commands in the CI pipeline.

@glpuga
Copy link
Collaborator

glpuga commented Jan 28, 2023

Indeed, action-ros-ci does not seem to be compatible with ccache due to the path randomization it uses.

An alternative is to user industrial_ci, which does support ccache out of the box. It does not support colcon mixins, though, so the coverage arguments would have to be added as straight out CMAKE_ARGS.

I'm not totally sure it's worth it at the current scale of the repo.

@nahueespinosa nahueespinosa deleted the nahuel/ccache_ci branch February 9, 2023 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-land Do not merge these changes into the main branch enhancement New feature or request help wanted Extra attention is needed infra Related to infrastructure and CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants