Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 42 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,55 @@ jobs:
if: inputs.open_gpdb
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: Install Debian packages
run: |
TARGET_DIR="$HOME/local/gpdb"
EXPECTED_SCRIPT="greenplum_path.sh"
TEMP_DIR="$HOME/local/temp_install"

if [ "${{ inputs.open_gpdb }}" == "true" ]; then
PACKAGE_URL="https://github.com/open-gpdb/gpdb/releases/download/6.29.9/greenplum-db-6_6.29.9-1-yandex.54459.ae09c99827_amd64.deb"
echo "Installing open-gpdb..."
else
PACKAGE_URL="https://github.com/GreengageDB/greengage/releases/download/6.29.2/greengage6.deb"
echo "Installing Greengage..."
fi

mkdir -p "$TEMP_DIR"
wget -q "$PACKAGE_URL" -O /tmp/gp.deb
sudo apt-get remove -y python-is-python3 || true
sudo dpkg -x /tmp/gp.deb "$TEMP_DIR"
rm -f /tmp/gp.deb

REAL_SOURCE=$(find "$TEMP_DIR" -type d -exec test -f {}/"$EXPECTED_SCRIPT" \; -print -quit 2>/dev/null)
if [ -z "$REAL_SOURCE" ]; then
FOUND_SCRIPT=$(find "$TEMP_DIR" -type f -name "*_path.sh" | head -n 1)
[ -n "$FOUND_SCRIPT" ] && REAL_SOURCE=$(dirname "$FOUND_SCRIPT") && EXPECTED_SCRIPT=$(basename "$FOUND_SCRIPT")
fi

if [ -z "$REAL_SOURCE" ]; then
echo "ERROR: Installation directory not found" >&2; exit 1
fi

sudo rm -rf "$TARGET_DIR"
sudo mv "$REAL_SOURCE" "$TARGET_DIR"
sudo rm -rf "$TEMP_DIR"

sudo chown -R "$USER:$USER" "$TARGET_DIR"

if [ "$(basename "$EXPECTED_SCRIPT")" != "greenplum_path.sh" ]; then
ln -s "$EXPECTED_SCRIPT" "$TARGET_DIR/greenplum_path.sh"
fi

source "$TARGET_DIR/greenplum_path.sh"
echo "Greenplum ready at: $GPHOME"

- 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

Expand Down
52 changes: 0 additions & 52 deletions ci/build-gpdb.sh

This file was deleted.

14 changes: 14 additions & 0 deletions ci/install-runtime-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ sudo apt-get install -y \
python2 \
redis-server \
software-properties-common

if ! command -v pip >/dev/null 2>&1 || ! pip --version 2>&1 | grep -q "python 2"; then
echo "Installing pip for Python 2..."
curl -s https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
python2 get-pip.py
rm get-pip.py
fi
echo "Installing psutil==5.9.8 for Python 2..."
pip install "psutil==5.9.8"
GP_PYTHON_LIB="$HOME/local/gpdb/lib/python"
SITE_PACKAGES=$(python2 -c "import site; print(site.getsitepackages()[0])")
echo "Adding Greenplum libs to Python 2 site-packages: $SITE_PACKAGES"
echo "$GP_PYTHON_LIB" | sudo tee "$SITE_PACKAGES/greenplum.pth" > /dev/null

sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get install -y libstdc++6
sudo systemctl disable --now redis-server
Expand Down
7 changes: 0 additions & 7 deletions ci/verify-opengpdb-define.sh

This file was deleted.

36 changes: 36 additions & 0 deletions test/start-gp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,40 @@ done
# shellcheck disable=SC1091
source "$gp_root"/greenplum_path.sh

export GPHOME="$gp_root"
export PATH="$GPHOME/bin:$PATH"
export LD_LIBRARY_PATH="$GPHOME/lib:$LD_LIBRARY_PATH"
export PYTHONPATH="$GPHOME/lib/python:$PYTHONPATH"

PYTHON_BIN=$(command -v python)
PYTHON_VER=$(python --version 2>&1)

echo "DEBUG: Using python binary: $PYTHON_BIN"
echo "DEBUG: Python version: $PYTHON_VER"
echo "DEBUG: PYTHONPATH: $PYTHONPATH"

if [[ ! "$PYTHON_VER" =~ "Python 2" ]]; then
echo "ERROR: Greenplum requires Python 2, but 'python' command resolves to: $PYTHON_VER"
echo "Attempting to force python2..."
if command -v python2 &> /dev/null; then
mkdir -p "$HOME/bin"
ln -sf "$(command -v python2)" "$HOME/bin/python"
export PATH="$HOME/bin:$PATH"
echo "DEBUG: Created symlink $HOME/bin/python -> python2"
echo "DEBUG: New python version: $(python --version 2>&1)"
else
echo "ERROR: python2 not found!"
exit 1
fi
fi

echo "DEBUG: Testing import..."
if ! python -c "import gppylib.mainUtils"; then
echo "ERROR: Import failed despite checks."
python -c "import sys; print(sys.path); import gppylib.mainUtils"
exit 1
fi

mkdir "$config_dir" "$master_dir" "${seg_dirs[@]}"
readonly hostlist="$config_dir/hostlist"
echo "$HOSTNAME" >"$hostlist"
Expand All @@ -46,8 +80,10 @@ IP_ALLOW=0.0.0.0/0
# Path for Greenplum mgmt utils and Greenplum binaries
PATH=$src_root/test/bin:$GPHOME/bin:$PATH
LD_LIBRARY_PATH=$GPHOME/lib:$LD_LIBRARY_PATH
PYTHONPATH=$GPHOME/lib/python:$PYTHONPATH
export PATH
export LD_LIBRARY_PATH
export PYTHONPATH
export MASTER_DATA_DIRECTORY
export TRUSTED_SHELL
EOM
Expand Down
Loading