2024-05-18 14:39:56 +00:00
# docker build -t clickhouse/fasttest .
2021-12-24 15:10:06 +00:00
ARG FROM_TAG = latest
FROM clickhouse/test-util:$FROM_TAG
2020-07-08 13:06:35 +00:00
2020-08-25 03:11:01 +00:00
RUN apt-get update \
&& apt-get install \
brotli \
2024-02-16 15:52:15 +00:00
clang-${ LLVM_VERSION } \
clang-tidy-${ LLVM_VERSION } \
cmake \
2020-08-25 03:11:01 +00:00
expect \
2022-07-29 12:31:53 +00:00
file \
2024-02-16 15:52:15 +00:00
libclang-${ LLVM_VERSION } -dev \
libclang-rt-${ LLVM_VERSION } -dev \
lld-${ LLVM_VERSION } \
llvm-${ LLVM_VERSION } -dev \
2021-04-01 20:28:53 +00:00
lsof \
2024-02-16 15:52:15 +00:00
ninja-build \
2023-06-19 16:49:54 +00:00
odbcinst \
2020-08-25 03:11:01 +00:00
psmisc \
2020-10-02 16:54:07 +00:00
python3 \
2021-04-01 20:28:53 +00:00
python3-pip \
2020-08-25 03:11:01 +00:00
unixodbc \
2022-08-11 01:29:46 +00:00
pv \
2023-09-10 21:11:24 +00:00
jq \
2023-01-04 02:24:26 +00:00
zstd \
2024-01-29 13:00:22 +00:00
--yes --no-install-recommends \
&& apt-get clean \
2024-07-17 00:13:57 +00:00
&& rm -rf /var/lib/apt/lists/* /var/cache/debconf /tmp/* \
&& groupadd --system --gid 1000 clickhouse \
2024-07-17 01:52:35 +00:00
&& useradd --system --gid 1000 --uid 1000 -m clickhouse
2024-07-17 00:13:57 +00:00
# ^ For some reason, groupadd and useradd are needed for tests with 'expect', but I don't know, why.
2020-07-08 13:06:35 +00:00
2024-07-03 19:58:18 +00:00
COPY requirements.txt /
RUN pip3 install --no-cache-dir -r /requirements.txt
2020-10-15 19:54:17 +00:00
2024-02-16 15:52:15 +00:00
# This symlink is required by gcc to find the lld linker
RUN ln -s /usr/bin/lld-${ LLVM_VERSION } /usr/bin/ld.lld
# FIXME: workaround for "The imported target "merge-fdata" references the file" error
# https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/commit/992e52c0b156a5ba9c6a8a54f8c4857ddd3d371d
RUN sed -i '/_IMPORT_CHECK_FILES_FOR_\(mlir-\|llvm-bolt\|merge-fdata\|MLIR\)/ {s|^|#|}' /usr/lib/llvm-${ LLVM_VERSION } /lib/cmake/llvm/LLVMExports-*.cmake
2024-07-04 15:16:25 +00:00
2024-07-04 13:30:27 +00:00
# LLVM changes paths for compiler-rt libraries. For some reason clang-18.1.8 cannot catch up libraries from default install path.
2024-07-05 10:18:18 +00:00
# It's very dirty workaround, better to build compiler and LLVM ourself and use it. Details: https://github.com/llvm/llvm-project/issues/95792
2024-07-05 14:31:00 +00:00
RUN test ! -d /usr/lib/llvm-18/lib/clang/18/lib/x86_64-pc-linux-gnu || ln -s /usr/lib/llvm-18/lib/clang/18/lib/x86_64-pc-linux-gnu /usr/lib/llvm-18/lib/clang/18/lib/x86_64-unknown-linux-gnu
2024-02-16 15:52:15 +00:00
ARG CCACHE_VERSION = 4 .6.1
RUN mkdir /tmp/ccache \
&& cd /tmp/ccache \
&& curl -L \
-O https://github.com/ccache/ccache/releases/download/v$CCACHE_VERSION /ccache-$CCACHE_VERSION .tar.xz \
-O https://github.com/ccache/ccache/releases/download/v$CCACHE_VERSION /ccache-$CCACHE_VERSION .tar.xz.asc \
&& gpg --recv-keys --keyserver hkps://keyserver.ubuntu.com 5A939A71A46792CF57866A51996DDA075594ADB8 \
&& gpg --verify ccache-4.6.1.tar.xz.asc \
&& tar xf ccache-$CCACHE_VERSION .tar.xz \
&& cd /tmp/ccache/ccache-$CCACHE_VERSION \
&& cmake -DCMAKE_INSTALL_PREFIX= /usr \
-DCMAKE_BUILD_TYPE= None \
-DZSTD_FROM_INTERNET= ON \
-DREDIS_STORAGE_BACKEND= OFF \
-Wno-dev \
-B build \
-S . \
&& make VERBOSE = 1 -C build \
&& make install -C build \
&& cd / \
&& rm -rf /tmp/ccache
ARG TARGETARCH
ARG SCCACHE_VERSION = v0.7.7
ENV SCCACHE_IGNORE_SERVER_IO_ERROR = 1
# sccache requires a value for the region. So by default we use The Default Region
ENV SCCACHE_REGION = us-east-1
RUN arch = ${ TARGETARCH :- amd64 } \
&& case $arch in \
amd64) rarch = x86_64 ; ; \
arm64) rarch = aarch64 ; ; \
esac \
&& curl -Ls " https://github.com/mozilla/sccache/releases/download/ $SCCACHE_VERSION /sccache- $SCCACHE_VERSION - $rarch -unknown-linux-musl.tar.gz " | \
tar xz -C /tmp \
&& mv " /tmp/sccache- $SCCACHE_VERSION - $rarch -unknown-linux-musl/sccache " /usr/bin \
&& rm " /tmp/sccache- $SCCACHE_VERSION - $rarch -unknown-linux-musl " -r
2024-01-29 13:04:48 +00:00
# Give suid to gdb to grant it attach permissions
2023-09-20 17:07:42 +00:00
# chmod 777 to make the container user independent
2024-01-29 13:04:48 +00:00
RUN chmod u+s /usr/bin/gdb \
&& mkdir -p /var/lib/clickhouse \
&& chmod 777 /var/lib/clickhouse
2020-07-08 13:06:35 +00:00
2023-07-30 03:18:52 +00:00
ENV TZ = Europe/Amsterdam
2020-07-08 13:06:35 +00:00
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
2020-08-25 03:11:01 +00:00
ENV COMMIT_SHA = ''
ENV PULL_REQUEST_NUMBER = ''
2020-10-26 11:08:37 +00:00
ENV COPY_CLICKHOUSE_BINARY_TO_OUTPUT = 0
2020-07-08 13:06:35 +00:00
COPY run.sh /
CMD [ "/bin/bash" , "/run.sh" ]