This is an automated email from the ASF dual-hosted git repository.
shuke987 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/doris-thirdparty.git
The following commit(s) were added to refs/heads/main by this push:
new c85c536feb9 [ci] Export Docker image artifacts and add Doris 4.1 and
4.2 builds (#440)
c85c536feb9 is described below
commit c85c536feb953a05ad65cbdd6b38c694f0186796
Author: Mingyu Chen (Rayner) <[email protected]>
AuthorDate: Thu Nov 26 14:30:00 2026 +0800
[ci] Export Docker image artifacts and add Doris 4.1 and 4.2 builds (#440)
* [ci] Export build environment images as downloadable artifacts
* [ci] Build third-party dependencies for Doris 4.1 and 4.2
* [docs] Explain how to publish Docker image artifacts
---
.github/actions/login-action | 1 -
.github/workflows/build-4.0.yml | 463 +--------------------
.github/workflows/build-4.1.yml | 47 +++
.github/workflows/build-4.2.yml | 47 +++
.github/workflows/{build-4.0.yml => build-4.x.yml} | 195 +++++----
.github/workflows/build.yml | 86 ++--
.gitmodules | 3 -
README-docker-images.md | 69 +++
README.md | 2 +
9 files changed, 322 insertions(+), 591 deletions(-)
diff --git a/.github/actions/login-action b/.github/actions/login-action
deleted file mode 160000
index c94ce9fb468..00000000000
--- a/.github/actions/login-action
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit c94ce9fb468520275223c153574b00df6fe4bcc9
diff --git a/.github/workflows/build-4.0.yml b/.github/workflows/build-4.0.yml
index 1249bb71c8c..81b893eb85a 100644
--- a/.github/workflows/build-4.0.yml
+++ b/.github/workflows/build-4.0.yml
@@ -35,464 +35,13 @@ concurrency:
cancel-in-progress: false
jobs:
- prerelease:
- name: Prerelease
- runs-on: ubuntu-latest
- env:
- GH_REPO: ${{ github.repository }}
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- permissions:
- contents: write
- outputs:
- should_release: ${{ steps.check_diff.outputs.should_release }}
- doris_version: ${{ steps.check_diff.outputs.doris_version }}
- attempt: ${{ steps.check_diff.outputs.attempt }}
- steps:
- - name: Checkout
- uses: actions/checkout@v5
- with:
- repository: 'apache/doris'
- ref: 'branch-4.0'
- fetch-depth: 0
-
- - name: Check Diff
- id: check_diff
- run: |
- tag_name='automation-4.0'
- title="Apache Doris Third Party Prebuilt (${tag_name/automation-/})"
- max_attempts=3
-
- if [[ -z "$(gh release list)" ]] ||
- ! gh release list | awk -F "\t" '{ print $3 }' | grep
"${tag_name}" >/dev/null; then
- gh release create -t "${title}" "${tag_name}"
- fi
-
- # The release note is the only state this pipeline keeps. Read it
once
- # so the three fields below cannot come from three different
revisions.
- note="$(gh release view "${tag_name}")"
- last_version="$(echo "${note}" | sed -n -E 's/Doris Version:
\*(.*)\*.*/\1/p')"
- last_status="$(echo "${note}" | sed -n -E 's/Status:
\*(.*)\*.*/\1/p')"
- last_attempt="$(echo "${note}" | sed -n -E 's/Attempts:
\*([0-9]+)\*.*/\1/p')"
- # A note without a usable counter must not enable retries: treating
it
- # as attempt 0 is what turns every scheduled run into a full rebuild.
- [[ "${last_attempt}" =~ ^[0-9]+$ ]] || last_attempt="${max_attempts}"
- current_version="$(git log -1 --format='%H')"
-
- echo "Last Version: ${last_version}"
- echo "Last Status: ${last_status}"
- echo "Last Attempt: ${last_attempt}"
- echo "Current Version: ${current_version}"
-
- should_release=false
- attempt=1
- if [[ -z "${last_version}" ]]; then
- echo "The first release was detected."
- should_release=true
- elif [[ "${last_version}" != "${current_version}" ]]; then
- cmd="git diff --name-only ${last_version} ${current_version} |
grep -E '^thirdparty/'"
- echo "Execute: ${cmd}"
- content="$(eval "${cmd}")" || true
- if [[ -n "${content}" ]]; then
- echo -e "Detect changes:\n${content}"
- should_release=true
- fi
- elif [[ "${last_status}" == 'FAILURE' ]] && [[ "${last_attempt}" -lt
"${max_attempts}" ]]; then
- # Downloads from third party mirrors fail often enough that a
single
- # red run should not park the branch until the next thirdparty/
- # commit lands. Retry a bounded number of times, never forever.
- attempt=$((last_attempt + 1))
- echo "Previous build failed, retrying (attempt
${attempt}/${max_attempts})."
- should_release=true
- fi
-
- if "${should_release}"; then
- echo -ne "Update Time: *$(date)*\nDoris Version:
*${current_version}*\nStatus: *BUILDING*\nAttempts: *${attempt}*"
>release_note.md
- else
- gh release view "${tag_name}" | sed -n '/--/,$p' | awk '{ if (NR >
1) print $0 }' | sed "{
- s/Update Time:.*/Update Time: *$(date)*/
- s/Doris Version:.*/Doris Version: *${current_version}*/
- }" >release_note.md
- fi
- gh release edit -F release_note.md "${tag_name}"
-
- echo "should_release=${should_release}" >> $GITHUB_OUTPUT
- echo "doris_version=${current_version}" >> $GITHUB_OUTPUT
- echo "attempt=${attempt}" >> $GITHUB_OUTPUT
-
- - name: Download Source and Upload
- if: steps.check_diff.outputs.should_release == 'true'
- run: |
- tag_name='automation-4.0'
-
- cd thirdparty
- # Pre-download packages whose default mirror is blocked or gone on
GH Actions runners:
- # lzo: fossies.org returns 410 Gone
- # libuuid: nchc.dl.sourceforge.net (TW mirror) is blocked from GH
Actions
- mkdir -p src
- curl -fL
"https://www.oberhumer.com/opensource/lzo/download/lzo-2.10.tar.gz" \
- -o src/lzo-2.10.tar.gz
- curl -fL
"https://downloads.sourceforge.net/project/libuuid/libuuid-1.0.3.tar.gz" \
- -o src/libuuid-1.0.3.tar.gz
- sed '/# unpacking thirdpart archives/,$d' download-thirdparty.sh |
bash -
-
- tar -zcvf doris-thirdparty-source.tgz src
-
- gh release delete-asset "${tag_name}" doris-thirdparty-source.tgz
--yes || true
- gh release upload --clobber "${tag_name}" doris-thirdparty-source.tgz
-
build:
name: Build
- needs: prerelease
- if: needs.prerelease.outputs.should_release == 'true' ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.force_build ==
'true')
- strategy:
- fail-fast: false
- matrix:
- config:
- - name: macOS-arm64
- os: macos-15
- packages: >-
- 'm4'
- 'automake'
- 'autoconf'
- 'libtool'
- 'pkg-config'
- 'texinfo'
- 'coreutils'
- 'gnu-getopt'
- 'python@3'
- 'ninja'
- 'ccache'
- 'bison'
- 'byacc'
- 'gettext'
- 'wget'
- 'pcre'
- 'openjdk@11'
- 'maven'
- 'node'
- 'llvm@20'
-
- - name: Linux
- os: ubuntu-22.04
- packages: >-
- 'build-essential'
- 'automake'
- 'autoconf'
- 'libtool-bin'
- 'pkg-config'
- 'cmake=3.22.1-1ubuntu1.22.04.2'
- 'ninja-build'
- 'ccache'
- 'python-is-python3'
- 'bison'
- 'byacc'
- 'flex'
- 'binutils-dev'
- 'libiberty-dev'
- 'curl'
- 'git'
- 'zip'
- 'unzip'
- 'autopoint'
- 'openjdk-8-jdk'
- 'openjdk-8-jdk-headless'
- 'maven'
-
- runs-on: ${{ matrix.config.os }}
- env:
- GH_REPO: ${{ github.repository }}
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- steps:
- - name: Checkout easimon/maximize-build-space
- if: ${{ matrix.config.name == 'Linux' }}
- run: |
- git clone -b v7 https://github.com/easimon/maximize-build-space
-
- #- name: Maximize build space
- # if: ${{ matrix.config.name == 'Linux' }}
- # uses: ./maximize-build-space
- # with:
- # root-reserve-mb: 4096
- # swap-size-mb: 8192
- # remove-dotnet: 'true'
- # remove-android: 'true'
- # remove-haskell: 'true'
- # remove-codeql: 'true'
- # remove-docker-images: 'true'
-
- - name: Checkout
- uses: actions/checkout@v5
- with:
- repository: 'apache/doris'
- ref: 'branch-4.0'
-
- - name: Download
- run: |
- tag_name='automation-4.0'
-
- cd thirdparty
- curl -L "https://github.com/${{ github.repository
}}/releases/download/${tag_name}/doris-thirdparty-source.tgz" \
- -o doris-thirdparty-source.tgz
- tar -zxvf doris-thirdparty-source.tgz
-
- - name: Prepare for ${{ matrix.config.os }}
- run: |
- if [[ "${{ matrix.config.name }}" =~ macOS-* ]]; then
- # Install packages except cmake
- brew install ${{ matrix.config.packages }} || true
- # Install specific version of cmake
- brew unlink cmake || true
- wget
https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1-macos-universal.tar.gz
- tar -xzf cmake-3.22.1-macos-universal.tar.gz
- sudo cp -r cmake-3.22.1-macos-universal/CMake.app/Contents/*
/usr/local/
- cmake --version
- else
- export DEFAULT_DIR='/opt/doris'
- export PATH="${DEFAULT_DIR}/ldb-toolchain/bin:${PATH}"
-
- sudo apt update
- sudo apt-cache policy cmake
- sudo DEBIAN_FRONTEND=noninteractive apt install --yes ${{
matrix.config.packages }}
-
- mkdir -p "${DEFAULT_DIR}"
- wget
https://github.com/amosbird/ldb_toolchain_gen/releases/download/v0.25/ldb_toolchain_gen.sh
\
- -q -O /tmp/ldb_toolchain_gen.sh
- bash /tmp/ldb_toolchain_gen.sh "${DEFAULT_DIR}/ldb-toolchain"
- fi
-
- - name: Build and Upload
- run: |
- tag_name='automation-4.0'
-
- if [[ "${{ matrix.config.name }}" == 'Linux' ]]; then
- export DEFAULT_DIR='/opt/doris'
- export PATH="${DEFAULT_DIR}/ldb-toolchain/bin:${PATH}"
- export PATH="$(find /usr/lib/jvm/java-8-openjdk* -maxdepth 1 -type
d -name 'bin'):${PATH}"
- export JAVA_HOME="$(find /usr/lib/jvm/java-8-openjdk* -maxdepth 0)"
- export DORIS_TOOLCHAIN=clang
- else
- export MACOSX_DEPLOYMENT_TARGET=12.0
- fi
-
- export CMAKE_POLICY_VERSION_MINIMUM=3.10
- export CUSTOM_CMAKE="/usr/local/bin/cmake"
- cd thirdparty
- # Fix packages that may be empty if the source tarball was built
before the mirror fixes:
- # lzo: fossies.org returns 410 Gone
- # libuuid: nchc.dl.sourceforge.net (TW mirror) blocked from GH
Actions
- if [[ ! -s src/lzo-2.10.tar.gz ]]; then
- curl -fL
"https://www.oberhumer.com/opensource/lzo/download/lzo-2.10.tar.gz" \
- -o src/lzo-2.10.tar.gz
- fi
- if [[ ! -s src/libuuid-1.0.3.tar.gz ]]; then
- curl -fL
"https://downloads.sourceforge.net/project/libuuid/libuuid-1.0.3.tar.gz" \
- -o src/libuuid-1.0.3.tar.gz
- fi
- ./build-thirdparty.sh -j "$(nproc)"
-
- kernel="$(uname -s | awk '{print tolower($0)}')"
- arch="$(uname -m)"
- rm -rf "doris-thirdparty-prebuilt-${kernel}-${arch}.tar.xz"
- tar -cf - installed | xz -z -T0 -
>"doris-thirdparty-prebuilt-${kernel}-${arch}.tar.xz"
- # Delete existing asset first to avoid gh CLI --clobber
race-condition bug
- # (gh release upload --clobber sometimes returns "release not found"
exit 1
- # when deleting an existing asset, even though the upload itself
succeeds).
- # --yes is required: without it gh cannot confirm the prompt on a
runner
- # and the delete silently does nothing, which then made the plain
upload
- # fail because the asset was still there.
- gh release delete-asset "${tag_name}"
"doris-thirdparty-prebuilt-${kernel}-${arch}.tar.xz" --yes || true
- gh release upload --clobber "${tag_name}"
"doris-thirdparty-prebuilt-${kernel}-${arch}.tar.xz"
-
- update-docker:
- name: Update Docker Image
- needs: [prerelease, build]
- if: |
- always() && (
- (needs.prerelease.outputs.should_release == 'true' &&
needs.build.result == 'success') ||
- (github.event_name == 'workflow_dispatch' && needs.build.result !=
'failure')
- )
- runs-on: ubuntu-latest
- env:
- GH_REPO: ${{ github.repository }}
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- steps:
- - name: Checkout docker/setup-buildx-action
- run: |
- rm -rf ./.github/actions/setup-buildx-action
- git clone https://github.com/docker/setup-buildx-action
.github/actions/setup-buildx-action
-
- pushd .github/actions/setup-buildx-action &>/dev/null
- git checkout 8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- popd &>/dev/null
-
- - name: Checkout docker/login-action
- run: |
- rm -rf ./.github/actions/login-action
- git clone https://github.com/docker/login-action
.github/actions/login-action
-
- pushd .github/actions/login-action &>/dev/null
- git checkout c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
- popd &>/dev/null
-
- - name: Checkout docker/build-push-action
- run: |
- rm -rf ./.github/actions/build-push-action
- git clone https://github.com/docker/build-push-action
.github/actions/build-push-action
-
- pushd .github/actions/build-push-action &>/dev/null
- git checkout ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
- popd &>/dev/null
-
- - name: Set up Docker Buildx
- uses: ./.github/actions/setup-buildx-action
-
- - name: Login to Docker Hub
- uses: ./.github/actions/login-action
- with:
- username: ${{ secrets.DOCKERHUB_USERNAME }}
- password: ${{ secrets.DOCKERHUB_TOKEN }}
-
- - name: Prepare Dockerfiles
- run: |
- # Pull the upstream Dockerfile from apache/doris branch-4.0 to stay
in sync with
- # any toolchain / dependency changes they make.
- curl -fsSL
https://raw.githubusercontent.com/apache/doris/branch-4.0/docker/compilation/Dockerfile
\
- -o Dockerfile.upstream
-
- python3 - << 'PYEOF'
- import sys, re
-
- with open('Dockerfile.upstream') as f:
- content = f.read()
-
- # Patch 1: fix epel metalink.
- # The upstream RUN line installs epel-release then immediately runs
yum
- # install/clean/makecache, but epel.repo's metalink may be
unreliable.
- # Insert a sed fix between epel-release install and the next yum
install.
- old_epel = 'yum install epel-release -y && yum install
https://packages.endpointdev.com'
- new_epel = ('yum install epel-release -y \\\n'
- ' && sed -i \\\n'
- ' -e \'s/^metalink=/#metalink=/\' \\\n'
- ' -e
\'s|^#baseurl=http://download.fedoraproject.org/pub/epel/7|baseurl=https://mirrors.aliyun.com/epel/7|\'
\\\n'
- ' /etc/yum.repos.d/epel*.repo \\\n'
- ' && yum install https://packages.endpointdev.com')
- assert old_epel in content, f"Patch 1 failed: target string not
found in upstream Dockerfile"
- patched = content.replace(old_epel, new_epel, 1)
- assert patched != content, "Patch 1 was a no-op: upstream Dockerfile
may have changed"
-
- # Patch 2: replace "clone & build thirdparty" block with downloading
- # our prebuilt artifact. The block starts with "# clone lastest
source
- # code" comment and ends with "rm -rf ${DEFAULT_DIR}/doris".
- prebuilt_block = (
- '# Download prebuilt thirdparty from GitHub Release (built by
doris-thirdparty automation)\n'
- 'ARG GITHUB_REPOSITORY\n'
- 'RUN mkdir -p /var/local/thirdparty \\\n'
- ' && wget -q
"https://github.com/${GITHUB_REPOSITORY}/releases/download/automation-4.0/doris-thirdparty-prebuilt-linux-x86_64.tar.xz"
\\\n'
- ' -O /tmp/prebuilt.tar.xz \\\n'
- ' && tar -xf /tmp/prebuilt.tar.xz -C /var/local/thirdparty
\\\n'
- ' && rm /tmp/prebuilt.tar.xz\n'
- )
- patched_2 = re.sub(
- r'# clone lastest source code.*?rm -rf
\$\{DEFAULT_DIR\}/doris\n',
- prebuilt_block,
- patched, flags=re.DOTALL
- )
- assert patched_2 != patched, "Patch 2 was a no-op: 'clone lastest
source code' block not found in upstream Dockerfile"
- patched = patched_2
-
- # Write normal image Dockerfile
- with open('Dockerfile.patched', 'w') as f:
- f.write(patched)
-
- # Patch 3 (no-avx2): add USE_AVX2=0 to the ENV block in builder
stage.
- # The ENV block ends with PATH=... just before "# install ccache".
- old_avx2 = 'PATH="/var/local/ldb-toolchain/bin/:$PATH"\n #
USE_AVX2=0'
- new_avx2 = 'PATH="/var/local/ldb-toolchain/bin/:$PATH" \\\n
USE_AVX2=0'
- assert old_avx2 in patched, "Patch 3 failed: '# USE_AVX2=0' comment
not found; upstream Dockerfile may have changed"
- noavx2 = patched.replace(old_avx2, new_avx2)
- assert noavx2 != patched, "Patch 3 was a no-op: no-avx2 Dockerfile
is identical to normal Dockerfile"
- with open('Dockerfile.patched-noavx2', 'w') as f:
- f.write(noavx2)
-
- print("=== normal: check ===")
- for line in open('Dockerfile.patched'):
- if any(k in line for k in ['COPY doris', 'build-thirdparty',
'ARG GITHUB', 'prebuilt', 'USE_AVX2']):
- print(line, end='')
- print("=== noavx2: check ===")
- for line in open('Dockerfile.patched-noavx2'):
- if any(k in line for k in ['COPY doris', 'build-thirdparty',
'ARG GITHUB', 'prebuilt', 'USE_AVX2']):
- print(line, end='')
- PYEOF
-
- - name: Build and Push Docker Image (normal)
- uses: ./.github/actions/build-push-action
- with:
- context: .
- file: Dockerfile.patched
- build-args: |
- GITHUB_REPOSITORY=${{ github.repository }}
- push: true
- tags: ${{ vars.DOCKER_TAGS_4_0 ||
'apache/doris:build-env-ldb-toolchain-4.0-latest' }}
- platforms: linux/amd64
-
- - name: Build and Push Docker Image (no-avx2)
- uses: ./.github/actions/build-push-action
- with:
- context: .
- file: Dockerfile.patched-noavx2
- build-args: |
- GITHUB_REPOSITORY=${{ github.repository }}
- push: true
- tags: ${{ vars.DOCKER_TAGS_NOAVX2_4_0 ||
'apache/doris:build-env-ldb-toolchain-4.0-no-avx2-latest' }}
- platforms: linux/amd64
-
- success:
- name: Success
- needs: [prerelease, build, update-docker]
- if: needs.prerelease.outputs.should_release == 'true' ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.force_build ==
'true')
- runs-on: ubuntu-latest
- env:
- GH_REPO: ${{ github.repository }}
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- DORIS_VERSION: ${{ needs.prerelease.outputs.doris_version }}
permissions:
contents: write
- steps:
- - name: Update Checksums
- run: |
- tag_name='automation-4.0'
-
- gh release download "${tag_name}"
-
- # Write the version this run actually built rather than parsing it
back
- # out of the note, so the terminal state never depends on the note
- # having survived intact.
- echo -ne "Update Time: *$(date)*\nDoris Version:
*${DORIS_VERSION}*\nStatus: *SUCCESS*\n\n## SHA256
Checksums\n\`\`\`\n$(sha256sum *)\n\`\`\`" >release_note.md
- gh release edit -F release_note.md "${tag_name}"
-
- failure:
- name: Failure
- needs: [prerelease, build, update-docker]
- # Only report on a build that actually ran. If prerelease itself failed
there
- # is no version to record, and writing an empty one is exactly what used to
- # make the next scheduled run rebuild from scratch, forever.
- if: always() && failure() && needs.prerelease.result == 'success'
- runs-on: ubuntu-latest
- env:
- GH_REPO: ${{ github.repository }}
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- DORIS_VERSION: ${{ needs.prerelease.outputs.doris_version }}
- ATTEMPT: ${{ needs.prerelease.outputs.attempt }}
- permissions:
- contents: write
- steps:
- - name: Update Checksums
- run: |
- tag_name='automation-4.0'
-
- gh release download "${tag_name}"
-
- # Keep Doris Version: the prerelease job keys off it, and dropping it
- # made every scheduled run look like a first release.
- echo -ne "Update Time: *$(date)*\nDoris Version:
*${DORIS_VERSION}*\nStatus: *FAILURE*\nAttempts: *${ATTEMPT}*\n\n## SHA256
Checksums\n\`\`\`\n$(sha256sum *)\n\`\`\`" >release_note.md
- gh release edit -F release_note.md "${tag_name}"
+ uses: ./.github/workflows/build-4.x.yml
+ with:
+ version: '4.0'
+ force_build: ${{ github.event_name == 'workflow_dispatch' &&
github.event.inputs.force_build == 'true' }}
+ image_tags: ${{ vars.DOCKER_TAGS_4_0 }}
+ image_tags_no_avx2: ${{ vars.DOCKER_TAGS_NOAVX2_4_0 }}
diff --git a/.github/workflows/build-4.1.yml b/.github/workflows/build-4.1.yml
new file mode 100644
index 00000000000..a22dc4e3f4d
--- /dev/null
+++ b/.github/workflows/build-4.1.yml
@@ -0,0 +1,47 @@
+# 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.
+
+name: Build (4.1)
+
+on:
+ workflow_dispatch:
+ inputs:
+ force_build:
+ description: "Force run build job when manually triggered"
+ required: false
+ default: "true"
+ schedule:
+ - cron: '*/30 * * * *'
+
+# A full third party build runs for hours while the schedule fires every 30
+# minutes. Without a concurrency group the runs stack up and race each other on
+# the same release tag.
+concurrency:
+ group: ${{ github.workflow }}
+ cancel-in-progress: false
+
+jobs:
+ build:
+ name: Build
+ permissions:
+ contents: write
+ uses: ./.github/workflows/build-4.x.yml
+ with:
+ version: '4.1'
+ force_build: ${{ github.event_name == 'workflow_dispatch' &&
github.event.inputs.force_build == 'true' }}
+ image_tags: ${{ vars.DOCKER_TAGS_4_1 }}
+ image_tags_no_avx2: ${{ vars.DOCKER_TAGS_NOAVX2_4_1 }}
diff --git a/.github/workflows/build-4.2.yml b/.github/workflows/build-4.2.yml
new file mode 100644
index 00000000000..54283406e42
--- /dev/null
+++ b/.github/workflows/build-4.2.yml
@@ -0,0 +1,47 @@
+# 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.
+
+name: Build (4.2)
+
+on:
+ workflow_dispatch:
+ inputs:
+ force_build:
+ description: "Force run build job when manually triggered"
+ required: false
+ default: "true"
+ schedule:
+ - cron: '*/30 * * * *'
+
+# A full third party build runs for hours while the schedule fires every 30
+# minutes. Without a concurrency group the runs stack up and race each other on
+# the same release tag.
+concurrency:
+ group: ${{ github.workflow }}
+ cancel-in-progress: false
+
+jobs:
+ build:
+ name: Build
+ permissions:
+ contents: write
+ uses: ./.github/workflows/build-4.x.yml
+ with:
+ version: '4.2'
+ force_build: ${{ github.event_name == 'workflow_dispatch' &&
github.event.inputs.force_build == 'true' }}
+ image_tags: ${{ vars.DOCKER_TAGS_4_2 }}
+ image_tags_no_avx2: ${{ vars.DOCKER_TAGS_NOAVX2_4_2 }}
diff --git a/.github/workflows/build-4.0.yml b/.github/workflows/build-4.x.yml
similarity index 77%
copy from .github/workflows/build-4.0.yml
copy to .github/workflows/build-4.x.yml
index 1249bb71c8c..7a0da623244 100644
--- a/.github/workflows/build-4.0.yml
+++ b/.github/workflows/build-4.x.yml
@@ -15,24 +15,28 @@
# specific language governing permissions and limitations
# under the License.
-name: Build (4.0)
+name: Build Doris 4.x release
on:
- workflow_dispatch:
+ workflow_call:
inputs:
+ version:
+ description: Doris minor version to build
+ required: true
+ type: string
force_build:
- description: "Force run build job when manually triggered"
- required: false
- default: "true"
- schedule:
- - cron: '*/30 * * * *'
-
-# A full third party build runs for hours while the schedule fires every 30
-# minutes. Without a concurrency group the runs stack up and race each other on
-# the same release tag.
-concurrency:
- group: ${{ github.workflow }}
- cancel-in-progress: false
+ description: Rebuild the source and prebuilt archives even without
changes
+ required: true
+ type: boolean
+ image_tags:
+ description: Optional tags for the ordinary Docker image
+ type: string
+ image_tags_no_avx2:
+ description: Optional tags for the no-AVX2 Docker image
+ type: string
+
+env:
+ RELEASE_TAG: automation-${{ inputs.version }}
jobs:
prerelease:
@@ -52,24 +56,24 @@ jobs:
uses: actions/checkout@v5
with:
repository: 'apache/doris'
- ref: 'branch-4.0'
+ ref: branch-${{ inputs.version }}
fetch-depth: 0
- name: Check Diff
id: check_diff
+ env:
+ FORCE_BUILD: ${{ inputs.force_build }}
run: |
- tag_name='automation-4.0'
- title="Apache Doris Third Party Prebuilt (${tag_name/automation-/})"
+ title="Apache Doris Third Party Prebuilt
(${RELEASE_TAG#automation-})"
max_attempts=3
- if [[ -z "$(gh release list)" ]] ||
- ! gh release list | awk -F "\t" '{ print $3 }' | grep
"${tag_name}" >/dev/null; then
- gh release create -t "${title}" "${tag_name}"
+ if ! gh release view "${RELEASE_TAG}" >/dev/null 2>&1; then
+ gh release create -t "${title}" "${RELEASE_TAG}"
fi
# The release note is the only state this pipeline keeps. Read it
once
# so the three fields below cannot come from three different
revisions.
- note="$(gh release view "${tag_name}")"
+ note="$(gh release view "${RELEASE_TAG}")"
last_version="$(echo "${note}" | sed -n -E 's/Doris Version:
\*(.*)\*.*/\1/p')"
last_status="$(echo "${note}" | sed -n -E 's/Status:
\*(.*)\*.*/\1/p')"
last_attempt="$(echo "${note}" | sed -n -E 's/Attempts:
\*([0-9]+)\*.*/\1/p')"
@@ -89,11 +93,9 @@ jobs:
echo "The first release was detected."
should_release=true
elif [[ "${last_version}" != "${current_version}" ]]; then
- cmd="git diff --name-only ${last_version} ${current_version} |
grep -E '^thirdparty/'"
- echo "Execute: ${cmd}"
- content="$(eval "${cmd}")" || true
- if [[ -n "${content}" ]]; then
- echo -e "Detect changes:\n${content}"
+ changed_files="$(git diff --name-only "${last_version}"
"${current_version}" -- thirdparty/)"
+ if [[ -n "${changed_files}" ]]; then
+ echo -e "Detect changes:\n${changed_files}"
should_release=true
fi
elif [[ "${last_status}" == 'FAILURE' ]] && [[ "${last_attempt}" -lt
"${max_attempts}" ]]; then
@@ -105,25 +107,30 @@ jobs:
should_release=true
fi
+ if [[ "${FORCE_BUILD}" == 'true' ]]; then
+ should_release=true
+ attempt=1
+ fi
+
if "${should_release}"; then
echo -ne "Update Time: *$(date)*\nDoris Version:
*${current_version}*\nStatus: *BUILDING*\nAttempts: *${attempt}*"
>release_note.md
else
- gh release view "${tag_name}" | sed -n '/--/,$p' | awk '{ if (NR >
1) print $0 }' | sed "{
+ gh release view "${RELEASE_TAG}" | sed -n '/--/,$p' | awk '{ if
(NR > 1) print $0 }' | sed "{
s/Update Time:.*/Update Time: *$(date)*/
s/Doris Version:.*/Doris Version: *${current_version}*/
}" >release_note.md
fi
- gh release edit -F release_note.md "${tag_name}"
+ gh release edit -F release_note.md "${RELEASE_TAG}"
- echo "should_release=${should_release}" >> $GITHUB_OUTPUT
- echo "doris_version=${current_version}" >> $GITHUB_OUTPUT
- echo "attempt=${attempt}" >> $GITHUB_OUTPUT
+ {
+ echo "should_release=${should_release}"
+ echo "doris_version=${current_version}"
+ echo "attempt=${attempt}"
+ } >> "${GITHUB_OUTPUT}"
- name: Download Source and Upload
if: steps.check_diff.outputs.should_release == 'true'
run: |
- tag_name='automation-4.0'
-
cd thirdparty
# Pre-download packages whose default mirror is blocked or gone on
GH Actions runners:
# lzo: fossies.org returns 410 Gone
@@ -137,13 +144,13 @@ jobs:
tar -zcvf doris-thirdparty-source.tgz src
- gh release delete-asset "${tag_name}" doris-thirdparty-source.tgz
--yes || true
- gh release upload --clobber "${tag_name}" doris-thirdparty-source.tgz
+ gh release delete-asset "${RELEASE_TAG}" doris-thirdparty-source.tgz
--yes || true
+ gh release upload --clobber "${RELEASE_TAG}"
doris-thirdparty-source.tgz
build:
name: Build
needs: prerelease
- if: needs.prerelease.outputs.should_release == 'true' ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.force_build ==
'true')
+ if: needs.prerelease.outputs.should_release == 'true'
strategy:
fail-fast: false
matrix:
@@ -199,6 +206,8 @@ jobs:
'maven'
runs-on: ${{ matrix.config.os }}
+ permissions:
+ contents: write
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -224,14 +233,12 @@ jobs:
uses: actions/checkout@v5
with:
repository: 'apache/doris'
- ref: 'branch-4.0'
+ ref: ${{ needs.prerelease.outputs.doris_version }}
- name: Download
run: |
- tag_name='automation-4.0'
-
cd thirdparty
- curl -L "https://github.com/${{ github.repository
}}/releases/download/${tag_name}/doris-thirdparty-source.tgz" \
+ curl -L "https://github.com/${{ github.repository
}}/releases/download/${RELEASE_TAG}/doris-thirdparty-source.tgz" \
-o doris-thirdparty-source.tgz
tar -zxvf doris-thirdparty-source.tgz
@@ -262,13 +269,12 @@ jobs:
- name: Build and Upload
run: |
- tag_name='automation-4.0'
-
if [[ "${{ matrix.config.name }}" == 'Linux' ]]; then
export DEFAULT_DIR='/opt/doris'
export PATH="${DEFAULT_DIR}/ldb-toolchain/bin:${PATH}"
- export PATH="$(find /usr/lib/jvm/java-8-openjdk* -maxdepth 1 -type
d -name 'bin'):${PATH}"
- export JAVA_HOME="$(find /usr/lib/jvm/java-8-openjdk* -maxdepth 0)"
+ JAVA_HOME="$(find /usr/lib/jvm/java-8-openjdk* -maxdepth 0)"
+ export JAVA_HOME
+ export PATH="${JAVA_HOME}/bin:${PATH}"
export DORIS_TOOLCHAIN=clang
else
export MACOSX_DEPLOYMENT_TARGET=12.0
@@ -300,21 +306,20 @@ jobs:
# --yes is required: without it gh cannot confirm the prompt on a
runner
# and the delete silently does nothing, which then made the plain
upload
# fail because the asset was still there.
- gh release delete-asset "${tag_name}"
"doris-thirdparty-prebuilt-${kernel}-${arch}.tar.xz" --yes || true
- gh release upload --clobber "${tag_name}"
"doris-thirdparty-prebuilt-${kernel}-${arch}.tar.xz"
+ gh release delete-asset "${RELEASE_TAG}"
"doris-thirdparty-prebuilt-${kernel}-${arch}.tar.xz" --yes || true
+ gh release upload --clobber "${RELEASE_TAG}"
"doris-thirdparty-prebuilt-${kernel}-${arch}.tar.xz"
- update-docker:
- name: Update Docker Image
+ build-docker:
+ name: Build Docker Images
needs: [prerelease, build]
if: |
- always() && (
- (needs.prerelease.outputs.should_release == 'true' &&
needs.build.result == 'success') ||
- (github.event_name == 'workflow_dispatch' && needs.build.result !=
'failure')
- )
+ !cancelled() && needs.prerelease.result == 'success' &&
+ (needs.build.result == 'success' ||
+ (github.event_name == 'workflow_dispatch' && needs.build.result ==
'skipped'))
runs-on: ubuntu-latest
+ permissions: {}
env:
- GH_REPO: ${{ github.repository }}
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ DORIS_VERSION: ${{ needs.prerelease.outputs.doris_version }}
steps:
- name: Checkout docker/setup-buildx-action
run: |
@@ -325,15 +330,6 @@ jobs:
git checkout 8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
popd &>/dev/null
- - name: Checkout docker/login-action
- run: |
- rm -rf ./.github/actions/login-action
- git clone https://github.com/docker/login-action
.github/actions/login-action
-
- pushd .github/actions/login-action &>/dev/null
- git checkout c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
- popd &>/dev/null
-
- name: Checkout docker/build-push-action
run: |
rm -rf ./.github/actions/build-push-action
@@ -346,17 +342,10 @@ jobs:
- name: Set up Docker Buildx
uses: ./.github/actions/setup-buildx-action
- - name: Login to Docker Hub
- uses: ./.github/actions/login-action
- with:
- username: ${{ secrets.DOCKERHUB_USERNAME }}
- password: ${{ secrets.DOCKERHUB_TOKEN }}
-
- name: Prepare Dockerfiles
run: |
- # Pull the upstream Dockerfile from apache/doris branch-4.0 to stay
in sync with
- # any toolchain / dependency changes they make.
- curl -fsSL
https://raw.githubusercontent.com/apache/doris/branch-4.0/docker/compilation/Dockerfile
\
+ # Use the same Doris revision as the prebuilt archives.
+ curl -fsSL
"https://raw.githubusercontent.com/apache/doris/${DORIS_VERSION}/docker/compilation/Dockerfile"
\
-o Dockerfile.upstream
python3 - << 'PYEOF'
@@ -386,8 +375,9 @@ jobs:
prebuilt_block = (
'# Download prebuilt thirdparty from GitHub Release (built by
doris-thirdparty automation)\n'
'ARG GITHUB_REPOSITORY\n'
+ 'ARG RELEASE_TAG\n'
'RUN mkdir -p /var/local/thirdparty \\\n'
- ' && wget -q
"https://github.com/${GITHUB_REPOSITORY}/releases/download/automation-4.0/doris-thirdparty-prebuilt-linux-x86_64.tar.xz"
\\\n'
+ ' && wget -q
"https://github.com/${GITHUB_REPOSITORY}/releases/download/${RELEASE_TAG}/doris-thirdparty-prebuilt-linux-x86_64.tar.xz"
\\\n'
' -O /tmp/prebuilt.tar.xz \\\n'
' && tar -xf /tmp/prebuilt.tar.xz -C /var/local/thirdparty
\\\n'
' && rm /tmp/prebuilt.tar.xz\n'
@@ -424,32 +414,57 @@ jobs:
print(line, end='')
PYEOF
- - name: Build and Push Docker Image (normal)
+ - name: Export Docker Image (normal)
uses: ./.github/actions/build-push-action
with:
context: .
file: Dockerfile.patched
build-args: |
GITHUB_REPOSITORY=${{ github.repository }}
- push: true
- tags: ${{ vars.DOCKER_TAGS_4_0 ||
'apache/doris:build-env-ldb-toolchain-4.0-latest' }}
+ RELEASE_TAG=${{ env.RELEASE_TAG }}
+ outputs: type=docker,dest=${{ runner.temp }}/docker-image-${{
inputs.version }}-amd64.tar
+ tags: ${{ inputs.image_tags ||
format('apache/doris:build-env-ldb-toolchain-{0}-latest', inputs.version) }}
platforms: linux/amd64
- - name: Build and Push Docker Image (no-avx2)
+ - name: Upload Docker Image (normal)
+ uses: actions/upload-artifact@v4
+ with:
+ name: docker-image-${{ inputs.version }}-amd64
+ path: ${{ runner.temp }}/docker-image-${{ inputs.version }}-amd64.tar
+ if-no-files-found: error
+ compression-level: 1
+ retention-days: 7
+ overwrite: true
+
+ - name: Remove uploaded image archive
+ run: rm -f "${RUNNER_TEMP}/docker-image-${{ inputs.version
}}-amd64.tar"
+
+ - name: Export Docker Image (no-avx2)
uses: ./.github/actions/build-push-action
with:
context: .
file: Dockerfile.patched-noavx2
build-args: |
GITHUB_REPOSITORY=${{ github.repository }}
- push: true
- tags: ${{ vars.DOCKER_TAGS_NOAVX2_4_0 ||
'apache/doris:build-env-ldb-toolchain-4.0-no-avx2-latest' }}
+ RELEASE_TAG=${{ env.RELEASE_TAG }}
+ outputs: type=docker,dest=${{ runner.temp }}/docker-image-${{
inputs.version }}-amd64-no-avx2.tar
+ tags: ${{ inputs.image_tags_no_avx2 ||
format('apache/doris:build-env-ldb-toolchain-{0}-no-avx2-latest',
inputs.version) }}
platforms: linux/amd64
+ - name: Upload Docker Image (no-avx2)
+ uses: actions/upload-artifact@v4
+ with:
+ name: docker-image-${{ inputs.version }}-amd64-no-avx2
+ path: ${{ runner.temp }}/docker-image-${{ inputs.version
}}-amd64-no-avx2.tar
+ if-no-files-found: error
+ compression-level: 1
+ retention-days: 7
+ overwrite: true
+
success:
name: Success
- needs: [prerelease, build, update-docker]
- if: needs.prerelease.outputs.should_release == 'true' ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.force_build ==
'true')
+ needs: [prerelease, build, build-docker]
+ if: needs.prerelease.outputs.should_release == 'true'
runs-on: ubuntu-latest
env:
GH_REPO: ${{ github.repository }}
@@ -460,19 +475,17 @@ jobs:
steps:
- name: Update Checksums
run: |
- tag_name='automation-4.0'
-
- gh release download "${tag_name}"
+ gh release download "${RELEASE_TAG}"
# Write the version this run actually built rather than parsing it
back
# out of the note, so the terminal state never depends on the note
# having survived intact.
- echo -ne "Update Time: *$(date)*\nDoris Version:
*${DORIS_VERSION}*\nStatus: *SUCCESS*\n\n## SHA256
Checksums\n\`\`\`\n$(sha256sum *)\n\`\`\`" >release_note.md
- gh release edit -F release_note.md "${tag_name}"
+ echo -ne "Update Time: *$(date)*\nDoris Version:
*${DORIS_VERSION}*\nStatus: *SUCCESS*\n\n## SHA256
Checksums\n\`\`\`\n$(sha256sum -- *)\n\`\`\`" >release_note.md
+ gh release edit -F release_note.md "${RELEASE_TAG}"
failure:
name: Failure
- needs: [prerelease, build, update-docker]
+ needs: [prerelease, build, build-docker]
# Only report on a build that actually ran. If prerelease itself failed
there
# is no version to record, and writing an empty one is exactly what used to
# make the next scheduled run rebuild from scratch, forever.
@@ -488,11 +501,9 @@ jobs:
steps:
- name: Update Checksums
run: |
- tag_name='automation-4.0'
-
- gh release download "${tag_name}"
+ gh release download "${RELEASE_TAG}"
# Keep Doris Version: the prerelease job keys off it, and dropping it
# made every scheduled run look like a first release.
- echo -ne "Update Time: *$(date)*\nDoris Version:
*${DORIS_VERSION}*\nStatus: *FAILURE*\nAttempts: *${ATTEMPT}*\n\n## SHA256
Checksums\n\`\`\`\n$(sha256sum *)\n\`\`\`" >release_note.md
- gh release edit -F release_note.md "${tag_name}"
+ echo -ne "Update Time: *$(date)*\nDoris Version:
*${DORIS_VERSION}*\nStatus: *FAILURE*\nAttempts: *${ATTEMPT}*\n\n## SHA256
Checksums\n\`\`\`\n$(sha256sum -- *)\n\`\`\`" >release_note.md
+ gh release edit -F release_note.md "${RELEASE_TAG}"
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index ece1a7ea8c5..9cac87c0887 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -25,7 +25,7 @@ on:
required: false
default: "true"
docker_only:
- description: "Only rebuild and push Docker images"
+ description: "Only build Docker image artifacts"
required: false
default: "false"
schedule:
@@ -53,7 +53,7 @@ jobs:
contents: write
outputs:
should_release: ${{ steps.check_diff.outputs.should_release }}
- should_update_docker: ${{ steps.check_diff.outputs.should_update_docker
}}
+ should_build_docker: ${{ steps.check_diff.outputs.should_build_docker }}
should_build_macos_x86: ${{
steps.check_diff.outputs.should_build_macos_x86 }}
thirdparty_commit_hash: ${{
steps.check_diff.outputs.thirdparty_commit_hash }}
doris_version: ${{ steps.check_diff.outputs.doris_version }}
@@ -96,21 +96,21 @@ jobs:
echo "Thirdparty Commit: ${thirdparty_commit_hash}"
should_release=false
- should_update_docker=false
+ should_build_docker=false
attempt=1
if [[ -z "${last_version}" ]]; then
echo "The first release was detected."
should_release=true
- should_update_docker=true
+ should_build_docker=true
elif [[ "${last_version}" != "${current_version}" ]]; then
changed_files="$(git diff --name-only "${last_version}"
"${current_version}")"
echo -e "Changed files:\n${changed_files}"
if grep -qE '^thirdparty/' <<<"${changed_files}"; then
should_release=true
- should_update_docker=true
+ should_build_docker=true
fi
if grep -qx 'docker/compilation/Dockerfile' <<<"${changed_files}";
then
- should_update_docker=true
+ should_build_docker=true
fi
elif [[ "${last_status}" == 'FAILURE' ]] && [[ "${last_attempt}" -lt
"${max_attempts}" ]]; then
# Downloads from third party mirrors fail often enough that a
single
@@ -119,7 +119,7 @@ jobs:
attempt=$((last_attempt + 1))
echo "Previous build failed, retrying (attempt
${attempt}/${max_attempts})."
should_release=true
- should_update_docker=true
+ should_build_docker=true
fi
# docker_only takes precedence over force_build because force_build
@@ -127,16 +127,16 @@ jobs:
if [[ "${MANUAL_DOCKER_ONLY}" == 'true' ]]; then
echo 'Manual Docker-only build requested.'
should_release=false
- should_update_docker=true
+ should_build_docker=true
elif [[ "${MANUAL_FORCE_BUILD}" == 'true' ]]; then
echo 'Manual full build requested.'
should_release=true
- should_update_docker=true
+ should_build_docker=true
fi
# Docker-only failures are deterministic image/workflow failures. Do
# not turn their scheduled retry into an expensive full thirdparty
build.
- if [[ "${should_release}" == 'false' ]] && [[
"${should_update_docker}" == 'true' ]]; then
+ if [[ "${should_release}" == 'false' ]] && [[
"${should_build_docker}" == 'true' ]]; then
attempt="${max_attempts}"
fi
@@ -160,7 +160,7 @@ jobs:
fi
fi
- if "${should_release}" || "${should_update_docker}"; then
+ if "${should_release}" || "${should_build_docker}"; then
echo -ne "Update Time: *$(date)*\nDoris Version:
*${current_version}*\nStatus: *BUILDING*\nAttempts: *${attempt}*"
>release_note.md
else
gh release view automation | sed -n '/--/,$p' | awk '{ if (NR > 1)
print $0 }' | sed "{
@@ -172,7 +172,7 @@ jobs:
{
echo "should_release=${should_release}"
- echo "should_update_docker=${should_update_docker}"
+ echo "should_build_docker=${should_build_docker}"
echo "should_build_macos_x86=${should_build_macos_x86}"
echo "thirdparty_commit_hash=${thirdparty_commit_hash}"
echo "doris_version=${current_version}"
@@ -193,7 +193,7 @@ jobs:
gh release delete-asset automation doris-thirdparty-source.tgz --yes
|| true
gh release upload --clobber automation doris-thirdparty-source.tgz
- # One job per platform instead of one matrix job, so that `update-docker`
can depend
+ # One job per platform instead of one matrix job, so that `build-docker` can
depend
# on the Linux x86_64 archive alone. As a matrix it had to wait for all
four: in run
# 31988123966 the archive it consumes was published at 05:19 and the Docker
job did
# not start until 06:58, held up by macOS x86_64.
@@ -247,15 +247,17 @@ jobs:
tolerate_failure: true
thirdparty_commit_hash: ${{
needs.prerelease.outputs.thirdparty_commit_hash }}
- update-docker:
- name: Update Docker Image
+ build-docker:
+ name: Build Docker Images
needs: [prerelease, build-linux-x86_64]
# Only the Linux x86_64 archive goes into the image, so nothing else is
waited for.
if: |
always() &&
needs.build-linux-x86_64.result != 'cancelled' &&
- needs.prerelease.outputs.should_update_docker == 'true'
+ needs.prerelease.outputs.should_build_docker == 'true'
runs-on: ubuntu-latest
+ permissions:
+ contents: read
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -288,15 +290,6 @@ jobs:
git checkout 8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
popd &>/dev/null
- - name: Checkout docker/login-action
- run: |
- rm -rf ./.github/actions/login-action
- git clone https://github.com/docker/login-action
.github/actions/login-action
-
- pushd .github/actions/login-action &>/dev/null
- git checkout c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
- popd &>/dev/null
-
- name: Checkout docker/build-push-action
run: |
rm -rf ./.github/actions/build-push-action
@@ -309,12 +302,6 @@ jobs:
- name: Set up Docker Buildx
uses: ./.github/actions/setup-buildx-action
- - name: Login to Docker Hub
- uses: ./.github/actions/login-action
- with:
- username: ${{ secrets.DOCKERHUB_USERNAME }}
- password: ${{ secrets.DOCKERHUB_TOKEN }}
-
- name: Prepare Dockerfiles
run: |
# Bind the image to the exact Doris revision selected by prerelease.
@@ -371,37 +358,60 @@ jobs:
print(line, end='')
PYEOF
- - name: Build and Push Docker Image (normal)
+ - name: Export Docker Image (normal)
uses: ./.github/actions/build-push-action
with:
context: .
file: Dockerfile.patched
build-args: |
GITHUB_REPOSITORY=${{ github.repository }}
- push: true
+ outputs: type=docker,dest=${{ runner.temp }}/docker-image-amd64.tar
tags: ${{ vars.DOCKER_TAGS ||
'apache/doris:build-env-ldb-toolchain-latest' }}
platforms: linux/amd64
- - name: Build and Push Docker Image (no-avx2)
+ - name: Upload Docker Image (normal)
+ uses: actions/upload-artifact@v4
+ with:
+ name: docker-image-amd64
+ path: ${{ runner.temp }}/docker-image-amd64.tar
+ if-no-files-found: error
+ compression-level: 1
+ retention-days: 7
+ overwrite: true
+
+ - name: Remove uploaded image archive
+ run: rm -f "${RUNNER_TEMP}/docker-image-amd64.tar"
+
+ - name: Export Docker Image (no-avx2)
uses: ./.github/actions/build-push-action
with:
context: .
file: Dockerfile.patched-noavx2
build-args: |
GITHUB_REPOSITORY=${{ github.repository }}
- push: true
+ outputs: type=docker,dest=${{ runner.temp
}}/docker-image-amd64-no-avx2.tar
tags: ${{ vars.DOCKER_TAGS_NOAVX2 ||
'apache/doris:build-env-ldb-toolchain-no-avx2-latest' }}
platforms: linux/amd64
+ - name: Upload Docker Image (no-avx2)
+ uses: actions/upload-artifact@v4
+ with:
+ name: docker-image-amd64-no-avx2
+ path: ${{ runner.temp }}/docker-image-amd64-no-avx2.tar
+ if-no-files-found: error
+ compression-level: 1
+ retention-days: 7
+ overwrite: true
+
success:
name: Success
- needs: [prerelease, build-linux-x86_64, build-linux-arm64,
build-macos-arm64, build-macos-x86_64, update-docker]
+ needs: [prerelease, build-linux-x86_64, build-linux-arm64,
build-macos-arm64, build-macos-x86_64, build-docker]
# `!cancelled() && !failure()` rather than the default: build-macos-x86_64
is
# skipped on most runs, and a skipped dependency would otherwise skip this
job and
# leave the release note stuck at BUILDING forever.
if: |
!cancelled() && !failure() &&
- (needs.prerelease.outputs.should_release == 'true' ||
needs.prerelease.outputs.should_update_docker == 'true')
+ (needs.prerelease.outputs.should_release == 'true' ||
needs.prerelease.outputs.should_build_docker == 'true')
runs-on: ubuntu-latest
env:
GH_REPO: ${{ github.repository }}
@@ -422,7 +432,7 @@ jobs:
failure:
name: Failure
- needs: [prerelease, build-linux-x86_64, build-linux-arm64,
build-macos-arm64, build-macos-x86_64, update-docker]
+ needs: [prerelease, build-linux-x86_64, build-linux-arm64,
build-macos-arm64, build-macos-x86_64, build-docker]
# Only report on a build that actually ran. If prerelease itself failed
there
# is no version to record, and writing an empty one is exactly what used to
# make the next scheduled run rebuild from scratch, forever.
diff --git a/.gitmodules b/.gitmodules
index da3a2939077..297734c8afe 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,9 +1,6 @@
[submodule ".github/actions/setup-buildx-action"]
path = .github/actions/setup-buildx-action
url = https://github.com/docker/setup-buildx-action
-[submodule ".github/actions/login-action"]
- path = .github/actions/login-action
- url = https://github.com/docker/login-action
[submodule ".github/actions/build-push-action"]
path = .github/actions/build-push-action
url = https://github.com/docker/build-push-action
diff --git a/README-docker-images.md b/README-docker-images.md
new file mode 100644
index 00000000000..9b797683e65
--- /dev/null
+++ b/README-docker-images.md
@@ -0,0 +1,69 @@
+<!--
+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.
+-->
+
+# Publish Docker build environment images
+
+The GitHub Actions build workflows produce standard and no-AVX2 Docker images
for `linux/amd64`. Each image is available as a workflow artifact for seven
days.
+
+## Download an image
+
+1. Sign in to GitHub and open the repository's **Actions** tab.
+2. Select the workflow for your Doris version. Open a recent run in which
**Build Docker Images** succeeded.
+3. Under **Artifacts** on the run summary, download the image you want and
extract the ZIP file. It contains a `.tar` archive with the same name as the
artifact.
+
+| Workflow | Artifact | Default Docker Hub image |
+| --- | --- | --- |
+| Build | `docker-image-amd64` | `apache/doris:build-env-ldb-toolchain-latest`
|
+| Build | `docker-image-amd64-no-avx2` |
`apache/doris:build-env-ldb-toolchain-no-avx2-latest` |
+| Build (4.0) | `docker-image-4.0-amd64` |
`apache/doris:build-env-ldb-toolchain-4.0-latest` |
+| Build (4.0) | `docker-image-4.0-amd64-no-avx2` |
`apache/doris:build-env-ldb-toolchain-4.0-no-avx2-latest` |
+| Build (4.1) | `docker-image-4.1-amd64` |
`apache/doris:build-env-ldb-toolchain-4.1-latest` |
+| Build (4.1) | `docker-image-4.1-amd64-no-avx2` |
`apache/doris:build-env-ldb-toolchain-4.1-no-avx2-latest` |
+| Build (4.2) | `docker-image-4.2-amd64` |
`apache/doris:build-env-ldb-toolchain-4.2-latest` |
+| Build (4.2) | `docker-image-4.2-amd64-no-avx2` |
`apache/doris:build-env-ldb-toolchain-4.2-no-avx2-latest` |
+
+To download with the GitHub CLI, sign in with `gh auth login` if needed.
Replace `RUN_ID` with the number after `/actions/runs/` in the run URL. This
command downloads and extracts the standard 4.2 image archive into the current
directory. [GitHub CLI
documentation](https://cli.github.com/manual/gh_run_download)
+
+```bash
+gh run download RUN_ID --repo apache/doris-thirdparty --name
docker-image-4.2-amd64
+```
+
+If you need a fresh artifact, select **Run workflow** on `main`. For
**Build**, set `docker_only` to `true` to reuse the published Linux archive.
The archive must match the latest change to `thirdparty/` in Doris. For the 4.x
workflows, leave `force_build` at its default of `true` to build the
dependencies before exporting the images.
+
+## Load and push the image
+
+Load the extracted archive into Docker. The command prints the image tags it
restored. If the workflow used custom tags, use the tag printed by Docker for
the image you want to publish. [Docker image load
reference](https://docs.docker.com/reference/cli/docker/image/load/)
+
+```bash
+docker image load --input docker-image-4.2-amd64.tar
+```
+
+Sign in to Docker Hub with an account that can push to the destination
repository. The following commands push the standard 4.2 image to
`apache/doris` with its default tag. For a different version or variant, use
the corresponding tag above. [Docker Hub push
guide](https://docs.docker.com/docker-hub/repos/manage/hub-images/push/)
+
+```bash
+docker login
+docker image push apache/doris:build-env-ldb-toolchain-4.2-latest
+```
+
+To publish to your own Docker Hub repository, tag the loaded image with the
destination name before pushing. Replace `YOUR_NAMESPACE` with your Docker Hub
username or organization. [Docker image tag
reference](https://docs.docker.com/reference/cli/docker/image/tag/)
+
+```bash
+docker image tag apache/doris:build-env-ldb-toolchain-4.2-latest
YOUR_NAMESPACE/doris:build-env-ldb-toolchain-4.2-latest
+docker image push YOUR_NAMESPACE/doris:build-env-ldb-toolchain-4.2-latest
+```
diff --git a/README.md b/README.md
index 4f5e3748cf3..bbcfb2bc106 100644
--- a/README.md
+++ b/README.md
@@ -21,6 +21,8 @@ under the License.
This repository is used to manage third-party libraries used in Apache Doris.
Some libraries have not been maintained for a long time, so fork into this
repository for bug fixes and feature development. Each third-party library is
in a separate branch.
+[Download and publish Docker build environment images](README-docker-images.md)
+
# Current Libs
| Lib Name | Branch | Description
| Base version | Source URL
| Latest Tag | CHANGELOG|
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]