Skip to content

Commit

Permalink
GH-27919: [CI][C++] Add a nightly job to test offline build
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Nov 14, 2024
1 parent d7bc378 commit 5c7bb69
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ci/scripts/cpp_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ set -ex
source_dir=${1}/cpp
build_dir=${2}/cpp

: ${ARROW_OFFLINE:=OFF}
: ${ARROW_USE_CCACHE:=OFF}
: ${BUILD_DOCS_CPP:=OFF}

Expand Down Expand Up @@ -98,6 +99,16 @@ esac
mkdir -p ${build_dir}
pushd ${build_dir}

if [ "${ARROW_OFFLINE}" = "ON" ]; then
${source_dir}/thirdparty/download_dependencies.sh ${PWD}/thirdparty > \
enable_offline_build.sh
. enable_offline_build.sh
# We can't use mv because we can't remove /etc/resolv.conf in Docker
# container.
cp /etc/resolv.conf{,.bak}
echo > /etc/resolv.conf
fi

if [ "${ARROW_EMSCRIPTEN:-OFF}" = "ON" ]; then
if [ "${UBUNTU}" = "20.04" ]; then
echo "arrow emscripten build is not supported on Ubuntu 20.04, run with UBUNTU=22.04"
Expand Down Expand Up @@ -237,6 +248,10 @@ time cmake --build . --target install
# Save disk space by removing large temporary build products
find . -name "*.o" -delete

if [ "${ARROW_OFFLINE}" = "ON" ]; then
cp /etc/resolv.conf{.bak,}
fi

popd

if [ -x "$(command -v ldconfig)" ]; then
Expand Down
8 changes: 8 additions & 0 deletions dev/tasks/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1098,6 +1098,14 @@ tasks:
UBUNTU: 20.04
image: ubuntu-cpp-bundled

test-ubuntu-24.04-cpp-bundled-offline:
ci: github
template: docker-tests/github.linux.yml
params:
env:
UBUNTU: 24.04
image: ubuntu-cpp-bundled-offline

test-ubuntu-24.04-cpp-gcc-13-bundled:
ci: github
template: docker-tests/github.linux.yml
Expand Down
25 changes: 25 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ x-hierarchy:
- ubuntu-r
- ubuntu-r-only-r
- ubuntu-cpp-bundled
- ubuntu-cpp-bundled-offline
- ubuntu-cpp-minimal
- ubuntu-cuda-cpp:
- ubuntu-cuda-python
Expand Down Expand Up @@ -484,6 +485,30 @@ services:
volumes: *ubuntu-volumes
command: *cpp-command

ubuntu-cpp-bundled-offline:
# Arrow build with BUNDLED dependencies with downloaded dependencies.
image: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-cpp-minimal
build:
context: .
dockerfile: ci/docker/ubuntu-${UBUNTU}-cpp-minimal.dockerfile
cache_from:
- ${REPO}:${ARCH}-ubuntu-${UBUNTU}-cpp-minimal
args:
arch: ${ARCH}
base: "${ARCH}/ubuntu:${UBUNTU}"
llvm: ${LLVM}
shm_size: *shm-size
ulimits: *ulimits
environment:
<<: [*common, *ccache, *sccache, *cpp]
ARROW_DEPENDENCY_SOURCE: BUNDLED
ARROW_OFFLINE: ON
# Apache ORC always uses external orc-format.
ARROW_ORC: OFF
CMAKE_GENERATOR: "Unix Makefiles"
volumes: *ubuntu-volumes
command: *cpp-command

ubuntu-cpp-minimal:
# Arrow build with minimal components/dependencies
image: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-cpp-minimal
Expand Down

0 comments on commit 5c7bb69

Please sign in to comment.