Skip to content

Commit 3a4a058

Browse files
committed
Add ccache to dependency image
1 parent 58df37d commit 3a4a058

File tree

3 files changed

+50
-2
lines changed

3 files changed

+50
-2
lines changed

presto-native-execution/docker-compose.yml

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,26 @@ services:
1919
context: .
2020
dockerfile: scripts/dockerfiles/ubuntu-22.04-dependency.dockerfile
2121

22+
ubuntu-native-ccache:
23+
# Usage:
24+
# docker compose build ubuntu-native-ccache
25+
# podman compose build ubuntu-native-ccache
26+
image: presto/prestissimo-dependency:ubuntu-22.04
27+
build:
28+
args:
29+
# A few files in Velox require significant memory to compile and link.
30+
# Build requires 18GB of memory for 2 threads.
31+
- NUM_THREADS=2 # default value for NUM_THREADS.
32+
- DEPENDENCY_IMAGE=presto/prestissimo-dependency:ubuntu-22.04
33+
- BASE_IMAGE=ubuntu:22.04
34+
- OSNAME=ubuntu
35+
- EXTRA_CMAKE_FLAGS=-DPRESTO_ENABLE_TESTING=OFF
36+
-DPRESTO_ENABLE_PARQUET=ON
37+
-DPRESTO_ENABLE_S3=ON
38+
context: .
39+
dockerfile: scripts/dockerfiles/prestissimo-runtime.dockerfile
40+
target: prestissimo-ccache
41+
2242
ubuntu-native-runtime:
2343
# Usage:
2444
# docker compose build ubuntu-native-runtime
@@ -47,6 +67,23 @@ services:
4767
context: .
4868
dockerfile: scripts/dockerfiles/centos-dependency.dockerfile
4969

70+
centos-native-ccache:
71+
# Usage:
72+
# docker compose build centos-native-ccache
73+
# podman compose build centos-native-ccache
74+
image: presto/prestissimo-dependency:centos9
75+
build:
76+
args:
77+
# A few files in Velox require significant memory to compile and link.
78+
# Build requires 18GB of memory for 2 threads.
79+
- NUM_THREADS=2 # default value for NUM_THREADS
80+
- EXTRA_CMAKE_FLAGS=-DPRESTO_ENABLE_TESTING=OFF
81+
-DPRESTO_ENABLE_PARQUET=ON
82+
-DPRESTO_ENABLE_S3=ON
83+
context: .
84+
dockerfile: scripts/dockerfiles/prestissimo-runtime.dockerfile
85+
target: prestissimo-ccache
86+
5087
centos-native-runtime:
5188
# Usage:
5289
# docker compose build centos-native-runtime
@@ -61,4 +98,4 @@ services:
6198
-DPRESTO_ENABLE_PARQUET=ON
6299
-DPRESTO_ENABLE_S3=ON
63100
context: .
64-
dockerfile: scripts/dockerfiles/prestissimo-runtime.dockerfile
101+
dockerfile: scripts/dockerfiles/prestissimo-runtime.dockerfile

presto-native-execution/scripts/dockerfiles/prestissimo-runtime.dockerfile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,20 @@ ENV BUILD_DIR=""
2626
RUN mkdir -p /prestissimo /runtime-libraries
2727
COPY . /prestissimo/
2828
RUN EXTRA_CMAKE_FLAGS=${EXTRA_CMAKE_FLAGS} \
29-
NUM_THREADS=${NUM_THREADS} make --directory="/prestissimo/" cmake-and-build BUILD_TYPE=${BUILD_TYPE} BUILD_DIR=${BUILD_DIR} BUILD_BASE_DIR=${BUILD_BASE_DIR}
29+
NUM_THREADS=${NUM_THREADS} make --directory="/prestissimo/" cmake-and-build BUILD_TYPE=${BUILD_TYPE} BUILD_DIR=${BUILD_DIR} BUILD_BASE_DIR=${BUILD_BASE_DIR} && \
30+
ccache -sz -v
3031
RUN !(LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib:/usr/local/lib64 ldd /prestissimo/${BUILD_BASE_DIR}/${BUILD_DIR}/presto_cpp/main/presto_server | grep "not found") && \
3132
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib:/usr/local/lib64 ldd /prestissimo/${BUILD_BASE_DIR}/${BUILD_DIR}/presto_cpp/main/presto_server | awk 'NF == 4 { system("cp " $3 " /runtime-libraries") }'
3233

34+
#/////////////////////////////////////////////
35+
# prestissimo-ccache
36+
#//////////////////////////////////////////////
37+
38+
FROM ${DEPENDENCY_IMAGE} as prestissimo-ccache
39+
40+
COPY --from=prestissimo-image /root/.cache/ccache /root/.cache/ccache
41+
RUN ccache -sz -v
42+
3343
#/////////////////////////////////////////////
3444
# prestissimo-runtime
3545
#//////////////////////////////////////////////

presto-native-execution/scripts/dockerfiles/ubuntu-22.04-dependency.dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ ENV SUDO=" "
2222
# are required to avoid tzdata installation
2323
# to prompt for region selection.
2424
ENV TZ=${tz}
25+
ENV LDFLAGS="-no-pie"
2526

2627
RUN mkdir -p /scripts /velox/scripts
2728
COPY scripts /scripts

0 commit comments

Comments
 (0)