Skip to content

Commit 8b14d41

Browse files
committed
[infra] Install ccache to docker images
This commit Installs ccache package and configure 1.5GB cache size in Docker images to improve build performance. ONE-DCO-1.0-Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
1 parent 2d9bdce commit 8b14d41

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

.github/workflows/build-dev-docker.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ jobs:
6161
env:
6262
DOCKER_IMAGE_NAME: one-test
6363
run: |
64+
./nnas docker-run --user ccache -p
6465
./nnas docker-run --user make -f Makefile.template
6566
./nnas docker-run --user Product/out/test/onert-test unittest
6667

infra/docker/focal/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ FROM ubuntu:20.04
1818
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qqy install tzdata
1919

2020
# Build tool
21-
RUN apt-get update && apt-get -qqy install build-essential cmake scons git lcov g++-arm-linux-gnueabihf g++-aarch64-linux-gnu pkg-config
21+
RUN apt-get update && apt-get -qqy install build-essential cmake scons git lcov g++-arm-linux-gnueabihf g++-aarch64-linux-gnu pkg-config ccache
2222

2323
# Debian build tool
2424
RUN apt-get update && apt-get -qqy install fakeroot devscripts debhelper python3-all dh-python
@@ -36,6 +36,9 @@ RUN apt-get update && \
3636
RUN python3 -m pip install --upgrade pip
3737
RUN python3 -m pip install numpy flatbuffers
3838

39+
# Setup ccache max size: 1.5GB, cache dir: /tmp/ccache
40+
RUN ccache -M 1536MB && ccache -o cache_dir=/tmp/ccache && ccache -p
41+
3942
# Install libtsan_preinit.o manually (workaround for missing package in focal)
4043
WORKDIR /root/tmp
4144
RUN apt-get download libgcc-10-dev

infra/docker/jammy/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ FROM ubuntu:jammy
1818
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qqy install tzdata
1919

2020
# Build tool
21-
RUN apt-get update && apt-get -qqy install build-essential cmake scons git lcov g++-arm-linux-gnueabihf g++-aarch64-linux-gnu pkg-config
21+
RUN apt-get update && apt-get -qqy install build-essential cmake scons git lcov g++-arm-linux-gnueabihf g++-aarch64-linux-gnu pkg-config ccache
2222

2323
# Debian build tool
2424
RUN apt-get update && apt-get -qqy install fakeroot devscripts debhelper python3-all dh-python
@@ -36,6 +36,9 @@ RUN apt-get update && \
3636
RUN python3 -m pip install --upgrade pip
3737
RUN python3 -m pip install numpy flatbuffers
3838

39+
# Setup ccache max size: 1.5GB, cache dir: /tmp/ccache
40+
RUN ccache -M 1536MB && ccache -o cache_dir=/tmp/ccache && ccache -p
41+
3942
# Setup user to match host user, and give superuser permissions
4043
ARG USER_ID=1000
4144
ARG GROUP_ID=${USER_ID}

infra/docker/noble/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ FROM ubuntu:noble
1818
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qqy install tzdata
1919

2020
# Build tool
21-
RUN apt-get update && apt-get -qqy install build-essential cmake scons git lcov g++-arm-linux-gnueabihf g++-aarch64-linux-gnu pkg-config
21+
RUN apt-get update && apt-get -qqy install build-essential cmake scons git lcov g++-arm-linux-gnueabihf g++-aarch64-linux-gnu pkg-config ccache
2222

2323
# Debian build tool
2424
RUN apt-get update && apt-get -qqy install fakeroot devscripts debhelper python3-all dh-python
@@ -31,6 +31,9 @@ RUN apt-get update && \
3131
apt-get -qqy install doxygen graphviz wget zip unzip python3 python3-pip python3-venv python3-dev hdf5-tools curl
3232
RUN python3 -m pip install numpy flatbuffers --break-system-packages
3333

34+
# Setup ccache max size: 1.5GB, cache dir: /tmp/ccache
35+
RUN ccache -M 1536MB && ccache -o cache_dir=/tmp/ccache && ccache -p
36+
3437
# Setup user ubuntu: give superuser permissions without password
3538
RUN apt-get update && apt-get -qqy install sudo
3639
RUN usermod -aG sudo ubuntu

0 commit comments

Comments
 (0)