Skip to content

Commit 42b33d2

Browse files
authored
Enable remote cache if applicable (#423)
* Update configuration to support CCACHE_REMOTE_STORAGE * Remove redundant configuration * Fix 'ccache' installation issue * Use remote cache if applicable * fix trailing whitespaces
1 parent d1fa551 commit 42b33d2

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ if(TRITON_FIL_DOCKER_BUILD)
4040
OUTPUT fil/libtriton_fil.so $<$<BOOL:${TRITON_ENABLE_GPU}>:fil/libcuml++.so>
4141
COMMAND DOCKER_BUILDKIT=1 docker build -t
4242
triton_fil_builder
43+
$<$<BOOL:$ENV{CCACHE_REMOTE_STORAGE}>:--build-arg>
44+
$<$<BOOL:$ENV{CCACHE_REMOTE_STORAGE}>:CCACHE_REMOTE_STORAGE=$ENV{CCACHE_REMOTE_STORAGE}>
4345
--build-arg BUILD_TYPE=${CMAKE_BUILD_TYPE}
4446
--build-arg TRITON_VERSION=${TRITON_BUILD_CONTAINER_VERSION}
4547
--build-arg BASE_IMAGE=${TRITON_BUILD_CONTAINER}

ops/Dockerfile

+9-2
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,15 @@ RUN source /conda/dev/bin/activate \
181181

182182
ENV CCACHE_DIR=/ccache
183183

184-
RUN --mount=type=cache,target=/ccache/ source /conda/dev/bin/activate && ninja install
185-
184+
ARG CCACHE_REMOTE_STORAGE
185+
186+
RUN --mount=type=cache,target=/ccache/ source /conda/dev/bin/activate && \
187+
if [ -n "${CCACHE_REMOTE_STORAGE}" ] && which ccache ; then \
188+
ccache --set-config=remote_only=true ; \
189+
ccache --set-config=remote_storage=${CCACHE_REMOTE_STORAGE} ; \
190+
ccache -p ; \
191+
fi && \
192+
ninja install
186193

187194
# Stage for generating testing image
188195
FROM ${SERVER_IMAGE} as test-host-0

0 commit comments

Comments
 (0)