Skip to content

Commit b516521

Browse files
committed
Add docker devenv
1 parent e0d3305 commit b516521

File tree

4 files changed

+117
-2
lines changed

4 files changed

+117
-2
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Licensed under the Apache License, Version 2.0 (the "License");
2+
# you may not use this file except in compliance with the License.
3+
# You may obtain a copy of the License at
4+
#
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
#
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS,
9+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
# See the License for the specific language governing permissions and
11+
# limitations under the License.
12+
services:
13+
ubuntu-dev:
14+
# Usage:
15+
# docker compose build ubuntu-dev
16+
# podman compose build ubuntu-dev
17+
image: presto/prestissimo-dev:ubuntu-22.04
18+
build:
19+
args:
20+
# A few files in Velox require significant memory to compile and link.
21+
# Build requires 18GB of memory for 2 threads.
22+
- NUM_THREADS=2 # default value for NUM_THREADS.
23+
- DEPENDENCY_IMAGE=presto/prestissimo-dependency:ubuntu-22.04
24+
- BASE_IMAGE=ubuntu:22.04
25+
- OSNAME=ubuntu
26+
- EXTRA_CMAKE_FLAGS=-DPRESTO_ENABLE_TESTING=ON
27+
-DPRESTO_ENABLE_PARQUET=ON
28+
-DPRESTO_ENABLE_S3=ON
29+
-DPRESTO_ENABLE_REMOTE_FUNCTIONS=ON
30+
-DPRESTO_ENABLE_JWT=ON
31+
-DPRESTO_STATS_REPORTER_TYPE=PROMETHEUS
32+
-DPRESTO_MEMORY_CHECKER_TYPE=LINUX_MEMORY_CHECKER
33+
-DPRESTO_ENABLE_SPATIAL=ON
34+
context: .
35+
dockerfile: scripts/dockerfiles/prestissimo-dev.dockerfile
36+
stdin_open: true
37+
tty: true
38+
volumes:
39+
- ..:/presto
40+
working_dir: /presto/presto-native-execution
41+
command: bash
42+
43+
centos-dev:
44+
# Usage:
45+
# docker compose build centos-dev
46+
# podman compose build centos-dev
47+
image: presto/prestissimo-dev:centos9
48+
build:
49+
args:
50+
# A few files in Velox require significant memory to compile and link.
51+
# Build requires 18GB of memory for 2 threads.
52+
- NUM_THREADS=2 # default value for NUM_THREADS.
53+
- DEPENDENCY_IMAGE=presto/prestissimo-dependency:centos9
54+
- EXTRA_CMAKE_FLAGS=-DPRESTO_ENABLE_TESTING=ON
55+
-DPRESTO_ENABLE_PARQUET=ON
56+
-DPRESTO_ENABLE_S3=ON
57+
-DPRESTO_ENABLE_REMOTE_FUNCTIONS=ON
58+
-DPRESTO_ENABLE_JWT=ON
59+
-DPRESTO_STATS_REPORTER_TYPE=PROMETHEUS
60+
-DPRESTO_MEMORY_CHECKER_TYPE=LINUX_MEMORY_CHECKER
61+
-DPRESTO_ENABLE_SPATIAL=ON
62+
context: .
63+
dockerfile: scripts/dockerfiles/prestissimo-dev.dockerfile
64+
stdin_open: true
65+
tty: true
66+
volumes:
67+
- ..:/presto
68+
working_dir: /presto/presto-native-execution
69+
command: bash
70+

presto-native-execution/scripts/dockerfiles/centos-dependency.dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ COPY velox/CMake/resolve_dependency_modules/arrow/cmake-compatibility.patch /vel
2525
ENV VELOX_ARROW_CMAKE_PATCH=/velox/cmake-compatibility.patch
2626
RUN bash -c "mkdir build && \
2727
(cd build && ../scripts/setup-centos.sh && \
28-
../velox/scripts/setup-centos9.sh install_adapters && \
28+
../velox/scripts/setup-centos-adapters.sh install_adapters && \
2929
../scripts/setup-adapters.sh && \
30-
source ../velox/scripts/setup-centos9.sh && \
30+
source ../velox/scripts/setup-centos-adapters.sh && \
3131
install_clang15 && \
3232
install_cuda 12.8) && \
3333
rm -rf build"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Licensed under the Apache License, Version 2.0 (the "License");
2+
# you may not use this file except in compliance with the License.
3+
# You may obtain a copy of the License at
4+
#
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
#
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS,
9+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
# See the License for the specific language governing permissions and
11+
# limitations under the License.
12+
13+
ARG DEPENDENCY_IMAGE=presto/prestissimo-dependency:centos9
14+
ARG BASE_IMAGE=quay.io/centos/centos:stream9
15+
FROM ${DEPENDENCY_IMAGE} as prestissimo-image
16+
17+
ARG OSNAME=centos
18+
ARG EXTRA_CMAKE_FLAGS=''
19+
ARG NUM_THREADS=8
20+
ARG BUILD_ROOT=/presto/presto-native-execution
21+
22+
ENV PROMPT_ALWAYS_RESPOND=n
23+
ENV BUILD_BASE_DIR=_build
24+
ENV LANG=C.UTF-8
25+
ENV EXTRA_CMAKE_FLAGS=${EXTRA_CMAKE_FLAGS}
26+
27+
RUN --mount=type=bind,source=.,target=${BUILD_ROOT},readonly=false \
28+
--mount=type=cache,target=/root/ccache-${OSNAME} \
29+
export CCACHE_DIR=/root/ccache-${OSNAME} && \
30+
cd ${BUILD_ROOT} && \
31+
EXTRA_CMAKE_FLAGS=${EXTRA_CMAKE_FLAGS} NUM_THREADS=${NUM_THREADS} \
32+
make --directory="${BUILD_ROOT}" cmake-and-build BUILD_TYPE=Release BUILD_DIR=release BUILD_BASE_DIR=${BUILD_BASE_DIR} && \
33+
EXTRA_CMAKE_FLAGS=${EXTRA_CMAKE_FLAGS} NUM_THREADS=${NUM_THREADS} \
34+
make --directory="${BUILD_ROOT}" cmake-and-build BUILD_TYPE=Debug BUILD_DIR=debug BUILD_BASE_DIR=${BUILD_BASE_DIR} && \
35+
make clean && \
36+
cd /root && cp -r ${CCACHE_DIR} .ccache && \
37+
ccache -sz -v && \
38+
echo "[safe]" > /root/.gitconfig && \
39+
echo " directory = $(dirname $BUILD_ROOT)" >> /root/.gitconfig && \
40+
echo " directory = ${BUILD_ROOT}/velox" >> /root/.gitconfig && \
41+
cat /root/.gitconfig

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

Lines changed: 4 additions & 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
@@ -37,3 +38,6 @@ RUN mkdir build && \
3738
../velox/scripts/setup-ubuntu.sh install_adapters && \
3839
../scripts/setup-adapters.sh ) && \
3940
rm -rf build
41+
42+
ENV PKG_INSTALL="apt install -y" \
43+
PKG_UPDATE="apt update"

0 commit comments

Comments
 (0)