Skip to content

Commit f633f3b

Browse files
committed
fix(ci): host checkout + docker manylinux2014 for glibc217
Job container cannot run Node-based actions on glibc 2.17. Run checkout/cache on ubuntu-latest and build inside manylinux2014 via docker run; use preinstalled devtoolset-10 in the image.
1 parent 6226915 commit f633f3b

2 files changed

Lines changed: 56 additions & 26 deletions

File tree

.github/scripts/package-client-cpp-centos7.sh

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,19 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616
#
17-
# Build client-cpp on manylinux2014 (CentOS 7, glibc 2.17 baseline) with devtoolset-8.
17+
# Build client-cpp for glibc 2.17 baseline (manylinux2014 or CentOS 7 + devtoolset-8).
1818
set -euxo pipefail
1919

20+
run_maven_build() {
21+
gcc --version
22+
cmake --version
23+
java -version
24+
cd "${GITHUB_WORKSPACE:?GITHUB_WORKSPACE is not set}"
25+
./mvnw clean package -P with-cpp -pl iotdb-client/client-cpp -am -DskipTests \
26+
-Dspotless.skip=true \
27+
-Dclient.cpp.package.classifier=linux-x86_64-glibc217
28+
}
29+
2030
# CentOS 7 EOL: redirect yum repos to vault.centos.org (see CentOS wiki / SIG SCLo).
2131
fix_yum_vault_repos() {
2232
local repo
@@ -59,16 +69,24 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
5969
EOF
6070
}
6171

62-
fix_yum_vault_repos
63-
yum install -y ca-certificates centos-release-scl epel-release
64-
write_sclo_vault_repos
65-
fix_yum_vault_repos
66-
yum clean all
67-
yum makecache -y
72+
install_centos7_devtoolset8() {
73+
fix_yum_vault_repos
74+
yum install -y ca-certificates centos-release-scl epel-release
75+
write_sclo_vault_repos
76+
fix_yum_vault_repos
77+
yum clean all
78+
yum makecache -y
79+
yum install -y devtoolset-8-gcc devtoolset-8-gcc-c++ devtoolset-8-binutils \
80+
devtoolset-8-libstdc++-devel scl-utils \
81+
make wget tar which git patch unzip bzip2
82+
}
6883

69-
yum install -y devtoolset-8-gcc devtoolset-8-gcc-c++ devtoolset-8-binutils \
70-
devtoolset-8-libstdc++-devel scl-utils \
71-
make wget tar which git patch unzip bzip2
84+
if [[ -x /opt/rh/devtoolset-10/root/usr/bin/gcc ]]; then
85+
# manylinux2014_x86_64 ships devtoolset-10 on PATH for glibc 2.17-compatible builds.
86+
yum install -y wget tar which git patch unzip bzip2 || true
87+
else
88+
install_centos7_devtoolset8
89+
fi
7290

7391
CMAKE_VERSION=3.28.4
7492
CMAKE_DIR=/opt/cmake-${CMAKE_VERSION}
@@ -96,16 +114,20 @@ fi
96114
export PATH="${CMAKE_DIR}/bin:${JAVA_HOME}/bin:${PATH}"
97115
export JAVA_HOME
98116

99-
scl enable devtoolset-8 -- bash -c '
100-
set -euxo pipefail
101-
gcc --version
102-
cmake --version
103-
java -version
104-
cd "${GITHUB_WORKSPACE:?GITHUB_WORKSPACE is not set}"
105-
./mvnw clean package -P with-cpp -pl iotdb-client/client-cpp -am -DskipTests \
106-
-Dspotless.skip=true \
107-
-Dclient.cpp.package.classifier=linux-x86_64-glibc217
108-
'
117+
if [[ -x /opt/rh/devtoolset-10/root/usr/bin/gcc ]]; then
118+
run_maven_build
119+
else
120+
scl enable devtoolset-8 -- bash -c '
121+
set -euxo pipefail
122+
gcc --version
123+
cmake --version
124+
java -version
125+
cd "${GITHUB_WORKSPACE:?GITHUB_WORKSPACE is not set}"
126+
./mvnw clean package -P with-cpp -pl iotdb-client/client-cpp -am -DskipTests \
127+
-Dspotless.skip=true \
128+
-Dclient.cpp.package.classifier=linux-x86_64-glibc217
129+
'
130+
fi
109131

110132
SO="iotdb-client/client-cpp/target/install/lib/libiotdb_session.so"
111133
test -f "${SO}"

.github/workflows/client-cpp-package.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,12 @@ jobs:
159159
name: Package (linux-x86_64-glibc217)
160160
needs: [should-package, resolve-matrix]
161161
if: needs.should-package.outputs.run == 'true' && needs.resolve-matrix.outputs.run_linux == 'true'
162+
# Checkout/cache on host (Node actions need modern glibc); build in manylinux2014 via docker run.
162163
runs-on: ubuntu-latest
163-
container:
164-
image: quay.io/pypa/manylinux2014_x86_64
165164
steps:
166-
- uses: actions/checkout@v4
165+
- uses: actions/checkout@v5
167166
- name: Cache Maven packages
168-
uses: actions/cache@v4
167+
uses: actions/cache@v5
169168
with:
170169
path: ~/.m2
171170
key: linux-glibc217-m2-${{ hashFiles('**/pom.xml') }}
@@ -176,7 +175,16 @@ jobs:
176175
run: |
177176
set -euxo pipefail
178177
chmod +x .github/scripts/package-client-cpp-centos7.sh
179-
bash .github/scripts/package-client-cpp-centos7.sh
178+
docker run --rm \
179+
-v "${{ github.workspace }}:/workspace" \
180+
-v "${HOME}/.m2:/root/.m2" \
181+
-w /workspace \
182+
-e GITHUB_WORKSPACE=/workspace \
183+
quay.io/pypa/manylinux2014_x86_64 \
184+
bash .github/scripts/package-client-cpp-centos7.sh
185+
- name: Restore workspace ownership after container build
186+
if: always()
187+
run: sudo chown -R "$(id -u):$(id -g)" "${{ github.workspace }}"
180188
- name: Resolve package zip
181189
id: pkg
182190
shell: bash
@@ -191,7 +199,7 @@ jobs:
191199
echo "path=${zips[0]}" >> "$GITHUB_OUTPUT"
192200
echo "name=$(basename "${zips[0]}" .zip)" >> "$GITHUB_OUTPUT"
193201
- name: Upload zip artifact
194-
uses: actions/upload-artifact@v4
202+
uses: actions/upload-artifact@v6
195203
with:
196204
name: ${{ steps.pkg.outputs.name }}
197205
path: ${{ steps.pkg.outputs.path }}

0 commit comments

Comments
 (0)