Skip to content

Enable remote cache if applicable #297

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

Merged
merged 6 commits into from
Mar 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions tools/gen_ort_dockerfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,22 @@ def dockerfile_for_linux(output_file):
RUN pip3 install patchelf==0.17.2
"""
else:
if os.getenv("CCACHE_REMOTE_ONLY") and os.getenv("CCACHE_REMOTE_STORAGE"):
df += """
ENV CCACHE_REMOTE_ONLY="true" \\
CCACHE_REMOTE_STORAGE="{}" \\
CMAKE_CXX_COMPILER_LAUNCHER="ccache" \\
CMAKE_C_COMPILER_LAUNCHER="ccache" \\
CMAKE_CUDA_COMPILER_LAUNCHER="ccache" \\
VERBOSE=1

RUN apt-get update \\
&& apt-get install -y --no-install-recommends ccache && ccache -p \\
&& rm -rf /var/lib/apt/lists/*
""".format(
os.getenv("CCACHE_REMOTE_STORAGE")
)

df += """

RUN apt-get update && apt-get install -y --no-install-recommends \
Expand Down
Loading