Skip to content

optionally enable ccache for use in Dockerfiles#21563

Open
t-hofmann wants to merge 12 commits into
ggml-org:masterfrom
t-hofmann:resolved-merge-conflict-into-ccache-pull-request
Open

optionally enable ccache for use in Dockerfiles#21563
t-hofmann wants to merge 12 commits into
ggml-org:masterfrom
t-hofmann:resolved-merge-conflict-into-ccache-pull-request

Conversation

@t-hofmann

Copy link
Copy Markdown

Overview

This pull-request addresses #21225, which is about faster recompilation in Dockerfiles by enabling a build cache.

Additional information

The solution introduces a new build-time argument CCACHE_ENABLED (default: false). Which if true leads to installation of ccache in the Dockerfiles.

A cache-mount was added to the actual build step RUN ... make .... The cache will only be used if ccache is installed, so the cache-mount can unconditionally be added there.

In s390x.Dockerfile ccache was already installed and always used, - that behaviour is unchanged. - Would be happy to change if need be.

Only cuda.Dockerfile is manually tested by compiling, starting and accessing the web-interface.

Requirements

@t-hofmann t-hofmann requested a review from ngxson as a code owner April 7, 2026 14:23
@taronaeo

taronaeo commented Apr 7, 2026

Copy link
Copy Markdown
Member

Do you have benchmarks to showcase the speed differences?

@github-actions github-actions Bot added the devops improvements to build systems and github actions label Apr 7, 2026
@t-hofmann

t-hofmann commented Apr 8, 2026

Copy link
Copy Markdown
Author

I did not measure because it is big, on my system a full built to the "server" stage takes most likely between 10 to 15 minutes, while an enabled cache should lead to something well below 1 minute in case of a recompilation.

Fair enough or do you need exact numbers?

@mikhail-shevtsov-wiregate

Copy link
Copy Markdown

@t-hofmann Do I understand correctly that RUN --mount=type=cache,target=/root/.cache/ccache will use github cache? If yes - I think that it's limited to 10GB and it's already full.

One of the option is to leverage docker image inline cache.

@t-hofmann

t-hofmann commented May 30, 2026

Copy link
Copy Markdown
Author

The RUN --mount=type=cache ... is a docker mechanism, therefore that should be the thing you address via "docker image inline cache".

Regarding the "github cache": Neither do I know how github caches in this context nor am I in the position to test if the change influences its usage.

apropos merge below: please be aware, that I am not the author of the one-API related changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops improvements to build systems and github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants