This is an automated email from the ASF dual-hosted git repository.

ethanfeng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/celeborn.git


The following commit(s) were added to refs/heads/main by this push:
     new 71bd45577 [CELEBORN-1724][CIP-14] Add environment setup tools for 
CppClient development
71bd45577 is described below

commit 71bd45577aae39e09af137268d898fe303aa10b8
Author: HolyLow <[email protected]>
AuthorDate: Fri Nov 22 19:58:45 2024 +0800

    [CELEBORN-1724][CIP-14] Add environment setup tools for CppClient 
development
    
    ### What changes were proposed in this pull request?
    This PR adds environment setup tools, docker image & container especially, 
for CppClient development.
    
    ### Why are the changes needed?
    To develop CppClient functionality and solve library dependencies.
    
    ### Does this PR introduce _any_ user-facing change?
    No.
    
    ### How was this patch tested?
    E2E.
    
    Closes #2927 from HolyLow/issue/celeborn-1724-add-cppClient-devTools.
    
    Authored-by: HolyLow <[email protected]>
    Signed-off-by: mingji <[email protected]>
---
 cpp/README.md                           |  39 ++++++
 cpp/scripts/build-docker-image.sh       |  22 ++++
 cpp/scripts/docker-vars.sh              |  19 +++
 cpp/scripts/launch-docker-container.sh  |  33 +++++
 cpp/scripts/setup-helper-functions.sh   | 221 ++++++++++++++++++++++++++++++++
 cpp/scripts/setup-ubuntu.sh             | 205 +++++++++++++++++++++++++++++
 cpp/scripts/ubuntu-22.04-cpp.dockerfile |  26 ++++
 7 files changed, 565 insertions(+)

