This is an automated email from the ASF dual-hosted git repository.

abstractdog pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 7d315d76d7d HIVE-29591: Create Hive precommit image and move 
Dockerfile into the hive repository (#6953)
7d315d76d7d is described below

commit 7d315d76d7dd7a82f200d07559bea2e50e8a5d9a
Author: Bodor Laszlo <[email protected]>
AuthorDate: Mon Nov 16 15:22:40 2026 +0100

    HIVE-29591: Create Hive precommit image and move Dockerfile into the hive 
repository (#6953)
---
 .github/workflows/docker-images.yml                |  14 +--
 .../workflows/hive-postgres-tpcds-metastore.yml    |   6 +-
 .github/workflows/precommit-image.yml              | 122 +++++++++++++++++++++
 Jenkinsfile                                        |  56 +++-------
 dev-support/docker/ci/runner/Dockerfile            | 119 ++++++++++++++++++++
 dev-support/docker/ci/runner/README.md             |  80 ++++++++++++++
 .../queries/clientnegative/cachingprintstream.q    |   3 +
 ql/src/test/queries/clientnegative/stack_trace.q   |   3 +
 8 files changed, 352 insertions(+), 51 deletions(-)

diff --git a/.github/workflows/docker-images.yml 
b/.github/workflows/docker-images.yml
index f6e865beba3..ba951c5bc2f 100644
--- a/.github/workflows/docker-images.yml
+++ b/.github/workflows/docker-images.yml
@@ -121,16 +121,16 @@ jobs:
           ls ./standalone-metastore/packaging/src/docker/
 
       - name: Login to Docker Hub
-        uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f
+        uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # 
v4.8.0
         with:
           username: ${{ secrets.DOCKERHUB_USER }}
           password: ${{ secrets.DOCKERHUB_TOKEN }}
 
       - name: Set up Docker Buildx
-        uses: 
docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c
+        uses: 
docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
 
       - name: Build Hive Image locally
-        uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a
+        uses: 
docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
         with:
           context: ./packaging/src/docker/
           file: ./packaging/src/docker/Dockerfile
@@ -146,7 +146,7 @@ jobs:
             BUILD_ENV=${{ env.BUILD_ENV }}
 
       - name: Build Standalone Metastore Image locally
-        uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a
+        uses: 
docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
         with:
           context: ./standalone-metastore/packaging/src/docker/
           file: ./standalone-metastore/packaging/src/docker/Dockerfile
@@ -160,7 +160,7 @@ jobs:
             BUILD_ENV=${{ env.BUILD_ENV }}
 
       - name: Create k8s cluster
-        uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc
+        uses: helm/kind-action@ea822c7bf1874f08e5a491df991c228edffc3376 # 
v1.15.2
 
       - name: Set up Helm
         uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # 
v5.0.1
@@ -188,7 +188,7 @@ jobs:
           kind delete cluster --name chart-testing
 
       - name: Build and push Hive Image to docker hub
-        uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a
+        uses: 
docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
         with:
           context: ./packaging/src/docker/
           file: ./packaging/src/docker/Dockerfile
@@ -204,7 +204,7 @@ jobs:
             BUILD_ENV=${{ env.BUILD_ENV }}
 
       - name: Build and push Standalone Metastore Image to docker hub
-        uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a
+        uses: 
docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
         with:
           context: ./standalone-metastore/packaging/src/docker/
           file: ./standalone-metastore/packaging/src/docker/Dockerfile
diff --git a/.github/workflows/hive-postgres-tpcds-metastore.yml 
b/.github/workflows/hive-postgres-tpcds-metastore.yml
index edc61ea33d1..93aec0c3244 100644
--- a/.github/workflows/hive-postgres-tpcds-metastore.yml
+++ b/.github/workflows/hive-postgres-tpcds-metastore.yml
@@ -41,17 +41,17 @@ jobs:
           fetch-depth: 1
 
       - name: Set up Docker Buildx
-        uses: 
docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c
+        uses: 
docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
 
       - name: Login to Docker Hub
         if: ${{ github.event.inputs.pushImage == 'true' }}
-        uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f
+        uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # 
v4.8.0
         with:
           username: ${{ secrets.DOCKERHUB_USER }}
           password: ${{ secrets.DOCKERHUB_TOKEN }}
 
       - name: Build and optionally push Docker image
-        uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a
+        uses: 
docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
         with:
           context: 
./standalone-metastore/metastore-server/docker/hive-postgres-tpcds-metastore/
           file: 
./standalone-metastore/metastore-server/docker/hive-postgres-tpcds-metastore/Dockerfile
diff --git a/.github/workflows/precommit-image.yml 
b/.github/workflows/precommit-image.yml
new file mode 100644
index 00000000000..56cac443498
--- /dev/null
+++ b/.github/workflows/precommit-image.yml
@@ -0,0 +1,122 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Builds the precommit image (dev-support/docker/ci/runner). On master it 
publishes the image as
+# apache/hive-ci-runner:<UTC timestamp>-<commit> and moves 
apache/hive-ci-runner:latest, which the
+# Jenkinsfile uses, to it. Only the newest 5 <UTC timestamp>-<commit> tags are 
kept.
+name: Precommit image
+
+on:
+  pull_request:
+    paths:
+      - 'dev-support/docker/ci/runner/Dockerfile'
+      - '.github/workflows/precommit-image.yml'
+  push:
+    branches:
+      - master
+    paths:
+      - 'dev-support/docker/ci/runner/Dockerfile'
+      - '.github/workflows/precommit-image.yml'
+  # On a branch other than master, it publishes a candidate to try with the 
IMAGE parameter of the
+  # precommit job; it does not move latest.
+  workflow_dispatch:
+
+permissions:
+  contents: read
+
+# Publishing runs one at a time, in order, so that latest ends up at the 
newest commit.
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+
+jobs:
+  build:
+    # On a fork, a push to master only syncs apache/hive: there is nothing to 
publish.
+    if: github.event_name != 'push' || github.repository == 'apache/hive'
+    runs-on: ubuntu-latest
+    env:
+      REPOSITORY: apache/hive-ci-runner
+      KEEP_TAGS: 5
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v6
+        with:
+          persist-credentials: false
+
+      - name: Tag the image
+        id: tag
+        run: |
+          version=$(date -u +%Y%m%d%H%M%S)-${GITHUB_SHA::7}
+          tags=$REPOSITORY:$version
+          if [[ $GITHUB_REF == refs/heads/master ]]; then
+            tags+=",$REPOSITORY:latest"
+          fi
+          echo "version=$version" >> "$GITHUB_OUTPUT"
+          echo "tags=$tags" >> "$GITHUB_OUTPUT"
+
+      - name: Set up QEMU
+        uses: 
docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
+
+      - name: Set up Docker Buildx
+        uses: 
docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
+
+      - name: Build the image
+        uses: 
docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
+        with:
+          context: ./dev-support/docker/ci/runner/
+          load: true
+          tags: hive-ci-runner:test
+
+      - name: Show the image size
+        run: docker images hive-ci-runner:test
+
+      - name: Login to Docker Hub
+        if: github.event_name != 'pull_request' && github.repository == 
'apache/hive'
+        uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # 
v4.8.0
+        with:
+          username: ${{ secrets.DOCKERHUB_USER }}
+          password: ${{ secrets.DOCKERHUB_TOKEN }}
+
+      - name: Publish the image
+        if: github.event_name != 'pull_request' && github.repository == 
'apache/hive'
+        uses: 
docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
+        with:
+          context: ./dev-support/docker/ci/runner/
+          platforms: linux/amd64,linux/arm64
+          push: true
+          tags: ${{ steps.tag.outputs.tags }}
+          labels: |
+            org.opencontainers.image.version=${{ steps.tag.outputs.version }}
+            org.opencontainers.image.revision=${{ github.sha }}
+
+      # Deletes the <UTC timestamp>-<commit> tags but the newest KEEP_TAGS 
ones; latest and any other
+      # tag are kept. The image is already published, so a failure here does 
not fail the job.
+      - name: Delete old tags
+        if: github.event_name != 'pull_request' && github.repository == 
'apache/hive'
+        continue-on-error: true
+        env:
+          DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
+          DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
+        run: |
+          hub=https://hub.docker.com/v2
+          token=$(jq -n --arg user "$DOCKERHUB_USER" --arg secret 
"$DOCKERHUB_TOKEN" '{identifier: $user, secret: $secret}' \
+            | curl -sSf -H 'Content-Type: application/json' -d @- 
"$hub/auth/token" | jq -r .access_token)
+          echo "::add-mask::$token"
+          old_tags=$(curl -sSf 
"$hub/namespaces/${REPOSITORY%/*}/repositories/${REPOSITORY#*/}/tags?page_size=100"
 \
+            | jq -r '.results[].name | 
select(test("^[0-9]{14}-[0-9a-f]{7}$"))' | sort -r | tail -n +$((KEEP_TAGS + 
1)))
+          for tag in $old_tags; do
+            echo "Deleting $REPOSITORY:$tag"
+            curl -sSf -X DELETE -H "Authorization: Bearer $token" 
"$hub/repositories/$REPOSITORY/tags/$tag/"
+          done
diff --git a/Jenkinsfile b/Jenkinsfile
index ad8f017e0f1..fdb900105ee 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -31,9 +31,15 @@ properties([
     parameters([
         string(name: 'SPLIT', defaultValue: '22', description: 'Number of 
buckets to split tests into.'),
         string(name: 'OPTS', defaultValue: '', description: 'additional maven 
opts'),
+        string(name: 'IMAGE', defaultValue: '', description: 'precommit image 
to use instead of the default one (e.g. a candidate built from 
dev-support/docker/ci/runner)'),
     ])
 ])
 
+// Built from dev-support/docker/ci/runner/Dockerfile and published by 
.github/workflows/precommit-image.yml
+// whenever a change of it reaches master. To pin a run to an image, set IMAGE 
to one of its
+// <UTC timestamp>-<commit> tags.
+this.precommitImage = 'apache/hive-ci-runner:latest'
+
 this.prHead = null;
 def checkPrHead() {
   if(env.CHANGE_ID) {
@@ -72,12 +78,17 @@ def setPrLabel(String prLabel) {
 
 setPrLabel("PENDING");
 
+// Every mvn call uses the settings and the local repository under .m2 of the 
workspace (set up by buildHive);
+// saveWS/loadWS hand them over to the other stages. Maven 3.9+ reads 
MAVEN_ARGS.
 def executorNode(run) {
   hdbPodTemplate {
     timeout(time: 12, unit: 'HOURS') {
       node(POD_LABEL) {
-        container('hdb') {
-          run()
+        def m2 = "${env.WORKSPACE}/.m2"
+        withEnv(["MAVEN_ARGS=-s ${m2}/settings.xml 
-Dmaven.repo.local=${m2}/repository -B -Dtest.groups= 
-Pitests,qsplits,dist,errorProne"]) {
+          container('hdb') {
+            run()
+          }
         }
       }
     }
@@ -89,17 +100,10 @@ def buildHive(args) {
     withEnv(["MULTIPLIER=$params.MULTIPLIER","M_OPTS=$params.OPTS"]) {
       sh '''#!/bin/bash -e
 set -x
-. /etc/profile.d/confs.sh
 export USER="`whoami`"
 export MAVEN_OPTS="-Xmx4G"
-export -n HIVE_CONF_DIR
-sw java 21 && . /etc/profile.d/java.sh
 mkdir -p .m2/repository
 cp $SETTINGS .m2/settings.xml
-OPTS=" -s $PWD/.m2/settings.xml -B -Dtest.groups= "
-OPTS+=" -Pitests,qsplits,dist,errorProne"
-OPTS+=" -Dmaven.repo.local=$PWD/.m2/repository"
-git config extra.mavenOpts "$OPTS"
 OPTS=" $M_OPTS -Dmaven.test.failure.ignore "
 if [ -s inclusions.txt ]; then OPTS+=" 
-Dsurefire.includesFile=$PWD/inclusions.txt";fi
 if [ -s exclusions.txt ]; then OPTS+=" 
-Dsurefire.excludesFile=$PWD/exclusions.txt";fi
@@ -123,7 +127,6 @@ def sonarAnalysis(args) {
       // Sonar scanner runs in a separate JVM so JAVA_OPTS (notably heap size)
       // must be passed via the appropriate environment variable
       sh """#!/bin/bash -e
-      sw java 21 && . /etc/profile.d/java.sh
       export SONAR_SCANNER_JAVA_OPTS=-Xmx8g
       """+mvnCmd
   }
@@ -132,7 +135,7 @@ def sonarAnalysis(args) {
 def hdbPodTemplate(closure) {
   podTemplate(
   containers: [
-    containerTemplate(name: 'hdb', image: 'ayushtkn/hive-dev-box:executor', 
ttyEnabled: true, command: 'tini -- cat',
+    containerTemplate(name: 'hdb', image: params.IMAGE?.trim() ?: 
precommitImage, ttyEnabled: true, command: 'tini -- cat',
         alwaysPullImage: true,
         resourceRequestCpu: '1800m',
         resourceLimitCpu: '8000m',
@@ -146,7 +149,7 @@ def hdbPodTemplate(closure) {
             envVar(key: 'DOCKER_CERT_PATH', value: '/certs/client')
         ]
     ),
-    containerTemplate(name: 'dind', image: 'docker:20.10-dind',
+    containerTemplate(name: 'dind', image: 'docker:29.9-dind',
         alwaysPullImage: true,
         privileged: true,
         envVars: [
@@ -200,7 +203,6 @@ def jobWrappers(closure) {
 def checkstyle() {
   sh '''#!/bin/bash -e
 set -x
-sw java 21 && . /etc/profile.d/java.sh
 export MAVEN_OPTS="-Xmx6G"
 mvn checkstyle:checkstyle -Pitests
 '''
@@ -301,33 +303,6 @@ fi
   }
 
   def branches = [:]
-  for (def d in ['derby','postgres',/*'mysql','oracle'*/]) {
-    def dbType=d
-    def splitName = "init@$dbType"
-    branches[splitName] = {
-      executorNode {
-        stage('Prepare') {
-            loadWS();
-        }
-        stage('init-metastore') {
-           withEnv(["dbType=$dbType"]) {
-             sh '''#!/bin/bash -e
-             sw java 21 && . /etc/profile.d/java.sh
-set -x
-echo 127.0.0.1 dev_$dbType | sudo tee -a /etc/hosts
-. /etc/profile.d/confs.sh
-sw hive-dev $PWD
-export DOCKER_NETWORK=host
-export DBNAME=metastore
-export HADOOP_CLIENT_OPTS="--add-opens java.base/java.net=ALL-UNNAMED"
-reinit_metastore $dbType
-time docker rm -f dev_$dbType || true
-'''
-          }
-        }
-      }
-    }
-  }
   branches['nightly-check'] = {
       executorNode {
         stage('Prepare') {
@@ -428,7 +403,6 @@ tar -xzf packaging/target/apache-hive-*-nightly-*-src.tar.gz
       }
       stage('Generate javadoc') {
           sh """#!/bin/bash -e
-          sw java 21 && . /etc/profile.d/java.sh
 mvn install javadoc:javadoc javadoc:aggregate -DskipTests -pl 
'!itests/hive-jmh,!itests/util'
 """
       }
diff --git a/dev-support/docker/ci/runner/Dockerfile 
b/dev-support/docker/ci/runner/Dockerfile
new file mode 100644
index 00000000000..a34624d9181
--- /dev/null
+++ b/dev-support/docker/ci/runner/Dockerfile
@@ -0,0 +1,119 @@
+# syntax=docker/dockerfile:1
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# The image the Hive precommit (see Jenkinsfile) builds and tests Hive in.
+#
+# It is deliberately minimal: a JDK, Maven, and the handful of tools the 
Jenkinsfile
+# stages and the tests shell out to. Everything else is fetched by Maven at 
build time.
+# See README.md next to this file before adding anything.
+
+# glibc based on purpose: tests run prebuilt native code linked against glibc
+# (e.g. the Kudu mini cluster binaries, Conscrypt).
+ARG DEBIAN_VERSION=trixie
+ARG JAVA_VERSION=21
+
+# The Temurin JDK is a generic glibc build; only the distribution of its image 
differs.
+FROM eclipse-temurin:${JAVA_VERSION}-jdk AS jdk
+# jmods are only used by jlink; classes_nocoops.jsa is only used with heaps > 
32GB.
+RUN rm -rf /opt/java/openjdk/jmods \
+           /opt/java/openjdk/man \
+           /opt/java/openjdk/lib/server/classes_nocoops.jsa
+
+FROM debian:${DEBIAN_VERSION}-slim AS downloads
+ARG MAVEN_VERSION=3.9.16
+ARG APACHE_ARCHIVE=https://archive.apache.org/dist
+RUN apt-get update \
+    && apt-get install -y --no-install-recommends ca-certificates curl \
+    && rm -rf /var/lib/apt/lists/*
+WORKDIR /tmp
+
+# Fetches $1 and verifies it against the published .sha512 (plain or 
BSD-style).
+COPY <<'EOF' /usr/local/bin/fetch
+#!/bin/sh
+set -eu
+curl -fsSL --retry 5 -o "${1##*/}" "$1"
+echo "$(curl -fsSL --retry 5 "$1.sha512" | awk '{print $NF}')  ${1##*/}" | 
sha512sum -c -
+EOF
+RUN chmod +x /usr/local/bin/fetch
+
+RUN fetch 
"${APACHE_ARCHIVE}/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz"
 \
+    && mkdir /opt/maven \
+    && tar -xzf apache-maven-${MAVEN_VERSION}-bin.tar.gz -C /opt/maven 
--strip-components=1 \
+    && rm apache-maven-${MAVEN_VERSION}-bin.tar.gz
+
+FROM debian:${DEBIAN_VERSION}-slim
+
+# The publishing workflow adds org.opencontainers.image.version and 
org.opencontainers.image.revision.
+LABEL org.opencontainers.image.title="Apache Hive precommit" \
+      org.opencontainers.image.description="Build and test environment of the 
Apache Hive precommit job" \
+      org.opencontainers.image.source="https://github.com/apache/hive"; \
+      org.opencontainers.image.licenses="Apache-2.0"
+
+# The base image already has the GNU bash, coreutils, diffutils, findutils, 
grep, sed and tar
+# that scripts and tests expect (e.g. qtest result diffing, Hadoop's 
Shell/Stat/DF/DU helpers).
+# ca-certificates, git: Jenkins checkout.
+# docker-cli: tests start databases in the dind sidecar.
+# libcom-err2, libk5crypto3, libkeyutils1, libkrb5support0: needed by the Kudu 
mini cluster
+#   binaries (kudu-binary) that the kudu-handler tests start.
+# openssl: tests generate self-signed certificates with it (e.g. 
GcsOAuthTokenMock).
+# procps: ps, used by tests; python3, python-is-python3: TRANSFORM scripts in 
qtests;
+# rsync: workspace hand-over between stages; tini: reaps the processes tests 
leave behind;
+# xmlstarlet: pom.xml format check.
+RUN apt-get update \
+    && apt-get install -y --no-install-recommends \
+        ca-certificates \
+        docker-cli \
+        git \
+        libcom-err2 \
+        libk5crypto3 \
+        libkeyutils1 \
+        libkrb5support0 \
+        openssl \
+        procps \
+        python-is-python3 \
+        python3 \
+        rsync \
+        tini \
+        xmlstarlet \
+    && rm -rf /var/lib/apt/lists/* \
+    && git config --system --add safe.directory '*'
+
+COPY --from=jdk /opt/java/openjdk /opt/java/openjdk
+COPY --from=downloads /opt/maven /opt/maven
+
+ENV JAVA_HOME=/opt/java/openjdk \
+    MAVEN_HOME=/opt/maven \
+    PATH=/opt/java/openjdk/bin:/opt/maven/bin:$PATH \
+    LANG=C.UTF-8 \
+    LC_ALL=C.UTF-8 \
+    TZ=UTC
+
+# The Jenkins agent runs as uid 1000 and the pod uses fsGroup 1000; tests must 
not run as root.
+# ~/.m2 exists up front so that a local repository mounted below it leaves it 
writable.
+ARG UID=1000
+RUN groupadd -g ${UID} jenkins \
+    && useradd -m -u ${UID} -g jenkins -d /home/jenkins -s /bin/bash jenkins \
+    && install -d -o jenkins -g jenkins /home/jenkins/.m2
+
+# docker run sets no USER, but LLAP reads it to submit work 
(LlapTaskCommunicator).
+ENV USER=jenkins
+USER jenkins
+WORKDIR /home/jenkins
+
+ENTRYPOINT ["/usr/bin/tini", "--"]
+CMD ["bash"]
diff --git a/dev-support/docker/ci/runner/README.md 
b/dev-support/docker/ci/runner/README.md
new file mode 100644
index 00000000000..7897130d0d2
--- /dev/null
+++ b/dev-support/docker/ci/runner/README.md
@@ -0,0 +1,80 @@
+<!--
+{% comment %}
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to you under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+{% endcomment %}
+-->
+# Hive precommit image
+
+The [Jenkinsfile](../../../../Jenkinsfile) runs every precommit stage in this 
image, with a
+`docker:dind` sidecar for the tests that start databases in containers.
+
+The image is kept small on purpose. It holds:
+
+* Debian (slim), with the GNU shell tools that scripts and tests expect. It is 
glibc based on
+  purpose: tests run prebuilt native code that is linked against glibc, such 
as the Kudu
+  mini cluster.
+* a JDK (Eclipse Temurin), without jmods and man pages
+* Maven
+* the docker CLI, git, openssl, python3, rsync, tini and xmlstarlet
+
+Everything else (Tez, the JDBC drivers, the Hive build dependencies) is 
fetched by Maven
+during the build. Before adding a package, check whether Maven can provide it 
instead.
+
+## How the image is published
+
+The [precommit-image](../../../../.github/workflows/precommit-image.yml) 
workflow builds the
+image on every pull request that changes the Dockerfile or the workflow. When 
such a change lands
+on master, the workflow publishes the image for `linux/amd64` and 
`linux/arm64` as
+`apache/hive-ci-runner:<UTC timestamp>-<commit>` (e.g. 
`20261113133625-be04f55`), and moves
+`apache/hive-ci-runner:latest` to it. The Jenkinsfile uses `latest`, so 
precommit runs that start
+after the workflow has finished use the new image; there is no version to bump.
+
+The workflow keeps the newest 5 `<UTC timestamp>-<commit>` tags and deletes 
the older ones.
+
+## Changing the image
+
+1. Edit the [Dockerfile](Dockerfile). Keep the image small:
+   * Prefer letting Maven fetch a dependency over baking it into the image.
+   * Pin versions through the existing build arguments (`JAVA_VERSION`, 
`MAVEN_VERSION`,
+     `DEBIAN_VERSION`) rather than hard-coding them.
+   * Install packages with `--no-install-recommends`, and add each new package 
to the comment
+     above `apt-get install`, saying which stage or test needs it.
+   * Do anything heavy in the `jdk` or `downloads` stage and copy only the 
result into the
+     final stage.
+2. Build the image, and compare its size with the image before your change. 
Explain any growth
+   in the pull request.
+
+   ```bash
+   docker build -t hive-ci-runner:local dev-support/docker/ci/runner
+   docker images hive-ci-runner:local
+   ```
+3. Try the image in the precommit job. Push it, for amd64, to a Docker Hub 
namespace you
+   control:
+
+   ```bash
+   docker buildx build --platform linux/amd64 --push \
+     -t <your-namespace>/hive-ci-runner:HIVE-12345 dev-support/docker/ci/runner
+   ```
+
+   On the precommit job of your pull request in Jenkins, choose *Build with 
Parameters* and set
+   `IMAGE` to `<your-namespace>/hive-ci-runner:HIVE-12345`. The parameter is 
only offered after
+   the job has run at least once with this Jenkinsfile. Link the run in the 
pull request.
+4. Once the pull request is merged, the workflow publishes the image and moves 
`latest` to it.
+   A precommit run that starts while the workflow is still running uses the 
previous image.
+
+To roll back, revert the change of the Dockerfile: the workflow publishes the 
reverted image as
+the new `latest`. Until then, a precommit run can use one of the previous
+`<UTC timestamp>-<commit>` tags through `IMAGE`.
diff --git a/ql/src/test/queries/clientnegative/cachingprintstream.q 
b/ql/src/test/queries/clientnegative/cachingprintstream.q
index a1939b6ccb0..85d7fa512a1 100644
--- a/ql/src/test/queries/clientnegative/cachingprintstream.q
+++ b/ql/src/test/queries/clientnegative/cachingprintstream.q
@@ -1,4 +1,7 @@
 --! qt:dataset:src
+-- Recent JDKs report a failed exec as "Exec failed, error: 2 (No such file or 
directory) ",
+-- older ones as "error=2, No such file or directory"; the expected output 
uses the older form.
+--! qt:replace:/Exec failed, error: (\d+) \(([^)]*)\) ?/error=$1, $2/
 set hive.llap.execution.mode=auto;
 set 
hive.exec.failure.hooks=org.apache.hadoop.hive.ql.hooks.VerifyCachingPrintStreamHook;
 set 
hive.exec.post.hooks=org.apache.hadoop.hive.ql.hooks.VerifyCachingPrintStreamHook;
diff --git a/ql/src/test/queries/clientnegative/stack_trace.q 
b/ql/src/test/queries/clientnegative/stack_trace.q
index 953a7e44165..0d6e307df62 100644
--- a/ql/src/test/queries/clientnegative/stack_trace.q
+++ b/ql/src/test/queries/clientnegative/stack_trace.q
@@ -1,4 +1,7 @@
 --! qt:dataset:src
+-- Recent JDKs report a failed exec as "Exec failed, error: 2 (No such file or 
directory) ",
+-- older ones as "error=2, No such file or directory"; the expected output 
uses the older form.
+--! qt:replace:/Exec failed, error: (\d+) \(([^)]*)\) ?/error=$1, $2/
 
 set hive.vectorized.execution.enabled=false;
 set hive.exec.mode.local.auto=false;

Reply via email to