Skip to content

Commit

Permalink
Merge pull request #26 from arenadata/2.3.0-sync
Browse files Browse the repository at this point in the history
Sync 2.3.0 changes
  • Loading branch information
Stolb27 authored Dec 4, 2023
2 parents e6899aa + b5b3589 commit 5e402a7
Show file tree
Hide file tree
Showing 93 changed files with 4,157 additions and 1,813 deletions.
20 changes: 19 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,31 @@ set_target_properties(
C_STANDARD 99
LINKER_LANGUAGE "C")

if (${GP_MAJOR_VERSION} STRGREATER_EQUAL "7")
TARGET_LINK_LIBRARIES(diskquota ${PG_LIB_DIR}/libpq.so)
endif()

# packing part, move to a separate file if this part is too large
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Distro.cmake)

if(DEFINED DISKQUOTA_LAST_RELEASE_PATH)
message(STATUS "Copy pervious installer from ${DISKQUOTA_LAST_RELEASE_PATH}")
file(ARCHIVE_EXTRACT INPUT ${DISKQUOTA_LAST_RELEASE_PATH} PATTERNS "*.so")
file(GLOB DISKQUOTA_PREVIOUS_LIBRARY
file(GLOB so_files_list
"${CMAKE_BINARY_DIR}/lib/postgresql/*.so")

foreach(so_path IN LISTS so_files_list)
get_filename_component(so_name ${so_path} NAME_WLE)
# Replace 'diskquota-x.y' with 'x.y'. 'diskquota' won't be replaced, which belongs to 1.x release.
string(REPLACE "diskquota-" "" so_ver ${so_name})
# Install the previous so files. Those so files have versions less than current version.
# diskqutoa.so doesn't have version string in the file name. It belongs to 1.x release.
if((${so_ver} STREQUAL "diskquota") OR
${so_ver} VERSION_LESS ${DISKQUOTA_MAJOR_VERSION}.${DISKQUOTA_MINOR_VERSION})
list(APPEND DISKQUOTA_PREVIOUS_LIBRARY ${so_path})
endif()
endforeach()

install(PROGRAMS ${DISKQUOTA_PREVIOUS_LIBRARY} DESTINATION "lib/postgresql/")

get_filename_component(
Expand Down Expand Up @@ -150,6 +167,7 @@ BuildInfo_Create(${build_info_PATH}

# Add installcheck targets
add_subdirectory(tests)
add_subdirectory(upgrade_test)

# NOTE: keep install part at the end of file, to overwrite previous binary
install(PROGRAMS "cmake/install_gpdb_component" DESTINATION ".")
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.1
2.3.0
6 changes: 5 additions & 1 deletion cmake/Distro.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@ if(NOT DISTRO_NAME)
string(REGEX MATCH "CentOS Linux release 7.*" matched7 "${rh_release}")
string(REGEX MATCH "Red Hat Enterprise Linux release 8.*" matched_rhel8 "${rh_release}")
string(REGEX MATCH "CentOS Linux release 8.*" matched_centos8 "${rh_release}")
string(REGEX MATCH "Rocky Linux release 8.*" matched_rocky8 "${rh_release}")
string(REGEX MATCH "Rocky Linux release 8.*" matched_rocky8 "${rh_release}")
string(REGEX MATCH "Red Hat Enterprise Linux release 9.*" matched_rhel9 "${rh_release}")
string(REGEX MATCH "Rocky Linux release 9.*" matched_rocky9 "${rh_release}")
if (matched6)
set(DISTRO_NAME rhel6)
elseif(matched7)
set(DISTRO_NAME rhel7)
elseif(matched_rhel8 OR matched_centos8 OR matched_rocky8)
set(DISTRO_NAME rhel8)
elseif(matched_rhel9 OR matched_rocky9)
set(DISTRO_NAME rhel9)
endif()
elseif(EXISTS "/etc/os-release")
file(READ /etc/os-release os_release)
Expand Down
90 changes: 0 additions & 90 deletions concourse/README.md

This file was deleted.

35 changes: 35 additions & 0 deletions concourse/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash -l

set -exo pipefail

function pkg() {
[ -f /opt/gcc_env.sh ] && source /opt/gcc_env.sh
source /usr/local/greenplum-db-devel/greenplum_path.sh

# Always use the gcc from $PATH, to avoid using a lower version compiler by /usr/bin/cc
export CC="$(which gcc)"
export CXX="$(which g++)"

pushd /home/gpadmin/diskquota_artifacts
if [[ $OS_NAME == "rhel9" ]]
then
cmake /home/gpadmin/diskquota_src \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
-DDISKQUOTA_DDL_CHANGE_CHECK=off
cmake --build . --target create_artifact
else
local last_release_path
last_release_path=$(readlink -eq /home/gpadmin/last_released_diskquota_bin/diskquota-*.tar.gz)
cmake /home/gpadmin/diskquota_src \
-DDISKQUOTA_LAST_RELEASE_PATH="${last_release_path}" \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}"
cmake --build . --target create_artifact
fi
popd
}

function _main() {
time pkg
}

_main "$@"
6 changes: 3 additions & 3 deletions concourse/scripts/entry.sh → concourse/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,13 @@ case "$1" in
build)
su gpadmin -c \
"source /home/gpadmin/.bashrc &&\
/home/gpadmin/diskquota_src/concourse/scripts/build_diskquota.sh"
OS_NAME=rhel9 /home/gpadmin/diskquota_src/concourse/build.sh"
;;
test)
# Build task output is diskquota_artifacts, which is different from test taks input
# diskquota_bin. Ideally we can use the same name for input and output. But that will cause
# compatible issues with 1.x pipeline script.
ln -s /home/gpadmin/bin_diskquota /home/gpadmin/diskquota_artifacts
#ln -s /home/gpadmin/bin_diskquota /home/gpadmin/diskquota_artifacts
create_fake_gpdb_src
# Create GPDB cluster
source "/home/gpadmin/gpdb_src/concourse/scripts/common.bash"
Expand All @@ -160,7 +160,7 @@ case "$1" in
echo "source /usr/local/greenplum-db-devel/greenplum_path.sh" >> /home/gpadmin/.bashrc
su gpadmin -c \
"source /home/gpadmin/.bashrc &&\
/home/gpadmin/diskquota_src/concourse/scripts/test_diskquota.sh"
OS_NAME=rhel9 /home/gpadmin/diskquota_src/concourse/test.sh"
;;
*)
echo "Unknown target task $1"
Expand Down
167 changes: 0 additions & 167 deletions concourse/fly.sh

This file was deleted.

Loading

0 comments on commit 5e402a7

Please sign in to comment.