Files
greptimedb/.github/runner-scale-sets/query-regression/Dockerfile
T
discord9 16217ff567 ci: add persistent query regression cache (#8474)
* ci: add persistent query regression cache

Signed-off-by: discord9 <discord9@163.com>

* ci: add sccache to query regression runner

Signed-off-by: discord9 <discord9@163.com>

* ci: pin query regression label revision

Signed-off-by: discord9 <discord9@163.com>

* ci: isolate query regression toolchain state

Signed-off-by: discord9 <discord9@163.com>

---------

Signed-off-by: discord9 <discord9@163.com>
2026-07-15 01:46:40 +00:00

85 lines
3.2 KiB
Docker

FROM ghcr.io/astral-sh/uv@sha256:3d868e555f8f1dbc324afa005066cd11e1053fc4743b9808ca8025283e65efa5 AS uv
FROM ghcr.io/actions/actions-runner@sha256:08c30b0a7105f64bddfc485d2487a22aa03932a791402393352fdf674bda2c29
USER root
ARG SCCACHE_VERSION=0.16.0
ARG SCCACHE_SHA256=aec995a83ad3dff3d14b6314e08858b7b73d35ca85a5bcf3d3a9ec07dee35588
ARG RUSTUP_INIT_VERSION=1.29.0
ARG RUSTUP_INIT_TARGET=x86_64-unknown-linux-gnu
ARG RUSTUP_INIT_SHA256=4acc9acc76d5079515b46346a485974457b5a79893cfb01112423c89aeb5aa10
ARG RUST_TOOLCHAIN=nightly-2026-03-21
ENV RUSTUP_HOME=/opt/rustup \
CARGO_HOME=/opt/cargo \
RUSTUP_TOOLCHAIN=${RUST_TOOLCHAIN} \
RUSTUP_AUTO_INSTALL=0 \
PATH=/opt/cargo/bin:${PATH}
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
clang \
cmake \
curl \
git \
gzip \
jq \
libssl-dev \
mold \
openssh-client \
pkg-config \
protobuf-compiler \
python3 \
sudo \
tar \
unzip \
wget \
xz-utils \
zip \
zstd \
&& rm -rf /var/lib/apt/lists/*
COPY --from=uv /uv /uvx /usr/local/bin/
RUN curl --fail --location --silent --show-error \
--output /tmp/sccache.tar.gz \
"https://github.com/mozilla/sccache/releases/download/v${SCCACHE_VERSION}/sccache-v${SCCACHE_VERSION}-x86_64-unknown-linux-musl.tar.gz" \
&& echo "${SCCACHE_SHA256} /tmp/sccache.tar.gz" | sha256sum --check --status - \
&& mkdir --parents /tmp/sccache \
&& tar --extract --gzip --file /tmp/sccache.tar.gz \
--directory /tmp/sccache --strip-components=1 \
"sccache-v${SCCACHE_VERSION}-x86_64-unknown-linux-musl/sccache" \
&& install --mode=0755 /tmp/sccache/sccache /usr/local/bin/sccache \
&& rm -rf /tmp/sccache.tar.gz /tmp/sccache
RUN curl --fail --location --silent --show-error \
--output /tmp/rustup-init \
"https://static.rust-lang.org/rustup/archive/${RUSTUP_INIT_VERSION}/${RUSTUP_INIT_TARGET}/rustup-init" \
&& echo "${RUSTUP_INIT_SHA256} /tmp/rustup-init" | sha256sum --check --status - \
&& chmod 0755 /tmp/rustup-init \
&& /tmp/rustup-init -y --profile minimal --default-toolchain "${RUST_TOOLCHAIN}" --no-modify-path \
&& rm -f /tmp/rustup-init \
&& chown -R root:root /opt/rustup /opt/cargo \
&& chmod -R go-w /opt/rustup /opt/cargo \
&& find /opt/rustup /opt/cargo -type d -exec chmod 0755 {} + \
&& find /opt/rustup /opt/cargo -type f -exec chmod a+r {} +
USER runner
RUN set -eu \
&& test "$(id -u)" = "1001" \
&& temporary_cargo_home="$(mktemp --directory)" \
&& trap 'rm -rf "${temporary_cargo_home}"' 0 \
&& export CARGO_HOME="${temporary_cargo_home}" \
&& test "${RUSTUP_AUTO_INSTALL}" = "0" \
&& rustup --version \
&& cargo --version \
&& rustc --version \
&& active_toolchain="$(rustup show active-toolchain)" \
&& printf 'Active toolchain: %s\n' "${active_toolchain}" \
&& case "${active_toolchain}" in "${RUST_TOOLCHAIN}-x86_64-unknown-linux-gnu"|"${RUST_TOOLCHAIN}-x86_64-unknown-linux-gnu "*) ;; *) exit 1;; esac \
&& test ! -w /opt/rustup \
&& test ! -w /opt/cargo/bin