mirror of
https://github.com/hanzoai/datastore.git
synced 2026-09-26 13:55:07 +00:00
The fork already renamed its internals - the built binary is datastore, the packages are datastore-server and friends, and the shipped config.xml already says Datastore - but the surfaces a human reads still said ClickHouse. Issue templates asked which ClickHouse version was affected, the PR template told contributors to close upstream's issues, and CI job names, log lines, error messages and argparse descriptions named a product this repo does not ship. Only prose moved: display names, log and error messages, comments, docstrings and form labels. Everything a machine resolves stayed exactly as it was, because renaming those breaks a build rather than a sentence - binary and path tokens such as clickhouse-client and /etc/clickhouse-server, python and shell identifiers, CLICKHOUSE_* environment variables, the /ClickHouse container mount, docker images in a namespace we do not own, S3 buckets, maven and pypi coordinates, and every URL pointing at upstream. The attribution in NOTICE and README is untouched. Two links were wrong rather than merely stale, so they are corrected here. The PR template's Closes and Related placeholders sent contributors to upstream's tracker instead of this one, and an earlier pass had rewritten a source reference to github.com/Datastore/Datastore, which does not resolve. Co-authored-by: Hanzo Dev <[email protected]>
127 lines
5.1 KiB
Docker
127 lines
5.1 KiB
Docker
# docker build -t clickhouse/binary-builder .
|
|
ARG FROM_TAG
|
|
FROM clickhouse/fasttest:$FROM_TAG
|
|
ARG TARGETARCH
|
|
ENV CC=clang-${LLVM_VERSION}
|
|
ENV CXX=clang++-${LLVM_VERSION}
|
|
|
|
#non-functional change
|
|
|
|
# If the cctools is updated, then first build it in the CI, then update here in a different commit
|
|
COPY --from=clickhouse/cctools:859fb360308eb8ac47ad /cctools /cctools
|
|
|
|
# We need OpenSSL FIPS in permissive mode for build on MasterCI
|
|
COPY --from=clickhouse/cctools:859fb360308eb8ac47ad \
|
|
/opt/openssl-fips/openssl.cnf \
|
|
/opt/openssl-fips/fipsmodule.cnf \
|
|
/opt/openssl-fips/fips.so \
|
|
\
|
|
/etc/ssl/
|
|
|
|
# Refresh the kitware GPG key inherited from fasttest base image, it may be stale
|
|
RUN curl -s https://apt.kitware.com/keys/kitware-archive-latest.asc | gpg --dearmor - > /etc/apt/trusted.gpg.d/kitware.gpg \
|
|
&& apt-get update \
|
|
&& apt-get install software-properties-common --yes --no-install-recommends --verbose-versions
|
|
|
|
RUN add-apt-repository ppa:ubuntu-toolchain-r/test --yes \
|
|
&& apt-get update \
|
|
&& apt-get -o Dpkg::Options::="--force-overwrite" upgrade --yes \
|
|
&& apt-get -o Dpkg::Options::="--force-overwrite" install --yes \
|
|
binutils-dev \
|
|
build-essential \
|
|
zlib1g-dev \
|
|
python3-boto3 \
|
|
yasm \
|
|
zstd \
|
|
zip \
|
|
clang-tidy-${LLVM_VERSION} \
|
|
llvm-${LLVM_VERSION} \
|
|
bolt-${LLVM_VERSION} \
|
|
&& ln -sf /usr/bin/llvm-profdata-${LLVM_VERSION} /usr/bin/llvm-profdata \
|
|
&& ln -sf /usr/bin/llvm-cov-${LLVM_VERSION} /usr/bin/llvm-cov \
|
|
&& ln -sf /usr/bin/llvm-bolt-${LLVM_VERSION} /usr/bin/llvm-bolt \
|
|
&& ln -sf /usr/bin/merge-fdata-${LLVM_VERSION} /usr/bin/merge-fdata \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/* /var/cache/debconf /tmp/*
|
|
|
|
# Optional PGO+BOLT optimized toolchain override
|
|
ARG TOOLCHAIN_COMMIT=9ba77fe643bd2b46b341a07320cf9b95a3e87384
|
|
RUN if [ "$TOOLCHAIN_COMMIT" != "none" ]; then \
|
|
arch=${TARGETARCH:-amd64} && \
|
|
case $arch in \
|
|
amd64) tarch=amd64 ;; \
|
|
arm64) tarch=aarch64 ;; \
|
|
esac && \
|
|
curl -fsSL "https://clickhouse-builds.s3.amazonaws.com/REFs/master/${TOOLCHAIN_COMMIT}/build_toolchain_pgo_bolt_${tarch}/clang-pgo-bolt.tar.zst" \
|
|
| zstd -d | tar -xf - -C /usr/local/ && \
|
|
echo "Installed PGO+BOLT toolchain from commit ${TOOLCHAIN_COMMIT}" \
|
|
; fi
|
|
|
|
# Optional PGO+BOLT profiles for Datastore binary optimization
|
|
# Set CLICKHOUSE_PROFILES_COMMIT to a master commit SHA to download pre-collected profiles.
|
|
# Set to "none" (default) to skip — profiles are opt-in.
|
|
ARG CLICKHOUSE_PROFILES_COMMIT=none
|
|
RUN if [ "$CLICKHOUSE_PROFILES_COMMIT" != "none" ]; then \
|
|
arch=${TARGETARCH:-amd64} && \
|
|
case $arch in \
|
|
amd64) tarch=amd64 ;; \
|
|
arm64) tarch=aarch64 ;; \
|
|
esac && \
|
|
mkdir -p /opt/clickhouse-profiles && \
|
|
for profile in clickhouse-pgo.profdata.zst clickhouse-bolt.fdata.zst; do \
|
|
url="https://clickhouse-builds.s3.amazonaws.com/REFs/master/${CLICKHOUSE_PROFILES_COMMIT}/collect_clickhouse_profiles_pgo_bolt_${tarch}/${profile}" && \
|
|
if curl -fsSL -o "/opt/clickhouse-profiles/${profile}" "$url"; then \
|
|
zstd -d --rm "/opt/clickhouse-profiles/${profile}" && \
|
|
echo "Downloaded ${profile}" ; \
|
|
else \
|
|
echo "Profile ${profile} not available (optional)" ; \
|
|
fi ; \
|
|
done \
|
|
; fi
|
|
|
|
# Download and install mold for s390x build
|
|
ARG MOLD_VERSION=2.40.4
|
|
RUN arch=${TARGETARCH:-amd64} \
|
|
&& case $arch in \
|
|
amd64) rarch=x86_64 ;; \
|
|
arm64) rarch=aarch64 ;; \
|
|
esac \
|
|
&& curl -Lo /tmp/mold.tar.gz "https://github.com/rui314/mold/releases/download/v${MOLD_VERSION}/mold-${MOLD_VERSION}-${rarch}-linux.tar.gz" \
|
|
&& mkdir /tmp/mold \
|
|
&& tar -xzf /tmp/mold.tar.gz -C /tmp/mold \
|
|
&& cp -r /tmp/mold/mold*/* /usr \
|
|
&& rm -rf /tmp/mold \
|
|
&& rm /tmp/mold.tar.gz
|
|
|
|
# Architecture of the image when BuildKit/buildx is used
|
|
ARG NFPM_VERSION=2.20.0
|
|
RUN arch=${TARGETARCH:-amd64} \
|
|
&& curl -Lo /tmp/nfpm.deb "https://github.com/goreleaser/nfpm/releases/download/v${NFPM_VERSION}/nfpm_${arch}.deb" \
|
|
&& dpkg -i /tmp/nfpm.deb \
|
|
&& rm /tmp/nfpm.deb
|
|
|
|
ARG GO_VERSION=1.19.10
|
|
# We needed go for clickhouse-diagnostics (it is not used anymore)
|
|
RUN arch=${TARGETARCH:-amd64} \
|
|
&& curl -Lo /tmp/go.tgz "https://go.dev/dl/go${GO_VERSION}.linux-${arch}.tar.gz" \
|
|
&& tar -xzf /tmp/go.tgz -C /usr/local/ \
|
|
&& rm /tmp/go.tgz
|
|
|
|
ENV PATH="$PATH:/usr/local/go/bin"
|
|
ENV GOPATH=/workdir/go
|
|
ENV GOCACHE=/workdir/
|
|
|
|
# toolchain and SDK for Darwin
|
|
RUN curl -sL -O https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.0.sdk.tar.xz \
|
|
&& mkdir -p /build/cmake/toolchain/darwin-x86_64 \
|
|
&& tar xJf /MacOSX11.0.sdk.tar.xz -C /build/cmake/toolchain/darwin-x86_64 --strip-components=1 \
|
|
&& ln -sf darwin-x86_64 /build/cmake/toolchain/darwin-aarch64 \
|
|
&& rm /MacOSX11.0.sdk.tar.xz
|
|
|
|
ARG CLANG_TIDY_SHA1=3880541496c7ce0d2e2830d2f525375078fe0b1f
|
|
RUN curl -Lo /usr/bin/clang-tidy-cache.py \
|
|
"https://raw.githubusercontent.com/matus-chochlik/ctcache/$CLANG_TIDY_SHA1/src/ctcache/clang_tidy_cache.py" \
|
|
&& chmod +x /usr/bin/clang-tidy-cache.py
|
|
|
|
COPY clang-tidy-cache.sh /usr/bin/clang-tidy-cache
|