diff --git a/cpp/README.md b/cpp/README.md
new file mode 100644
index 000000000..3c25b5cc3
--- /dev/null
+++ b/cpp/README.md
@@ -0,0 +1,39 @@
+# [WIP] Celeborn Cpp Support
+
+## Environment Setup
+We provide several methods to setup dev environment for CelebornCpp.
+Note that currently the scripts only take care of the cpp-related 
dependencies, 
+and java dependencies are not included.
+
+### Use container with prebuilt image
+We provide a pre-built image ready to be pulled and used so you could launch a 
container directly:
+```
+export PROJECT_DIR=/your/path/to/celeborn/dir
+docker run \
+    -v ${PROJECT_DIR}:/celeborn \
+    -w /celeborn \
+    -it --rm \
+    --name celeborn-cpp-dev-container \
+    holylow/celeborn-cpp-dev:0.1 \
+    /bin/bash
+```
+
+### Build image and use container
+We provide the dev image building scripts so you could build the image and 
launch a container as follows:
+```
+cd scripts
+
+# build image
+bash ./build-docker-image.sh
+
+# launch container with image above
+bash ./launch-docker-container.sh
+```
+
+### Build on local machine (Ubuntu-Only)
+Currently, we only provide the dev-environment setup script for Ubuntu:
+```
+cd scripts
+bash setup-ubuntu.sh
+```
+Other platforms are not supported yet, and you could use the container above 
as your dev environment.
diff --git a/cpp/scripts/build-docker-image.sh 
b/cpp/scripts/build-docker-image.sh
new file mode 100755
index 000000000..400e6da8a
--- /dev/null
+++ b/cpp/scripts/build-docker-image.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -eufx -o pipefail
+
+SCRIPT_DIR=$(cd $(dirname ${BASH_SOURCE[0]}); pwd)
+source ${SCRIPT_DIR}/docker-vars.sh
+
+docker build -f ${SCRIPT_DIR}/${DOCKERFILE} -t ${IMAGE_NAME}:${IMAGE_TAG} 
${SCRIPT_DIR}
diff --git a/cpp/scripts/docker-vars.sh b/cpp/scripts/docker-vars.sh
new file mode 100755
index 000000000..fdbd25ff9
--- /dev/null
+++ b/cpp/scripts/docker-vars.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+IMAGE_NAME="celeborn-cpp-dev"
+IMAGE_TAG="v0"
+DOCKERFILE="ubuntu-22.04-cpp.dockerfile"
diff --git a/cpp/scripts/launch-docker-container.sh 
b/cpp/scripts/launch-docker-container.sh
new file mode 100755
index 000000000..8b6346171
--- /dev/null
+++ b/cpp/scripts/launch-docker-container.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -eufx -o pipefail
+
+SCRIPT_DIR=$(cd $(dirname ${BASH_SOURCE[0]}); pwd)
+source ${SCRIPT_DIR}/docker-vars.sh
+
+PROJECT_DIR=$(dirname $(dirname ${SCRIPT_DIR}))
+MOUNT_DIR="/celeborn"
+CONTAINER_NAME="celeborn-cpp-dev-container"
+
+# Launch the container in interactive mode.
+docker run \
+    -v ${PROJECT_DIR}:${MOUNT_DIR} \
+    -w ${MOUNT_DIR} \
+    -it --rm \
+    --name ${CONTAINER_NAME} \
+    ${IMAGE_NAME}:${IMAGE_TAG} \
+    /bin/bash
diff --git a/cpp/scripts/setup-helper-functions.sh 
b/cpp/scripts/setup-helper-functions.sh
new file mode 100755
index 000000000..3e802a7e6
--- /dev/null
+++ b/cpp/scripts/setup-helper-functions.sh
@@ -0,0 +1,221 @@
+#!/bin/bash
+# Based on setup-helper-functions.sh from Facebook Velox
+#
+# Copyright (c) Facebook, Inc. and its affiliates.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# github_checkout $REPO $VERSION $GIT_CLONE_PARAMS clones or re-uses an 
existing clone of the
+# specified repo, checking out the requested version.
+
+DEPENDENCY_DIR=${DEPENDENCY_DIR:-$(pwd)/deps-download}
+OS_CXXFLAGS=""
+
+function run_and_time {
+  time "$@" || (echo "Failed to run $* ." ; exit 1 )
+  { echo "+ Finished running $*"; } 2> /dev/null
+}
+
+function prompt {
+  (
+    while true; do
+      local input="${PROMPT_ALWAYS_RESPOND:-}"
+      echo -n "$(tput bold)$* [Y, n]$(tput sgr0) "
+      [[ -z "${input}" ]] && read input
+      if [[ "${input}" == "Y" || "${input}" == "y" || "${input}" == "" ]]; then
+        return 0
+      elif [[ "${input}" == "N" || "${input}" == "n" ]]; then
+        return 1
+      fi
+    done
+  ) 2> /dev/null
+}
+
+function github_checkout {
+  local REPO=$1
+  shift
+  local VERSION=$1
+  shift
+  local GIT_CLONE_PARAMS=$@
+  local DIRNAME=$(basename $REPO)
+  SUDO="${SUDO:-""}"
+  cd "${DEPENDENCY_DIR}"
+  if [ -z "${DIRNAME}" ]; then
+    echo "Failed to get repo name from ${REPO}"
+    exit 1
+  fi
+  if [ -d "${DIRNAME}" ] && prompt "${DIRNAME} already exists. Delete?"; then
+    ${SUDO} rm -rf "${DIRNAME}"
+  fi
+  if [ ! -d "${DIRNAME}" ]; then
+    git clone -q -b $VERSION $GIT_CLONE_PARAMS "https://github.com/${REPO}.git";
+  fi
+  cd "${DIRNAME}"
+}
+
+# get_cxx_flags [$CPU_ARCH]
+# Echos appropriate compiler flags.
+# If $CPU_ARCH is set then we use that else we determine best possible set of 
flags
+# to use based on current cpu architecture.
+# The goal of this function is to consolidate all architecture specific flags 
to one
+# location.
+# The values that CPU_ARCH can take are as follows:
+#   arm64  : Target Apple silicon.
+#   aarch64: Target general 64 bit arm cpus.
+#   avx:     Target Intel CPUs with AVX.
+#   sse:     Target Intel CPUs with sse.
+# Echo's the appropriate compiler flags which can be captured as so
+# CXX_FLAGS=$(get_cxx_flags) or
+# CXX_FLAGS=$(get_cxx_flags "avx")
+
+function get_cxx_flags {
+  local CPU_ARCH=${1:-""}
+  local OS=$(uname)
+  local MACHINE=$(uname -m)
+
+  if [[ -z "$CPU_ARCH" ]]; then
+   if [ "$OS" = "Darwin" ]; then
+     if [ "$MACHINE" = "arm64" ]; then
+       CPU_ARCH="arm64"
+     else # x86_64
+       local CPU_CAPABILITIES=$(sysctl -a | grep machdep.cpu.features | awk 
'{print tolower($0)}')
+       if [[ $CPU_CAPABILITIES =~ "avx" ]]; then
+         CPU_ARCH="avx"
+       else
+         CPU_ARCH="sse"
+       fi
+     fi
+   elif [ "$OS" = "Linux" ]; then
+     if [ "$MACHINE" = "aarch64" ]; then
+       CPU_ARCH="aarch64"
+     else # x86_64
+       local CPU_CAPABILITIES=$(cat /proc/cpuinfo | grep flags | head -n 1| 
awk '{print tolower($0)}')
+       if [[ $CPU_CAPABILITIES =~ "avx" ]]; then
+           CPU_ARCH="avx"
+       elif [[ $CPU_CAPABILITIES =~ "sse" ]]; then
+           CPU_ARCH="sse"
+       fi
+     fi
+   else
+     echo "Unsupported platform $OS"; exit 1;
+   fi
+  fi
+  case $CPU_ARCH in
+
+    "arm64")
+      echo -n "-mcpu=apple-m1+crc -std=c++17 -fvisibility=hidden"
+    ;;
+
+    "avx")
+      echo -n "-mavx2 -mfma -mavx -mf16c -mlzcnt -std=c++17 -mbmi2"
+    ;;
+
+    "sse")
+      echo -n "-msse4.2 -std=c++17"
+    ;;
+
+    "aarch64")
+      # Read Arm MIDR_EL1 register to detect Arm cpu.
+      # 
https://developer.arm.com/documentation/100616/0301/register-descriptions/aarch64-system-registers/midr-el1--main-id-register--el1
+      ARM_CPU_FILE="/sys/devices/system/cpu/cpu0/regs/identification/midr_el1"
+
+      # 
https://gitlab.arm.com/telemetry-solution/telemetry-solution/-/blob/main/data/pmu/cpu/neoverse/neoverse-n1.json#L13
+      # N1:d0c; N2:d49; V1:d40;
+      Neoverse_N1="d0c"
+      Neoverse_N2="d49"
+      Neoverse_V1="d40"
+      if [ -f "$ARM_CPU_FILE" ]; then
+        hex_ARM_CPU_DETECT=`cat $ARM_CPU_FILE`
+        # PartNum, [15:4]: The primary part number such as Neoverse N1/N2 core.
+        ARM_CPU_PRODUCT=${hex_ARM_CPU_DETECT: -4:3}
+
+        if [ "$ARM_CPU_PRODUCT" = "$Neoverse_N1" ]; then
+          echo -n "-mcpu=neoverse-n1 -std=c++17"
+        elif [ "$ARM_CPU_PRODUCT" = "$Neoverse_N2" ]; then
+          echo -n "-mcpu=neoverse-n2 -std=c++17"
+        elif [ "$ARM_CPU_PRODUCT" = "$Neoverse_V1" ]; then
+          echo -n "-mcpu=neoverse-v1 -std=c++17"
+        else
+          echo -n "-march=armv8-a+crc+crypto -std=c++17"
+        fi
+      else
+        echo -n "-std=c++17"
+      fi
+    ;;
+  *)
+    echo -n "Architecture not supported!"
+  esac
+
+}
+
+function wget_and_untar {
+  local URL=$1
+  local DIR=$2
+  mkdir -p "${DEPENDENCY_DIR}"
+  pushd "${DEPENDENCY_DIR}"
+  SUDO="${SUDO:-""}"
+  if [ -d "${DIR}" ]; then
+    if prompt "${DIR} already exists. Delete?"; then
+      ${SUDO} rm -rf "${DIR}"
+    else
+      popd
+      return
+    fi
+  fi
+  mkdir -p "${DIR}"
+  pushd "${DIR}"
+  curl -L "${URL}" > $2.tar.gz
+  tar -xz --strip-components=1 -f $2.tar.gz
+  popd
+  popd
+}
+
+function cmake_install_dir {
+  pushd "${DEPENDENCY_DIR}/$1"
+  # remove the directory argument
+  shift
+  cmake_install $@
+  popd
+}
+
+function cmake_install {
+  local NAME=$(basename "$(pwd)")
+  local BINARY_DIR=_build
+  SUDO="${SUDO:-""}"
+  if [ -d "${BINARY_DIR}" ]; then
+    if prompt "Do you want to rebuild ${NAME}?"; then
+      ${SUDO} rm -rf "${BINARY_DIR}"
+    else
+      return
+    fi
+  fi
+
+  mkdir -p "${BINARY_DIR}"
+  COMPILER_FLAGS=$(get_cxx_flags)
+  # Add platform specific CXX flags if any
+  COMPILER_FLAGS+=${OS_CXXFLAGS}
+
+  # CMAKE_POSITION_INDEPENDENT_CODE is required so that CelebornCpp can be 
built into dynamic libraries
+  cmake -Wno-dev -B"${BINARY_DIR}" \
+    -GNinja \
+    -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
+    -DCMAKE_CXX_STANDARD=17 \
+    "${INSTALL_PREFIX+-DCMAKE_PREFIX_PATH=}${INSTALL_PREFIX-}" \
+    "${INSTALL_PREFIX+-DCMAKE_INSTALL_PREFIX=}${INSTALL_PREFIX-}" \
+    -DCMAKE_CXX_FLAGS="$COMPILER_FLAGS" \
+    -DBUILD_TESTING=OFF \
+    "$@"
+  # Exit if the build fails.
+  cmake --build "${BINARY_DIR}" || { echo 'build failed' ; exit 1; }
+  ${SUDO} cmake --install "${BINARY_DIR}"
+}
diff --git a/cpp/scripts/setup-ubuntu.sh b/cpp/scripts/setup-ubuntu.sh
new file mode 100755
index 000000000..1ebd4cb81
--- /dev/null
+++ b/cpp/scripts/setup-ubuntu.sh
@@ -0,0 +1,205 @@
+#!/bin/bash
+# Based on setup-ubuntu.sh from Facebook Velox
+#
+# Copyright (c) Facebook, Inc. and its affiliates.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This script documents setting up a Ubuntu host for CelebornCpp
+# development.  Running it should make you ready to compile.
+#
+# Environment variables:
+# * INSTALL_PREREQUISITES="N": Skip installation of packages for build.
+# * PROMPT_ALWAYS_RESPOND="n": Automatically respond to interactive prompts.
+#     Use "n" to never wipe directories.
+#
+# You can also run individual functions below by specifying them as arguments:
+# $ scripts/setup-ubuntu.sh install_googletest install_fmt
+#
+
+# Minimal setup for Ubuntu 22.04.
+set -eufx -o pipefail
+SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}")
+source $SCRIPTDIR/setup-helper-functions.sh
+
+# Folly must be built with the same compiler flags so that some low level types
+# are the same size.
+COMPILER_FLAGS=$(get_cxx_flags)
+export COMPILER_FLAGS
+NPROC=$(getconf _NPROCESSORS_ONLN)
+BUILD_DUCKDB="${BUILD_DUCKDB:-true}"
+export CMAKE_BUILD_TYPE=Release
+SUDO="${SUDO:-"sudo --preserve-env"}"
+USE_CLANG="${USE_CLANG:-false}"
+export INSTALL_PREFIX=${INSTALL_PREFIX:-"/usr/local"}
+DEPENDENCY_DIR=${DEPENDENCY_DIR:-$(pwd)/deps-download}
+
+DEPENDENCY_DIR=${DEPENDENCY_DIR:-$(pwd)/deps-download}
+OS_CXXFLAGS=""
+
+function install_clang15 {
+  VERSION=`cat /etc/os-release | grep VERSION_ID`
+  if [[ ! ${VERSION} =~ "22.04" && ! ${VERSION} =~ "24.04" ]]; then
+    echo "Warning: using the Clang configuration is for Ubuntu 22.04 and 
24.04. Errors might occur."
+  fi
+  CLANG_PACKAGE_LIST=clang-15
+  if [[ ${VERSION} =~ "22.04" ]]; then
+    CLANG_PACKAGE_LIST=${CLANG_PACKAGE_LIST} gcc-12 g++-12 libc++-12-dev
+  fi
+  ${SUDO} apt install ${CLANG_PACKAGE_LIST} -y
+}
+
+FB_OS_VERSION="v2024.07.01.00"
+FMT_VERSION="10.1.1"
+BOOST_VERSION="boost-1.84.0"
+ARROW_VERSION="15.0.0"
+STEMMER_VERSION="2.2.0"
+
+# Install packages required for build.
+function install_build_prerequisites {
+  ${SUDO} apt update
+  # The is an issue on 22.04 where a version conflict prevents glog install,
+  # installing libunwind first fixes this.
+  ${SUDO} apt install -y libunwind-dev
+  ${SUDO} apt install -y \
+    build-essential \
+    python3-pip \
+    ccache \
+    curl \
+    ninja-build \
+    checkinstall \
+    git \
+    pkg-config \
+    gdb \
+    wget
+
+  # Install to /usr/local to make it available to all users.
+  ${SUDO} pip3 install cmake==3.28.3
+
+  if [[ ${USE_CLANG} != "false" ]]; then
+    install_clang15
+  fi
+}
+
+# Install packages required for build.
+function install_celeborn_cpp_deps_from_apt {
+  ${SUDO} apt update
+  ${SUDO} apt install -y \
+    libc-ares-dev \
+    libcurl4-openssl-dev \
+    libssl-dev \
+    libicu-dev \
+    libdouble-conversion-dev \
+    libgoogle-glog-dev \
+    libbz2-dev \
+    libgflags-dev \
+    libgmock-dev \
+    libevent-dev \
+    libsodium-dev \
+    libzstd-dev \
+    libre2-dev
+}
+
+function install_fmt {
+  wget_and_untar https://github.com/fmtlib/fmt/archive/${FMT_VERSION}.tar.gz 
fmt
+  cmake_install_dir fmt -DFMT_TEST=OFF
+}
+
+function install_boost {
+  wget_and_untar 
https://github.com/boostorg/boost/releases/download/${BOOST_VERSION}/${BOOST_VERSION}.tar.gz
 boost
+  (
+    cd ${DEPENDENCY_DIR}/boost
+    if [[ ${USE_CLANG} != "false" ]]; then
+      ./bootstrap.sh --prefix=${INSTALL_PREFIX} --with-toolset="clang-15"
+      # Switch the compiler from the clang-15 toolset which doesn't exist 
(clang-15.jam) to
+      # clang of version 15 when toolset clang-15 is used.
+      # This reconciles the project-config.jam generation with what the b2 
build system allows for customization.
+      sed -i 's/using clang-15/using clang : 15/g' project-config.jam
+      ${SUDO} ./b2 "-j$(nproc)" -d0 install threading=multi toolset=clang-15 
--without-python
+    else
+      ./bootstrap.sh --prefix=${INSTALL_PREFIX}
+      ${SUDO} ./b2 "-j$(nproc)" -d0 install threading=multi --without-python
+    fi
+  )
+}
+
+function install_protobuf {
+  ### protobuf version must be aligned to CelebornJava.
+  wget_and_untar 
https://github.com/protocolbuffers/protobuf/releases/download/v21.7/protobuf-all-21.7.tar.gz
 protobuf
+  (
+    cd ${DEPENDENCY_DIR}/protobuf
+    ./configure CXXFLAGS="-fPIC" --prefix=${INSTALL_PREFIX}
+    make "-j${NPROC}"
+    sudo make install
+    sudo ldconfig
+  )
+}
+
+function install_folly {
+  wget_and_untar 
https://github.com/facebook/folly/archive/refs/tags/${FB_OS_VERSION}.tar.gz 
folly
+  cmake_install_dir folly -DBUILD_TESTS=OFF -DFOLLY_HAVE_INT128_T=ON
+}
+
+function install_fizz {
+  wget_and_untar 
https://github.com/facebookincubator/fizz/archive/refs/tags/${FB_OS_VERSION}.tar.gz
 fizz
+  cmake_install_dir fizz/fizz -DBUILD_TESTS=OFF
+}
+
+function install_wangle {
+  wget_and_untar 
https://github.com/facebook/wangle/archive/refs/tags/${FB_OS_VERSION}.tar.gz 
wangle
+  cmake_install_dir wangle/wangle -DBUILD_TESTS=OFF
+}
+
+function install_celeborn_cpp_deps {
+  run_and_time install_celeborn_cpp_deps_from_apt
+  run_and_time install_fmt
+  run_and_time install_protobuf
+  run_and_time install_boost
+  run_and_time install_folly
+  run_and_time install_fizz
+  run_and_time install_wangle
+}
+
+function install_apt_deps {
+  install_build_prerequisites
+  install_celeborn_cpp_deps_from_apt
+}
+
+(return 2> /dev/null) && return # If script was sourced, don't run commands.
+
+(
+  if [[ ${USE_CLANG} != "false" ]]; then
+    export CC=/usr/bin/clang-15
+    export CXX=/usr/bin/clang++-15
+  fi
+  if [[ $# -ne 0 ]]; then
+    for cmd in "$@"; do
+      run_and_time "${cmd}"
+    done
+    echo "All specified dependencies installed!"
+  else
+    if [ "${INSTALL_PREREQUISITES:-Y}" == "Y" ]; then
+      echo "Installing build dependencies"
+      run_and_time install_build_prerequisites
+    else
+      echo "Skipping installation of build dependencies since 
INSTALL_PREREQUISITES is not set"
+    fi
+    install_celeborn_cpp_deps
+    echo "All dependencies for CelebornCpp installed!"
+    if [[ ${USE_CLANG} != "false" ]]; then
+      echo "To use clang for the CelebornCpp build set the CC and CXX 
environment variables in your session."
+      echo "  export CC=/usr/bin/clang-15"
+      echo "  export CXX=/usr/bin/clang++-15"
+    fi
+  fi
+)
diff --git a/cpp/scripts/ubuntu-22.04-cpp.dockerfile 
b/cpp/scripts/ubuntu-22.04-cpp.dockerfile
new file mode 100644
index 000000000..b5cb4722c
--- /dev/null
+++ b/cpp/scripts/ubuntu-22.04-cpp.dockerfile
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+FROM ubuntu:22.04
+
+COPY ./* /scripts/
+
+SHELL ["/bin/bash", "-o", "pipefail", "-c"]
+
+RUN apt update && \
+      apt install -y sudo \
+            lsb-release
+
+RUN /scripts/setup-ubuntu.sh

Reply via email to