Added timers to setup.sh for downloading and unzipping

This commit is contained in:
Aaron 2024-02-15 09:48:50 +01:00 committed by Blyron
parent d6049290b3
commit 1433186a01
1 changed files with 103 additions and 5 deletions

View File

@ -92,15 +92,30 @@ for PY_VERSION in ${PY_VERSION_LIST[@]} ; do
BOOST_PACKAGE_BASENAME=boost_${BOOST_VERSION//./_} BOOST_PACKAGE_BASENAME=boost_${BOOST_VERSION//./_}
log "Retrieving boost." log "Retrieving boost."
start=$(date +%s)
wget "https://archives.boost.io/release/${BOOST_VERSION}/source/${BOOST_PACKAGE_BASENAME}.tar.gz" || true wget "https://archives.boost.io/release/${BOOST_VERSION}/source/${BOOST_PACKAGE_BASENAME}.tar.gz" || true
end=$(date +%s)
echo "Elapsed Time downloading from boost webpage: $(($end-$start)) seconds"
# try to use the backup boost we have in Jenkins # try to use the backup boost we have in Jenkins
if [ ! -f "${BOOST_PACKAGE_BASENAME}.tar.gz" ] || [[ $(sha256sum "${BOOST_PACKAGE_BASENAME}.tar.gz") != "${BOOST_SHA256SUM}" ]] ; then if [ ! -f "${BOOST_PACKAGE_BASENAME}.tar.gz" ] || [[ $(sha256sum "${BOOST_PACKAGE_BASENAME}.tar.gz") != "${BOOST_SHA256SUM}" ]] ; then
log "Using boost backup" log "Using boost backup"
start=$(date +%s)
wget "https://carla-releases.s3.us-east-005.backblazeb2.com/Backup/${BOOST_PACKAGE_BASENAME}.tar.gz" || true wget "https://carla-releases.s3.us-east-005.backblazeb2.com/Backup/${BOOST_PACKAGE_BASENAME}.tar.gz" || true
end=$(date +%s)
echo "Elapsed Time downloading from boost carla backup in backblaze: $(($end-$start)) seconds"
fi fi
log "Extracting boost for Python ${PY_VERSION}." log "Extracting boost for Python ${PY_VERSION}."
start=$(date +%s)
tar -xzf ${BOOST_PACKAGE_BASENAME}.tar.gz tar -xzf ${BOOST_PACKAGE_BASENAME}.tar.gz
end=$(date +%s)
echo "Elapsed Time Extracting boost for Python: $(($end-$start)) seconds"
mkdir -p ${BOOST_BASENAME}-install/include mkdir -p ${BOOST_BASENAME}-install/include
mv ${BOOST_PACKAGE_BASENAME} ${BOOST_BASENAME}-source mv ${BOOST_PACKAGE_BASENAME} ${BOOST_BASENAME}-source
@ -166,8 +181,12 @@ else
log "Retrieving rpclib." log "Retrieving rpclib."
start_download_time=$(date +%s)
git clone -b ${RPCLIB_PATCH} https://github.com/carla-simulator/rpclib.git ${RPCLIB_BASENAME}-source git clone -b ${RPCLIB_PATCH} https://github.com/carla-simulator/rpclib.git ${RPCLIB_BASENAME}-source
end_download_time=$(date +%s)
echo "Elapsed Time downloading rpclib: $(($end-$start)) seconds"
log "Building rpclib with libc++." log "Building rpclib with libc++."
# rpclib does not use any cmake 3.9 feature. # rpclib does not use any cmake 3.9 feature.
@ -234,8 +253,13 @@ else
log "Retrieving Google Test." log "Retrieving Google Test."
start_download_time=$(date +%s)
git clone --depth=1 -b release-${GTEST_VERSION} https://github.com/google/googletest.git ${GTEST_BASENAME}-source git clone --depth=1 -b release-${GTEST_VERSION} https://github.com/google/googletest.git ${GTEST_BASENAME}-source
end_download_time=$(date +%s)
echo "Elapsed Time downloading rpclib: $(($end-$start)) seconds"
log "Building Google Test with libc++." log "Building Google Test with libc++."
mkdir -p ${GTEST_BASENAME}-libcxx-build mkdir -p ${GTEST_BASENAME}-libcxx-build
@ -296,12 +320,15 @@ else
log "Retrieving Recast & Detour" log "Retrieving Recast & Detour"
git clone https://github.com/carla-simulator/recastnavigation.git ${RECAST_BASENAME}-source start=$(date +%s)
git clone --depth 1 -b carla https://github.com/carla-simulator/recastnavigation.git ${RECAST_BASENAME}-source
end=$(date +%s)
echo "Elapsed Time downloading: $(($end-$start)) seconds"
pushd ${RECAST_BASENAME}-source >/dev/null pushd ${RECAST_BASENAME}-source >/dev/null
git checkout carla
popd >/dev/null popd >/dev/null
log "Building Recast & Detour with libc++." log "Building Recast & Detour with libc++."
@ -351,10 +378,18 @@ if [[ -d ${LIBPNG_INSTALL} ]] ; then
log "Libpng already installed." log "Libpng already installed."
else else
log "Retrieving libpng." log "Retrieving libpng."
wget ${LIBPNG_REPO}
start=$(date +%s)
wget ${LIBPNG_REPO}
end=$(date +%s)
echo "Elapsed Time downloading libpng: $(($end-$start)) seconds"
start=$(date +%s)
log "Extracting libpng." log "Extracting libpng."
tar -xf libpng-${LIBPNG_VERSION}.tar.xz tar -xf libpng-${LIBPNG_VERSION}.tar.xz
end=$(date +%s)
echo "Elapsed Time Extracting libpng: $(($end-$start)) seconds"
mv ${LIBPNG_BASENAME} ${LIBPNG_BASENAME}-source mv ${LIBPNG_BASENAME} ${LIBPNG_BASENAME}-source
pushd ${LIBPNG_BASENAME}-source >/dev/null pushd ${LIBPNG_BASENAME}-source >/dev/null
@ -388,16 +423,26 @@ if [[ -d ${XERCESC_INSTALL_DIR} && -d ${XERCESC_INSTALL_SERVER_DIR} ]] ; then
log "Xerces-c already installed." log "Xerces-c already installed."
else else
log "Retrieving xerces-c." log "Retrieving xerces-c."
start=$(date +%s)
wget ${XERCESC_REPO} wget ${XERCESC_REPO}
end=$(date +%s)
echo "Elapsed Time downloading from xerces repo: $(($end-$start)) seconds"
# try to use the backup boost we have in Jenkins # try to use the backup boost we have in Jenkins
if [[ ! -f "${XERCESC_BASENAME}.tar.gz" ]] ; then if [[ ! -f "${XERCESC_BASENAME}.tar.gz" ]] ; then
log "Using xerces backup" log "Using xerces backup"
start=$(date +%s)
wget "https://carla-releases.s3.us-east-005.backblazeb2.com/Backup/${XERCESC_BASENAME}.tar.gz" || true wget "https://carla-releases.s3.us-east-005.backblazeb2.com/Backup/${XERCESC_BASENAME}.tar.gz" || true
end=$(date +%s)
echo "Elapsed Time downloading from xerces backup: $(($end-$start)) seconds"
fi fi
log "Extracting xerces-c." log "Extracting xerces-c."
start=$(date +%s)
tar -xzf ${XERCESC_BASENAME}.tar.gz tar -xzf ${XERCESC_BASENAME}.tar.gz
end=$(date +%s)
echo "Elapsed Time Extracting xerces-c: $(($end-$start)) seconds"
mv ${XERCESC_BASENAME} ${XERCESC_SRC_DIR} mv ${XERCESC_BASENAME} ${XERCESC_SRC_DIR}
mkdir -p ${XERCESC_INSTALL_DIR} mkdir -p ${XERCESC_INSTALL_DIR}
mkdir -p ${XERCESC_SRC_DIR}/build mkdir -p ${XERCESC_SRC_DIR}/build
@ -461,10 +506,18 @@ if [[ -d ${EIGEN_INSTALL_DIR} ]] ; then
log "Eigen already installed." log "Eigen already installed."
else else
log "Retrieving Eigen." log "Retrieving Eigen."
start=$(date +%s)
wget ${EIGEN_REPO} wget ${EIGEN_REPO}
end=$(date +%s)
echo "Elapsed Time downloading from eigen repo: $(($end-$start)) seconds"
log "Extracting Eigen." log "Extracting Eigen."
start=$(date +%s)
tar -xzf ${EIGEN_BASENAME}.tar.gz tar -xzf ${EIGEN_BASENAME}.tar.gz
end=$(date +%s)
echo "Elapsed Time Extracting EIGEN: $(($end-$start)) seconds"
mv ${EIGEN_BASENAME} ${EIGEN_SRC_DIR} mv ${EIGEN_BASENAME} ${EIGEN_SRC_DIR}
mkdir -p ${EIGEN_INCLUDE}/unsupported mkdir -p ${EIGEN_INCLUDE}/unsupported
mv ${EIGEN_SRC_DIR}/Eigen ${EIGEN_INCLUDE} mv ${EIGEN_SRC_DIR}/Eigen ${EIGEN_INCLUDE}
@ -496,10 +549,19 @@ if ${USE_CHRONO} ; then
log "Eigen already installed." log "Eigen already installed."
else else
log "Retrieving Eigen." log "Retrieving Eigen."
start=$(date +%s)
wget ${EIGEN_REPO} wget ${EIGEN_REPO}
end=$(date +%s)
echo "Elapsed Time: $(($end-$start)) seconds"
log "Extracting Eigen." log "Extracting Eigen."
start=$(date +%s)
tar -xzf ${EIGEN_BASENAME}.tar.gz tar -xzf ${EIGEN_BASENAME}.tar.gz
end=$(date +%s)
echo "Elapsed Time Extracting for Eigen: $(($end-$start)) seconds"
mv ${EIGEN_BASENAME} ${EIGEN_SRC_DIR} mv ${EIGEN_BASENAME} ${EIGEN_SRC_DIR}
mkdir -p ${EIGEN_INCLUDE}/unsupported mkdir -p ${EIGEN_INCLUDE}/unsupported
mv ${EIGEN_SRC_DIR}/Eigen ${EIGEN_INCLUDE} mv ${EIGEN_SRC_DIR}/Eigen ${EIGEN_INCLUDE}
@ -527,7 +589,10 @@ if ${USE_CHRONO} ; then
log "chrono library already installed." log "chrono library already installed."
else else
log "Retrieving chrono library." log "Retrieving chrono library."
start=$(date +%s)
git clone --depth 1 --branch ${CHRONO_TAG} ${CHRONO_REPO} ${CHRONO_SRC_DIR} git clone --depth 1 --branch ${CHRONO_TAG} ${CHRONO_REPO} ${CHRONO_SRC_DIR}
end=$(date +%s)
echo "Elapsed Time dowloading chrono: $(($end-$start)) seconds"
mkdir -p ${CHRONO_SRC_DIR}/build mkdir -p ${CHRONO_SRC_DIR}/build
@ -574,10 +639,19 @@ if [[ -d ${SQLITE_INSTALL_DIR} ]] ; then
log "Sqlite already installed." log "Sqlite already installed."
else else
log "Retrieving Sqlite3" log "Retrieving Sqlite3"
start=$(date +%s)
wget ${SQLITE_REPO} wget ${SQLITE_REPO}
end=$(date +%s)
echo "Elapsed Time: $(($end-$start)) seconds"
log "Extracting Sqlite3" log "Extracting Sqlite3"
start=$(date +%s)
tar -xzf ${SQLITE_TAR} tar -xzf ${SQLITE_TAR}
end=$(date +%s)
echo "Elapsed Time Extracting for SQlite: $(($end-$start)) seconds"
mv ${SQLITE_VERSION} ${SQLITE_SOURCE_DIR} mv ${SQLITE_VERSION} ${SQLITE_SOURCE_DIR}
mkdir ${SQLITE_INSTALL_DIR} mkdir ${SQLITE_INSTALL_DIR}
@ -621,10 +695,18 @@ if [[ -d ${PROJ_INSTALL_DIR} && -d ${PROJ_INSTALL_SERVER_DIR_FULL} ]] ; then
log "PROJ already installed." log "PROJ already installed."
else else
log "Retrieving PROJ" log "Retrieving PROJ"
start=$(date +%s)
wget ${PROJ_REPO} wget ${PROJ_REPO}
end=$(date +%s)
echo "Elapsed Time: $(($end-$start)) seconds"
log "Extracting PROJ" log "Extracting PROJ"
start=$(date +%s)
tar -xzf ${PROJ_TAR} tar -xzf ${PROJ_TAR}
end=$(date +%s)
echo "Elapsed Time Extracting for PROJ: $(($end-$start)) seconds"
mv ${PROJ_VERSION} ${PROJ_SRC_DIR} mv ${PROJ_VERSION} ${PROJ_SRC_DIR}
mkdir -p ${PROJ_SRC_DIR}/build mkdir -p ${PROJ_SRC_DIR}/build
@ -692,10 +774,18 @@ if [[ -d ${PATCHELF_INSTALL_DIR} ]] ; then
log "Patchelf already installed." log "Patchelf already installed."
else else
log "Retrieving patchelf" log "Retrieving patchelf"
start=$(date +%s)
wget ${PATCHELF_REPO} wget ${PATCHELF_REPO}
end=$(date +%s)
echo "Elapsed Time: $(($end-$start)) seconds"
log "Extracting patchelf" log "Extracting patchelf"
start=$(date +%s)
tar -xzf ${PATCHELF_TAR} tar -xzf ${PATCHELF_TAR}
end=$(date +%s)
echo "Elapsed Time Extracting patchelf: $(($end-$start)) seconds"
mv patchelf-${PATCHELF_VERSION} ${PATCHELF_SOURCE_DIR} mv patchelf-${PATCHELF_VERSION} ${PATCHELF_SOURCE_DIR}
mkdir ${PATCHELF_INSTALL_DIR} mkdir ${PATCHELF_INSTALL_DIR}
@ -730,7 +820,12 @@ if ${USE_PYTORCH} ; then
LIBTORCH_ZIPFILE=libtorch-shared-with-deps-1.11.0+cu113.zip LIBTORCH_ZIPFILE=libtorch-shared-with-deps-1.11.0+cu113.zip
LIBTORCH_REPO=https://download.pytorch.org/libtorch/cu113/libtorch-shared-with-deps-1.11.0%2Bcu113.zip LIBTORCH_REPO=https://download.pytorch.org/libtorch/cu113/libtorch-shared-with-deps-1.11.0%2Bcu113.zip
if [[ ! -d ${LIBTORCH_PATH} ]] ; then if [[ ! -d ${LIBTORCH_PATH} ]] ; then
start=$(date +%s)
wget ${LIBTORCH_REPO} wget ${LIBTORCH_REPO}
end=$(date +%s)
echo "Elapsed Time downloading LIBTORCH_REPO: $(($end-$start)) seconds"
unzip ${LIBTORCH_ZIPFILE} unzip ${LIBTORCH_ZIPFILE}
fi fi
@ -810,7 +905,10 @@ if ${USE_ROS2} ; then
if [[ ! -d ${LIB_SOURCE} ]] ; then if [[ ! -d ${LIB_SOURCE} ]] ; then
mkdir -p ${LIB_SOURCE} mkdir -p ${LIB_SOURCE}
log "${LIB_REPO}" log "${LIB_REPO}"
start=$(date +%s)
git clone --depth 1 --branch ${LIB_BRANCH} ${LIB_REPO} ${LIB_SOURCE} git clone --depth 1 --branch ${LIB_BRANCH} ${LIB_REPO} ${LIB_SOURCE}
end=$(date +%s)
echo "Elapsed Time dowloading fastdds extension: $(($end-$start)) seconds"
mkdir -p ${LIB_SOURCE}/build mkdir -p ${LIB_SOURCE}/build
fi fi
} }