Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-27919: [CI][C++] Add a nightly job to test offline build #44721

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
9 changes: 9 additions & 0 deletions dev/tasks/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1098,6 +1098,15 @@ 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
raulcd marked this conversation as resolved.
Show resolved Hide resolved
timeout: 120

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]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will admit that my knowledge is slightly sketchy here, but do we want ccache and sccache here? Is it possible those could contain built artifacts that aren't offline?

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
Loading