Skip to content

Commit 2ee49c8

Browse files
kgpaiinfvg
authored andcommitted
build: Add gRPC, gh, and jq to ubuntu-22.04 container image (facebookincubator#16701)
Summary: - Extract standalone `install_grpc()` function from `install_gcs_sdk_cpp()` in `setup-common.sh` and refactor `install_gcs_sdk_cpp` to reuse it - Add `install_grpc` to `setup-ubuntu.sh`'s `install_velox_deps` so gRPC is built from source and available as a SYSTEM dependency in the container - Install `gh` and `jq` in the ubuntu-22.04 Dockerfile, required by `apache/infrastructure-actions/stash` CI action This enables using `VELOX_DEPENDENCY_SOURCE=SYSTEM` with `VELOX_BUILD_TESTING=ON` in the ubuntu-22.04 container without needing to override `gRPC_SOURCE=BUNDLED` or install CI tools at runtime. Pull Request resolved: facebookincubator#16701 Test Plan: - [ ] Verify the Docker image builds successfully (triggered by the `scripts/` path filter) - [ ] Verify the `install_gcs_sdk_cpp` refactor doesn't break GCS adapter builds - [ ] Once image is published, update PR facebookincubator#16424 to remove `gRPC_SOURCE: BUNDLED` override and runtime `gh`/`jq` installation Reviewed By: pratikpugalia Differential Revision: D95972509 Pulled By: kgpai fbshipit-source-id: c6b9f99ed221c97b8977351f3b859682be5a8198
1 parent 08734f9 commit 2ee49c8

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)