Skip to content

Commit 21ec15a

Browse files
committed
build: Add gRPC, gh, and jq to ubuntu-22.04 container image
Add gRPC build from source to the Ubuntu container image so that VELOX_BUILD_TESTING=ON works with SYSTEM dependency resolution without needing to override gRPC_SOURCE=BUNDLED. Also install gh and jq CLI tools needed by the apache/infrastructure-actions/stash CI action. Changes: - Extract install_grpc() from install_gcs_sdk_cpp() in setup-common.sh - Call install_grpc in setup-ubuntu.sh install_velox_deps - Refactor install_gcs_sdk_cpp to reuse install_protobuf and install_grpc - Add gh and jq installation to ubuntu-22.04-cpp.dockerfile
1 parent 15879ed commit 21ec15a

File tree

3 files changed

+27
-20
lines changed

3 files changed

+27
-20
lines changed

scripts/docker/ubuntu-22.04-cpp.dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,14 @@ ARG tz="Etc/UTC"
3737
ENV TZ=${tz}
3838
RUN /bin/bash -o pipefail /velox/scripts/setup-ubuntu.sh
3939

40+
# Install tools needed for CI (gh for GitHub Actions stash, jq for JSON parsing)
41+
RUN apt-get update && \
42+
apt-get install -y -q --no-install-recommends jq && \
43+
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
44+
| dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg && \
45+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" \
46+
| tee /etc/apt/sources.list.d/github-cli.list > /dev/null && \
47+
apt-get update && apt-get install -y -q --no-install-recommends gh && \
48+
apt-get clean && rm -rf /var/lib/apt/lists/*
49+
4050
WORKDIR /velox

scripts/setup-common.sh

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,19 @@ function install_protobuf {
113113
cmake_install_dir protobuf -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_ABSL_PROVIDER=package
114114
}
115115

116+
function install_grpc {
117+
github_checkout grpc/grpc "${GRPC_VERSION}" --depth 1
118+
cmake_install_dir grpc \
119+
-DgRPC_BUILD_TESTS=OFF \
120+
-DgRPC_ABSL_PROVIDER=package \
121+
-DgRPC_ZLIB_PROVIDER=package \
122+
-DgRPC_CARES_PROVIDER=package \
123+
-DgRPC_RE2_PROVIDER=package \
124+
-DgRPC_SSL_PROVIDER=package \
125+
-DgRPC_PROTOBUF_PROVIDER=package \
126+
-DgRPC_INSTALL=ON
127+
}
128+
116129
function install_double_conversion {
117130
wget_and_untar https://github.com/google/double-conversion/archive/refs/tags/"${DOUBLE_CONVERSION_VERSION}".tar.gz double-conversion
118131
cmake_install_dir double-conversion -DBUILD_TESTING=OFF
@@ -310,26 +323,9 @@ function install_gcs_sdk_cpp {
310323
# Install gcs dependencies
311324
# https://github.com/googleapis/google-cloud-cpp/blob/main/doc/packaging.md#required-libraries
312325

313-
# abseil-cpp
314-
install_abseil
315-
316-
# protobuf
317-
github_checkout protocolbuffers/protobuf v"${PROTOBUF_VERSION}" --depth 1
318-
cmake_install_dir protobuf \
319-
-Dprotobuf_BUILD_TESTS=OFF \
320-
-Dprotobuf_ABSL_PROVIDER=package
321-
322-
# grpc
323-
github_checkout grpc/grpc "${GRPC_VERSION}" --depth 1
324-
cmake_install_dir grpc \
325-
-DgRPC_BUILD_TESTS=OFF \
326-
-DgRPC_ABSL_PROVIDER=package \
327-
-DgRPC_ZLIB_PROVIDER=package \
328-
-DgRPC_CARES_PROVIDER=package \
329-
-DgRPC_RE2_PROVIDER=package \
330-
-DgRPC_SSL_PROVIDER=package \
331-
-DgRPC_PROTOBUF_PROVIDER=package \
332-
-DgRPC_INSTALL=ON
326+
# abseil-cpp, protobuf, grpc
327+
install_protobuf
328+
install_grpc
333329

334330
# crc32
335331
github_checkout google/crc32c "${CRC32_VERSION}" --depth 1

scripts/setup-ubuntu.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ function install_velox_deps {
232232
run_and_time install_velox_deps_from_apt
233233
run_and_time install_fmt
234234
run_and_time install_protobuf
235+
run_and_time install_grpc
235236
run_and_time install_boost
236237
run_and_time install_fast_float
237238
run_and_time install_folly

0 commit comments

Comments
 (0)