diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ab18585..f0e344a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,13 +43,6 @@ jobs: - name: Prepare directories run: bash ci/prepare-dirs.sh - - name: Cache installed dependencies - id: cache-deps - uses: actions/cache@v4 - with: - path: ~/local - key: ${{ inputs.cache_key }} - - name: Cache Arrow third-party downloads id: cache-arrow-thirdparty uses: actions/cache@v4 @@ -62,21 +55,14 @@ jobs: run: bash ci/free-disk-space.sh - name: Build and install Greenplum - if: steps.cache-deps.outputs.cache-hit != 'true' run: bash ci/build-gpdb.sh "${{ inputs.gpdb_repo }}" "${{ inputs.gpdb_ref }}" ${{ inputs.open_gpdb && 'open-gpdb' || '' }} - name: Build and install Arrow 15 - if: steps.cache-deps.outputs.cache-hit != 'true' run: bash ci/build-arrow.sh - name: Build and install gRPC - if: steps.cache-deps.outputs.cache-hit != 'true' run: bash ci/build-grpc.sh - - name: Verify open-gpdb defines OPENGPDB - if: inputs.open_gpdb - run: bash ci/verify-opengpdb-define.sh - - name: Build Tea run: bash ci/build-tea.sh diff --git a/ci/build-gpdb.sh b/ci/build-gpdb.sh index c64e8ad..6422f78 100644 --- a/ci/build-gpdb.sh +++ b/ci/build-gpdb.sh @@ -1,52 +1,17 @@ #!/usr/bin/env bash -# Build and install Greenplum 6 into $HOME/local/gpdb. -# -# Usage: build-gpdb.sh [open-gpdb] -# -# Passing "open-gpdb" as the third argument enables the fixups needed for the -# open-gpdb fork (see the inline comments below); arenadata/gpdb builds without -# them. set -eo pipefail -repo="$1" -ref="$2" -mode="${3:-}" +TARGET_DIR="$HOME/local/gpdb" +PACKAGE_URL="https://github.com/GreengageDB/greengage/releases/download/6.29.2/greengage6.deb" -git clone "$repo" -b "$ref" --depth 1 gpdb -cd gpdb -git submodule update --init +deb_file=$(mktemp --suffix=.deb) +curl -sL -o "$deb_file" "$PACKAGE_URL" +mkdir -p "$TARGET_DIR" +sudo dpkg -x "$deb_file" "$TARGET_DIR" +rm -f "$deb_file" -configure_extra=() -if [ "$mode" = "open-gpdb" ]; then - # ORCA in open-gpdb still builds with -std=c++98/gnu++98, but the system - # Xerces-C 3.2 (Ubuntu 22.04) requires C++11 (char16_t); bump the ORCA C++ - # standard to gnu++14 (gnu++17 would reject ORCA's deprecated throw() specs). - # gnu++14 + -Wextra then surfaces -Wdeprecated-copy / -Wnonnull-compare which - # ORCA's -Werror turns fatal, so append -Wno-error=... last (wins over it). - for mk in src/backend/gpopt/gpopt.mk \ - src/backend/gporca/gporca.mk \ - src/backend/gporca/libgpos/src/common/Makefile; do - sed -i 's/-std=gnu++98/-std=gnu++14/g; s/-std=c++98/-std=gnu++14/g' "$mk" - printf '\noverride CPPFLAGS := $(CPPFLAGS) -Wno-error=deprecated-copy -Wno-error=nonnull-compare\n' >> "$mk" - done - # open-gpdb defaults --with-mdblocales=yes and hard-requires the mdblocales - # lib/header, which is not available on the CI image. - configure_extra+=(--without-mdblocales) -fi +sudo chown -R "$USER:$USER" "$TARGET_DIR" -# TODO(gmusya): consider using --enable-cassert -./configure --with-perl --with-python --with-libxml --with-gssapi \ - --with-pythonsrc-ext "${configure_extra[@]}" --prefix="$HOME/local/gpdb" - -if [ "$mode" = "open-gpdb" ]; then - # src/common (FRONTEND) includes the backend-generated utils/errcodes.h but - # has no order-only dep on it, so -j8 races ("errcodes.h: No such file"). - # Force the generated header first. - make -C src/backend submake-errcodes -fi - -make -j8 -make -j8 install - -cd .. -rm -rf gpdb +mv "$TARGET_DIR/opt/greengagedb/greengage"/* "$TARGET_DIR/" 2>/dev/null || true +mv "$TARGET_DIR/opt/greengagedb/greengage"/.* "$TARGET_DIR/" 2>/dev/null || true +rm -rf "$TARGET_DIR/opt" diff --git a/ci/deploy-tea-config.sh b/ci/deploy-tea-config.sh index d2c9a02..a3e1fbd 100644 --- a/ci/deploy-tea-config.sh +++ b/ci/deploy-tea-config.sh @@ -9,7 +9,7 @@ set -eo pipefail config="${1:-test/config/tea-config.json}" -source "$HOME/local/gpdb/greenplum_path.sh" +source "$HOME/local/gpdb/greengage_path.sh" mkdir -p "$GPHOME/tea" cp "$config" "$GPHOME/tea/tea-config.json" cp test/config/tea-config-schema.json "$GPHOME/tea/tea-config-schema.json" diff --git a/ci/run-smoke.sh b/ci/run-smoke.sh index 2d13e93..7cad705 100644 --- a/ci/run-smoke.sh +++ b/ci/run-smoke.sh @@ -4,7 +4,7 @@ # Usage: run-smoke.sh set -eo pipefail -source "$HOME/local/gpdb/greenplum_path.sh" +source "$HOME/local/gpdb/greengage_path.sh" export MASTER_DATA_DIRECTORY=/gpdata/master/gpsne-1 build/tea/smoke_test/smoke_test \ --metadata_type="$1" \ diff --git a/ci/start-cluster.sh b/ci/start-cluster.sh index 92fe437..efececc 100644 --- a/ci/start-cluster.sh +++ b/ci/start-cluster.sh @@ -12,7 +12,7 @@ sudo locale-gen "ru_RU.CP1251" sudo mkdir -p /gpdata sudo chown "$USER" /gpdata -source "$HOME/local/gpdb/greenplum_path.sh" +source "$HOME/local/gpdb/greengage_path.sh" export MASTER_DATA_DIRECTORY=/gpdata/master/gpsne-1 NUM_SEGS=2 bash test/start-gp.sh "$HOME/local/gpdb" /gpdata diff --git a/ci/verify-opengpdb-define.sh b/ci/verify-opengpdb-define.sh deleted file mode 100644 index 53d490c..0000000 --- a/ci/verify-opengpdb-define.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash -# tea relies on the OPENGPDB macro (defined in pg_config_manual.h) to select -# the open-gpdb sampling API; make sure the freshly built gpdb defines it. -set -ex - -grep -q '#define OPENGPDB' \ - "$HOME/local/gpdb/include/postgresql/server/pg_config_manual.h" diff --git a/test/start-gp.sh b/test/start-gp.sh index 97820ad..ab78abe 100755 --- a/test/start-gp.sh +++ b/test/start-gp.sh @@ -22,7 +22,7 @@ done # Not following ...: does not exist # shellcheck disable=SC1091 -source "$gp_root"/greenplum_path.sh +source "$gp_root"/greengage_path.sh mkdir "$config_dir" "$master_dir" "${seg_dirs[@]}" readonly hostlist="$config_dir/hostlist"