Skip to content

Commit

Permalink
Aggresively cleanup to reduce disk space
Browse files Browse the repository at this point in the history
  • Loading branch information
luhenry committed Feb 22, 2024
1 parent 584c599 commit 9089f4a
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions scripts/circleci-container.dockfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
FROM quay.io/centos/centos:stream8
ARG cpu_target
ENV CPU_TARGET=$cpu_target
ENV AGGRESSIVE_CLEANUP=true

COPY scripts/setup-helper-functions.sh /
COPY scripts/setup-centos8.sh /
Expand Down
41 changes: 41 additions & 0 deletions scripts/setup-centos8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export CXXFLAGS=$CFLAGS # Used by boost.
export CPPFLAGS=$CFLAGS # Used by LZO.
CMAKE_BUILD_TYPE="${BUILD_TYPE:-Release}"
BUILD_DUCKDB="${BUILD_DUCKDB:-true}"
AGGRESSIVE_CLEANUP="${AGGRESSIVE_CLEANUP:-false}"

function dnf_install {
dnf install -y -q --setopt=install_weak_deps=False "$@"
Expand Down Expand Up @@ -59,6 +60,9 @@ function install_gflags {
cd gflags
cmake_install -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_LIB=ON -DLIB_SUFFIX=64
)
if [ $AGGRESSIVE_CLEANUP = "true" ]; then
rm -rf gflags
fi
}

function install_glog {
Expand All @@ -67,6 +71,9 @@ function install_glog {
cd glog
cmake_install -DBUILD_SHARED_LIBS=ON
)
if [ $AGGRESSIVE_CLEANUP = "true" ]; then
rm -rf glog
fi
}

function install_lzo {
Expand All @@ -77,6 +84,9 @@ function install_lzo {
make "-j$(nproc)"
make install
)
if [ $AGGRESSIVE_CLEANUP = "true" ]; then
rm -rf lzo
fi
}

function install_boost {
Expand All @@ -86,6 +96,9 @@ function install_boost {
./bootstrap.sh --prefix=/usr/local
./b2 "-j$(nproc)" -d0 install threading=multi
)
if [ $AGGRESSIVE_CLEANUP = "true" ]; then
rm -rf boost
fi
}

function install_snappy {
Expand All @@ -94,6 +107,9 @@ function install_snappy {
cd snappy
cmake_install -DSNAPPY_BUILD_TESTS=OFF
)
if [ $AGGRESSIVE_CLEANUP = "true" ]; then
rm -rf snappy
fi
}

function install_fmt {
Expand All @@ -102,6 +118,9 @@ function install_fmt {
cd fmt
cmake_install -DFMT_TEST=OFF
)
if [ $AGGRESSIVE_CLEANUP = "true" ]; then
rm -rf fmt
fi
}

function install_protobuf {
Expand All @@ -113,6 +132,9 @@ function install_protobuf {
make install
ldconfig
)
if [ $AGGRESSIVE_CLEANUP = "true" ]; then
rm -rf protobuf
fi
}

FB_OS_VERSION="v2023.12.04.00"
Expand All @@ -123,6 +145,9 @@ function install_fizz {
cd fizz/fizz
cmake_install -DBUILD_TESTS=OFF
)
if [ $AGGRESSIVE_CLEANUP = "true" ]; then
rm -rf fizz
fi
}

function install_folly {
Expand All @@ -131,6 +156,9 @@ function install_folly {
cd folly
cmake_install -DFOLLY_HAVE_INT128_T=ON
)
if [ $AGGRESSIVE_CLEANUP = "true" ]; then
rm -rf folly
fi
}

function install_wangle {
Expand All @@ -139,6 +167,9 @@ function install_wangle {
cd wangle/wangle
cmake_install -DBUILD_TESTS=OFF
)
if [ $AGGRESSIVE_CLEANUP = "true" ]; then
rm -rf wangle
fi
}

function install_fbthrift {
Expand All @@ -147,6 +178,9 @@ function install_fbthrift {
cd fbthrift
cmake_install -Denable_tests=OFF
)
if [ $AGGRESSIVE_CLEANUP = "true" ]; then
rm -rf fbthrift
fi
}

function install_mvfst {
Expand All @@ -155,6 +189,9 @@ function install_mvfst {
cd mvfst
cmake_install -DBUILD_TESTS=OFF
)
if [ $AGGRESSIVE_CLEANUP = "true" ]; then
rm -rf mvfst
fi
}

function install_duckdb {
Expand All @@ -165,13 +202,17 @@ function install_duckdb {
cd duckdb
cmake_install -DBUILD_UNITTESTS=OFF -DENABLE_SANITIZER=OFF -DENABLE_UBSAN=OFF -DBUILD_SHELL=OFF -DEXPORT_DLL_SYMBOLS=OFF -DCMAKE_BUILD_TYPE=Release
)
if [ $AGGRESSIVE_CLEANUP = "true" ]; then
rm -rf duckdb
fi
fi
}

function install_cuda {
# See https://developer.nvidia.com/cuda-downloads
wget --progress=dot:giga https://developer.download.nvidia.com/compute/cuda/12.3.1/local_installers/cuda-repo-rhel7-12-3-local-12.3.1_545.23.08-1.x86_64.rpm
rpm -i cuda-repo-rhel7-12-3-local-12.3.1_545.23.08-1.x86_64.rpm
rm cuda-repo-rhel7-12-3-local-12.3.1_545.23.08-1.x86_64.rpm
dnf_install cuda-toolkit-12-3
}

Expand Down

0 comments on commit 9089f4a

Please sign in to comment.