Skip to content

Commit 68a7622

Browse files
authored
ci(github): build third-party images independently per OS version to prevent a single OS build failure from breaking the entire build (#2346)
Currently, the third-party images used for CI are built in roughly two stages: the first stage builds the *src* images, and the second stage builds the *bin* images. In each stage, images are built for multiple OS versions. If the src image build fails for **any** OS version, all bin image builds are canceled. In practice, this is not ideal. The likelihood of build failures differs across OS versions — for example, older OS versions are more prone to issues. A failure in a single older OS version can block the entire third-party image build process. This PR improves the process by fully decoupling image builds across different OS versions so they do not affect each other. If a third-party image build fails for one OS version, it can be fixed independently without impacting the builds for other OS versions.
1 parent abddf21 commit 68a7622

File tree

2 files changed

+191
-185
lines changed

2 files changed

+191
-185
lines changed
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: BuildThirdpartyDocker - build and publish thirdparty
19+
20+
on:
21+
workflow_call:
22+
inputs:
23+
osversion:
24+
required: true
25+
type: string
26+
27+
jobs:
28+
build_push_src_docker_images:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
- name: Set up QEMU
33+
uses: docker/setup-qemu-action@v1
34+
- name: Set up Docker Buildx
35+
uses: docker/setup-buildx-action@v1
36+
- name: Login to DockerHub
37+
uses: docker/login-action@v1
38+
with:
39+
username: ${{ secrets.DOCKERHUB_USER }}
40+
password: ${{ secrets.DOCKERHUB_TOKEN }}
41+
- name: Build and push
42+
uses: docker/[email protected]
43+
with:
44+
context: .
45+
file: ./docker/thirdparties-src/Dockerfile
46+
push: true
47+
tags: |
48+
apache/pegasus:thirdparties-src-${{ inputs.osversion }}-${{ github.ref_name }}
49+
build-args: |
50+
GITHUB_BRANCH=${{ github.ref_name }}
51+
OS_VERSION=${{ inputs.osversion }}
52+
HADOOP_BIN_PATH=hadoop-bin
53+
ZOOKEEPER_BIN_PATH=zookeeper-bin
54+
55+
build_push_bin_docker_images:
56+
runs-on: ubuntu-latest
57+
env:
58+
# The glibc version on ubuntu1804 is lower than the node20 required, so
59+
# we need to force the node version to 16.
60+
# See more details: https://github.com/actions/checkout/issues/1809
61+
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
62+
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
63+
needs: build_push_src_docker_images
64+
steps:
65+
# The glibc version on ubuntu1804 is lower than the actions/checkout@v4 required, so
66+
# we need to force to use actions/checkout@v3.
67+
- uses: actions/checkout@v3
68+
- name: Set up QEMU
69+
uses: docker/setup-qemu-action@v1
70+
- name: Set up Docker Buildx
71+
uses: docker/setup-buildx-action@v1
72+
- name: Login to DockerHub
73+
uses: docker/login-action@v1
74+
with:
75+
username: ${{ secrets.DOCKERHUB_USER }}
76+
password: ${{ secrets.DOCKERHUB_TOKEN }}
77+
- name: Build and push for production
78+
uses: docker/[email protected]
79+
with:
80+
context: .
81+
file: ./docker/thirdparties-bin/Dockerfile
82+
push: true
83+
tags: |
84+
apache/pegasus:thirdparties-bin-${{ inputs.osversion }}-${{ github.ref_name }}
85+
build-args: |
86+
GITHUB_BRANCH=${{ github.ref_name }}
87+
OS_VERSION=${{ inputs.osversion }}
88+
HADOOP_BIN_PATH=hadoop-bin
89+
ZOOKEEPER_BIN_PATH=zookeeper-bin
90+
91+
build_push_bin_jemalloc_docker_images:
92+
runs-on: ubuntu-latest
93+
env:
94+
# The glibc version on ubuntu1804 is lower than the node20 required, so
95+
# we need to force the node version to 16.
96+
# See more details: https://github.com/actions/checkout/issues/1809
97+
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
98+
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
99+
needs: build_push_src_docker_images
100+
steps:
101+
# The glibc version on ubuntu1804 is lower than the actions/checkout@v4 required, so
102+
# we need to force to use actions/checkout@v3.
103+
- uses: actions/checkout@v3
104+
- name: Set up QEMU
105+
uses: docker/setup-qemu-action@v1
106+
- name: Set up Docker Buildx
107+
uses: docker/setup-buildx-action@v1
108+
- name: Login to DockerHub
109+
uses: docker/login-action@v1
110+
with:
111+
username: ${{ secrets.DOCKERHUB_USER }}
112+
password: ${{ secrets.DOCKERHUB_TOKEN }}
113+
- name: Build and push for production with jemalloc
114+
uses: docker/[email protected]
115+
with:
116+
context: .
117+
file: ./docker/thirdparties-bin/Dockerfile
118+
push: true
119+
tags: |
120+
apache/pegasus:thirdparties-bin-jemallc-${{ inputs.osversion }}-${{ github.ref_name }}
121+
build-args: |
122+
GITHUB_BRANCH=${{ github.ref_name }}
123+
OS_VERSION=${{ inputs.osversion }}
124+
USE_JEMALLOC=ON
125+
HADOOP_BIN_PATH=hadoop-bin
126+
ZOOKEEPER_BIN_PATH=zookeeper-bin
127+
128+
build_push_bin_test_docker_images:
129+
runs-on: ubuntu-latest
130+
needs: build_push_src_docker_images
131+
steps:
132+
- uses: actions/checkout@v4
133+
- name: Set up QEMU
134+
uses: docker/setup-qemu-action@v1
135+
- name: Set up Docker Buildx
136+
uses: docker/setup-buildx-action@v1
137+
- name: Login to DockerHub
138+
uses: docker/login-action@v1
139+
with:
140+
username: ${{ secrets.DOCKERHUB_USER }}
141+
password: ${{ secrets.DOCKERHUB_TOKEN }}
142+
- name: Build and push for test
143+
uses: docker/[email protected]
144+
with:
145+
context: .
146+
file: ./docker/thirdparties-bin/Dockerfile
147+
push: true
148+
tags: |
149+
apache/pegasus:thirdparties-bin-test-${{ inputs.osversion }}-${{ github.ref_name }}
150+
build-args: |
151+
GITHUB_BRANCH=${{ github.ref_name }}
152+
OS_VERSION=${{ inputs.osversion }}
153+
ROCKSDB_PORTABLE=1
154+
HADOOP_BIN_PATH=hadoop-bin
155+
ZOOKEEPER_BIN_PATH=zookeeper-bin
156+
157+
build_push_bin_test_jemalloc_docker_images:
158+
runs-on: ubuntu-latest
159+
needs: build_push_src_docker_images
160+
steps:
161+
- uses: actions/checkout@v4
162+
- name: Set up QEMU
163+
uses: docker/setup-qemu-action@v1
164+
- name: Set up Docker Buildx
165+
uses: docker/setup-buildx-action@v1
166+
- name: Login to DockerHub
167+
uses: docker/login-action@v1
168+
with:
169+
username: ${{ secrets.DOCKERHUB_USER }}
170+
password: ${{ secrets.DOCKERHUB_TOKEN }}
171+
- name: Build and push for test with jemalloc
172+
uses: docker/[email protected]
173+
with:
174+
context: .
175+
file: ./docker/thirdparties-bin/Dockerfile
176+
push: true
177+
tags: |
178+
apache/pegasus:thirdparties-bin-test-jemallc-${{ inputs.osversion }}-${{ github.ref_name }}
179+
build-args: |
180+
GITHUB_BRANCH=${{ github.ref_name }}
181+
OS_VERSION=${{ inputs.osversion }}
182+
ROCKSDB_PORTABLE=1
183+
USE_JEMALLOC=ON
184+
HADOOP_BIN_PATH=hadoop-bin
185+
ZOOKEEPER_BIN_PATH=zookeeper-bin

.github/workflows/thirdparty-regular-push.yml

Lines changed: 6 additions & 185 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
---
18-
name: BuildThirdpartyDockerRegularly - build and publish thirdparty every week
18+
name: BuildThirdpartyDockerRegularly - build and publish thirdparty every week
1919

2020
on:
2121
push:
@@ -40,8 +40,7 @@ on:
4040
- cron: '0 18 * * 1'
4141

4242
jobs:
43-
build_push_src_docker_images:
44-
runs-on: ubuntu-latest
43+
build_push_thirdparty_docker_images:
4544
strategy:
4645
fail-fast: false
4746
matrix:
@@ -50,185 +49,7 @@ jobs:
5049
- ubuntu2004
5150
- ubuntu2204
5251
- rockylinux9
53-
steps:
54-
- uses: actions/checkout@v4
55-
- name: Set up QEMU
56-
uses: docker/setup-qemu-action@v1
57-
- name: Set up Docker Buildx
58-
uses: docker/setup-buildx-action@v1
59-
- name: Login to DockerHub
60-
uses: docker/login-action@v1
61-
with:
62-
username: ${{ secrets.DOCKERHUB_USER }}
63-
password: ${{ secrets.DOCKERHUB_TOKEN }}
64-
- name: Build and push
65-
uses: docker/[email protected]
66-
with:
67-
context: .
68-
file: ./docker/thirdparties-src/Dockerfile
69-
push: true
70-
tags: |
71-
apache/pegasus:thirdparties-src-${{ matrix.osversion }}-${{ github.ref_name }}
72-
build-args: |
73-
GITHUB_BRANCH=${{ github.ref_name }}
74-
OS_VERSION=${{ matrix.osversion }}
75-
HADOOP_BIN_PATH=hadoop-bin
76-
ZOOKEEPER_BIN_PATH=zookeeper-bin
77-
78-
build_push_bin_docker_images:
79-
runs-on: ubuntu-latest
80-
env:
81-
# The glibc version on ubuntu1804 is lower than the node20 required, so
82-
# we need to force the node version to 16.
83-
# See more details: https://github.com/actions/checkout/issues/1809
84-
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
85-
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
86-
needs: build_push_src_docker_images
87-
strategy:
88-
fail-fast: false
89-
matrix:
90-
osversion:
91-
- ubuntu1804
92-
- ubuntu2004
93-
- ubuntu2204
94-
- rockylinux9
95-
steps:
96-
# The glibc version on ubuntu1804 is lower than the actions/checkout@v4 required, so
97-
# we need to force to use actions/checkout@v3.
98-
- uses: actions/checkout@v3
99-
- name: Set up QEMU
100-
uses: docker/setup-qemu-action@v1
101-
- name: Set up Docker Buildx
102-
uses: docker/setup-buildx-action@v1
103-
- name: Login to DockerHub
104-
uses: docker/login-action@v1
105-
with:
106-
username: ${{ secrets.DOCKERHUB_USER }}
107-
password: ${{ secrets.DOCKERHUB_TOKEN }}
108-
- name: Build and push for production
109-
uses: docker/[email protected]
110-
with:
111-
context: .
112-
file: ./docker/thirdparties-bin/Dockerfile
113-
push: true
114-
tags: |
115-
apache/pegasus:thirdparties-bin-${{ matrix.osversion }}-${{ github.ref_name }}
116-
build-args: |
117-
GITHUB_BRANCH=${{ github.ref_name }}
118-
OS_VERSION=${{ matrix.osversion }}
119-
HADOOP_BIN_PATH=hadoop-bin
120-
ZOOKEEPER_BIN_PATH=zookeeper-bin
121-
122-
build_push_bin_jemalloc_docker_images:
123-
runs-on: ubuntu-latest
124-
env:
125-
# The glibc version on ubuntu1804 is lower than the node20 required, so
126-
# we need to force the node version to 16.
127-
# See more details: https://github.com/actions/checkout/issues/1809
128-
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
129-
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
130-
needs: build_push_src_docker_images
131-
strategy:
132-
fail-fast: false
133-
matrix:
134-
osversion:
135-
- ubuntu1804
136-
- ubuntu2004
137-
- ubuntu2204
138-
- rockylinux9
139-
steps:
140-
# The glibc version on ubuntu1804 is lower than the actions/checkout@v4 required, so
141-
# we need to force to use actions/checkout@v3.
142-
- uses: actions/checkout@v3
143-
- name: Set up QEMU
144-
uses: docker/setup-qemu-action@v1
145-
- name: Set up Docker Buildx
146-
uses: docker/setup-buildx-action@v1
147-
- name: Login to DockerHub
148-
uses: docker/login-action@v1
149-
with:
150-
username: ${{ secrets.DOCKERHUB_USER }}
151-
password: ${{ secrets.DOCKERHUB_TOKEN }}
152-
- name: Build and push for production with jemalloc
153-
uses: docker/[email protected]
154-
with:
155-
context: .
156-
file: ./docker/thirdparties-bin/Dockerfile
157-
push: true
158-
tags: |
159-
apache/pegasus:thirdparties-bin-jemallc-${{ matrix.osversion }}-${{ github.ref_name }}
160-
build-args: |
161-
GITHUB_BRANCH=${{ github.ref_name }}
162-
OS_VERSION=${{ matrix.osversion }}
163-
USE_JEMALLOC=ON
164-
HADOOP_BIN_PATH=hadoop-bin
165-
ZOOKEEPER_BIN_PATH=zookeeper-bin
166-
167-
build_push_bin_test_docker_images:
168-
runs-on: ubuntu-latest
169-
needs: build_push_src_docker_images
170-
strategy:
171-
fail-fast: false
172-
matrix:
173-
osversion:
174-
- ubuntu2204
175-
steps:
176-
- uses: actions/checkout@v4
177-
- name: Set up QEMU
178-
uses: docker/setup-qemu-action@v1
179-
- name: Set up Docker Buildx
180-
uses: docker/setup-buildx-action@v1
181-
- name: Login to DockerHub
182-
uses: docker/login-action@v1
183-
with:
184-
username: ${{ secrets.DOCKERHUB_USER }}
185-
password: ${{ secrets.DOCKERHUB_TOKEN }}
186-
- name: Build and push for test
187-
uses: docker/[email protected]
188-
with:
189-
context: .
190-
file: ./docker/thirdparties-bin/Dockerfile
191-
push: true
192-
tags: |
193-
apache/pegasus:thirdparties-bin-test-${{ matrix.osversion }}-${{ github.ref_name }}
194-
build-args: |
195-
GITHUB_BRANCH=${{ github.ref_name }}
196-
OS_VERSION=${{ matrix.osversion }}
197-
ROCKSDB_PORTABLE=1
198-
HADOOP_BIN_PATH=hadoop-bin
199-
ZOOKEEPER_BIN_PATH=zookeeper-bin
200-
201-
build_push_bin_test_jemalloc_docker_images:
202-
runs-on: ubuntu-latest
203-
needs: build_push_src_docker_images
204-
strategy:
205-
fail-fast: false
206-
matrix:
207-
osversion:
208-
- ubuntu2204
209-
steps:
210-
- uses: actions/checkout@v4
211-
- name: Set up QEMU
212-
uses: docker/setup-qemu-action@v1
213-
- name: Set up Docker Buildx
214-
uses: docker/setup-buildx-action@v1
215-
- name: Login to DockerHub
216-
uses: docker/login-action@v1
217-
with:
218-
username: ${{ secrets.DOCKERHUB_USER }}
219-
password: ${{ secrets.DOCKERHUB_TOKEN }}
220-
- name: Build and push for test with jemalloc
221-
uses: docker/[email protected]
222-
with:
223-
context: .
224-
file: ./docker/thirdparties-bin/Dockerfile
225-
push: true
226-
tags: |
227-
apache/pegasus:thirdparties-bin-test-jemallc-${{ matrix.osversion }}-${{ github.ref_name }}
228-
build-args: |
229-
GITHUB_BRANCH=${{ github.ref_name }}
230-
OS_VERSION=${{ matrix.osversion }}
231-
ROCKSDB_PORTABLE=1
232-
USE_JEMALLOC=ON
233-
HADOOP_BIN_PATH=hadoop-bin
234-
ZOOKEEPER_BIN_PATH=zookeeper-bin
52+
uses: "./.github/workflows/build-push-thirdparty.yml"
53+
with:
54+
osversion: ${{ matrix.osversion }}
55+
secrets: inherit

0 commit comments

Comments
 (0)